Welcome to Admin Junkies, Guest — join our community!

Register or log in to explore all our content and services for free on Admin Junkies.

Restricting access on php files to certain groups.

_B_

Addicted member
Joined
May 18, 2020
Messages
934
Credits
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.
 
Advertisement Placeholder
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.
 

Log in or register to unlock full forum benefits!

Log in or register to unlock full forum benefits!

Register

Register on Admin Junkies completely free.

Register now
Log in

If you have an account, please log in

Log in
Who read this thread (Total readers: 0)
No registered users viewing this thread.

Would You Rather #9

  • Start a forum in a popular but highly competitive niche

    Votes: 9 27.3%
  • Initiate a forum within a limited-known niche with zero competition

    Votes: 24 72.7%
Win this space by entering the Website of The Month Contest

Theme editor

Theme customizations

Graphic Backgrounds

Granite Backgrounds