2015-01-09, 02:49 PM
There are 3 pages which i want to restrict inside my forum, they're located at /misc.php?page=pagename (i'm using PageManager plugin).
I also have 3 usergroups which i want to be the only ones that can access the pages, in this way:
usergroup1 (gid=13) must only access page1
usergroup2 (gid=14) must only access page2
usergroup3 (gid=16) must only access page3
Here it comes to the problem.
I'm using this code in page1:
And this other in page2 and page3
But both only grant access if the user is currently displaying the allowed group, so what should i do to check if user is a member of allowed groups, but isn't displaying them, and allow him access?
I also have 3 usergroups which i want to be the only ones that can access the pages, in this way:
usergroup1 (gid=13) must only access page1
usergroup2 (gid=14) must only access page2
usergroup3 (gid=16) must only access page3
Here it comes to the problem.
I'm using this code in page1:
if (is_member("1,2,14,16")) {
die("<br><i>You cannot access this content.</i><br>");
And this other in page2 and page3
if (in_array($mybb->user['usergroup'] , array(1,2,etc..))) {
die("<br><i>You cannot access this content.</i><br>");
}
But both only grant access if the user is currently displaying the allowed group, so what should i do to check if user is a member of allowed groups, but isn't displaying them, and allow him access?