The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Moderators able to ban more than usergroup members
I want Moderators to be able to ban everyone who isn't a Administrator or Moderator. From reading another thread I figured out I should replace
if ($bangroup['usergroupid']>6) { with if ($banuser['usergroupid']!=6 or $ismod) { echo "<p>You may not ban someone who is not a normal registered user!</p>"; } else { My Administrator usergroup is 6, and this code does not work. Just wondering what the proper code is, and what one for allowing Moderators to ban Moderators also is, in case of a compromise of security. |
#2
|
||||
|
||||
if ($banuser['usergroupid']==6 or $banuser['usergroupid']==5 or $banuser['usergroupid']==7)
{ //user is a mod, s.mod or admin } if ($banuser['usergroupid']!=6 and $banuser['usergroupid']!=5 and $banuser['usergroupid']!=7) { //user is someone else } |
#3
|
|||
|
|||
Where do I implement this, could you show me an example? And also I do not have a usergroup 7, banned is 8 if that's what you meant.
|
#4
|
||||
|
||||
edit mod/user.php, find:
PHP Code:
PHP Code:
|
#5
|
|||
|
|||
There are two instances of the original code to replace in user.php, I tried isnerting it in the first one as I didn't know the other existed and it did not work. I then found the other instance and then replaced both and got the following:
Parse error: parse error in /home/sites/site47/web/mod/user.php on line 96 I then tried replacing it in the last instance and it didn't work either. The code I'm using is if ($banuser['usergroupid']==5 or $banuser['usergroupid']==6 ) { echo "<p>You cannot ban Administrators or Moderators!</p>"; } As we do not have regular and super moderators, I only have 5 and 6 listed. |
#6
|
|||
|
|||
I am using 2.2.7 by the way, I believe I upgraded it correctly at least.
|
#7
|
||||
|
||||
Are you an Opera browser user? Then dont copy paste from here, try to type manually.. It shouldnt give you a parse error..
|
#8
|
|||
|
|||
Nope, IE 6.
|
#9
|
||||
|
||||
no error in my code and it's working, I tested out..
Make sure you apply it correctly.. Parse error can mean you are using an unappropriate tool to edit your file. Try notepad and try to type manually instead of copy/pasting.. The code is ok.. |
#10
|
||||
|
||||
You applied it correctly and it's working here too. I get no parse errors in your file.. (BTW.please remove the file from the thread, it's against rules to attach full vb file here). So I really dont know what your problem is, but may be it's you upload it incorrectly. Do you use ascii (not bin) to upload your file?
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|