What's new

Restricting access on php files to certain groups.

_B_

Resident Member
500 Posts Club
May 18, 2020
934
4
USD
$0.0000USD
Biznotes
0
This isn't a feature built inside MyBB (from what I'm aware off) and requires you to modify the .php files inside your root (mostly they are located here but it may be somewhere different). You can access it from your host's inbuilt system although I recommend you use Filezilla as it's easier to transfer files. So here is what you do:
Always make sure you have a copy of the original file before editing in case it doesn't work.

1) Once you have found the .php file you are wanting to edit, open it up to edit with notepad++ or something of your choice.
2) Add this code somewhere:
PHP:
$allowed = array('X1'); // 

if(!in_array($mybb->user['usergroup'], $allowed))
{
	error('X2', 'Main Board');
}
Make sure you know exactly where to add it otherwise it may cause some errors on your site when you do run the modified version.
3) Save and replace the old .php file with this one. You can try with different accounts to see if it works.
 
Restricting access is a good one because there is a topic that is on here that speaks of a topic section for only vip members and this will come in handy on that sort of application.
 

Newest Directory Listings

Shortie
Forums
Clicks
29
Views
92
Comments
1
WWE Hub is a discussion forum for all things wrestling! Share and chat with other wrestling fans throughout the world!
momode
Forums
Clicks
12
Views
53
ABCProxy is cost-effective, ethical residential proxies network!
coderway
Forums
Clicks
11
Views
60
AI digital artwork generator
Back
Top