Log in

View Full Version : Permissions change in code


soundbarrierpro
04-08-2009, 11:20 AM
As this is not part of the actual vbpowered page mod and is a permissions modification added to it, I figured I should post here.

Right now I have some pages I created and added permissions to. However, they are only permissions which deny guests.

I want to change to this setting only specific user groups Below is the statement I'm using


if ($show['guest'])
{
print_no_permission();

}

How can I reconfigure so that it's only the user groups I want?

Thank you

Cryo
04-08-2009, 12:35 PM
You can do something like this...


$allowed_usergroups = array(1,2,3,4);

if (!in_array($vbulletin->userinfo["usergroupid"], $allowed_usergroups)) {

print_no_permission();

}


Place the usergroups you want to allow in the array (separated by commas, of course). If the user is not in that group it will give the no permission message.

soundbarrierpro
04-08-2009, 12:59 PM
I will try this.

Thank you

.......................................

Tried and working perfectly. Thank you! :)