I've added a new page to my forum using the Page Manager plugin, and I would like the page to be only visible to Moderators and Admins.
Can somebody tell me how I can prevent normal members from accessing it?
So if they do find the URL, and try to view the page, it says "You do not have permission to access this page", etc....".
Thanks.
You could add this to the php code. (I haven't tested it)
include("global.php"); //path to global.php in mybb
global $mybb;
if(($mybb->usergroup['isadmin'] == 1) || ($mybb->usergroup['issupermod'] == 1))
{
//page here
}else{
print("You do not have permission to access this page");
}
Get a hold on omni im sure he knows
i used to know but i forgot
also what is ur forum? ill sign up
(06-14-2011, 02:06 PM)ILOVEW33D™ Wrote: [ -> ]Get a hold on omni im sure he knows
i used to know but i forgot
also what is ur forum? ill sign up
Thanks but I don't really want to bother Omni over this.
My site is
TalkGFX. Look forward to seeing you there, although there are still a lot of changes being made.
Put this anywhere after global.php include,
Code:
if(!in_array($mybb->user['usergroup'], array('3','4','6')))
{
error_no_permission();
}
(06-14-2011, 03:51 PM)Solidus Wrote: [ -> ]Put this anywhere after global.php include,
Code:
if(!in_array($mybb->user['usergroup'], array('3','4','6')))
{
error_no_permission();
}
Where about is Global.php Include?
Thanks I'll give that a try.
Meh I thought my way would work better, You don't have to define all the usergroups that have admin / mod access.
(06-15-2011, 02:12 AM)0xE9 Wrote: [ -> ]Meh I thought my way would work better, You don't have to define all the usergroups that have admin / mod access.
Yeh, but I'm not sure how Page Manager works. I don't think it generates a .php file for each page.
Never mind. I had the "Use MyBB Template" set to yes, which disabled PHP.
I've set it to no now, and I've been able to set permissions. Thanks for everyones help.