Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User Permissions
#1
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.
Reply
#2
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");
}
Need website or forum help?
[Image: logo.png]
Reply
#3
Get a hold on omni im sure he knows
i used to know but i forgot

also what is ur forum? ill sign up
Reply
#4
(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.

Reply
#5
Put this anywhere after global.php include,

Code:
if(!in_array($mybb->user['usergroup'], array('3','4','6')))
{
    error_no_permission();
}
Reply
#6
(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?

Reply
#7
Doesn't matter, this won't work with page manager. You'll either have to hide all pages or none. This might work,
http://mods.mybb.com/view/my-permissions
Reply
#8
Thanks I'll give that a try.
Reply
#9
Meh I thought my way would work better, You don't have to define all the usergroups that have admin / mod access.
Need website or forum help?
[Image: logo.png]
Reply
#10
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mybb permissions "you need X amount of posts before posting here" how to? duckyshucky 6 1,744 10-11-2009, 07:03 PM
Last Post: duckyshucky

Forum Jump:


Users browsing this thread: 1 Guest(s)