![]() |
Permission problem
I have read several articles, did some trial and error, and basically figured out many of my questions. At this point in my script, I have a question about usergroup_permissions. I got this code out of Psionic's tutorial, but it doesn't seem to work for me. Everyone is getting to the form. Here it is:
Code:
if ($_REQUEST['do']=='create_event' AND (!is_member_of($vbulletin->userinfo, 6) OR !is_member_of($vbulletin->userinfo, 76))) |
Who exactly do you want to have access?
And this: Code:
(!is_member_of($vbulletin->userinfo, 6) OR !is_member_of($vbulletin->userinfo, 76)) Code:
(!is_member_of($vbulletin->userinfo, 6,76)) |
Quote:
|
In which case remove the ! at the start of Kirks suggestion - atm that is saying anyone who is not a member of groups 6 or 76 (you can also remove the brackets around it).
|
Well, I knew that's what it should mean, but in Psionic's tutorial, he has this:
Certain Usergroups Only (In this example, 6 and 7) PHP Code: if (!is_member_of($vbulletin->userinfo, 6) AND !is_member_of($vbulletin->userinfo, 7)) { print_no_permission(); } |
Yes, that's allowing members of Usergroup 6 and 7 only; all other get a permission error. When dealing with the is_member_of function, the second argument can contain multiple usergroup ids, so you don't need to use two separate conditions..
|
All times are GMT. The time now is 10:54 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|