The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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))) { eval('$usernamecode = "' . fetch_template('newpost_usernamecode') . '";'); if (!$_REQUEST['outcomes']) { eval('$picksbody = "' . fetch_template('picks_outcomes') . '";'); } else { $o = $_REQUEST['outcomes']; for($i=0; $i<=$o; $i++) { $outcomes .= "<p><label>Outcome ".$i.":<input name=\"outcome[".$i."]\" type=\"text\" id=\"outcome".$i."\" size=\"64\" maxlength=\"127\" /></label></p>"; } eval('$picksbody = "' . fetch_template('picks_new_event') . '";'); } } |
#2
|
||||
|
||||
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)) |
#3
|
|||
|
|||
I want members of the groups 6 and 76 to have access. No one else.
|
#4
|
||||
|
||||
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).
|
#5
|
|||
|
|||
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(); } |
#6
|
||||
|
||||
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..
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|