2018-03-24, 10:35 PM
Hello,
In this basic tutorial I will be showing you have to restrict access to any page on MyBB to certain user groups.
1. Go to your forums root and find the page / file you want to restrict.
2. Open it with NotePad++ or something like that.
3. Add this code to the file
4. Change the numbers to the user group IDs that are allowed to access the page.
5. Change the error message and the page name.
That's it save the file and place it back into your forums root.
In this basic tutorial I will be showing you have to restrict access to any page on MyBB to certain user groups.
1. Go to your forums root and find the page / file you want to restrict.
2. Open it with NotePad++ or something like that.
3. Add this code to the file
$allowed = array('4','3','6','12','13'); // The numbers are the usergroup IDs
if(!in_array($mybb->user['usergroup'], $allowed))
{
error('You are not allowed to access this page.', 'Page Name');
}
4. Change the numbers to the user group IDs that are allowed to access the page.
5. Change the error message and the page name.
That's it save the file and place it back into your forums root.