View Full Version : Moderators able to ban more than usergroup members
Glock
08-29-2002, 07:01 AM
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.
Logician
08-29-2002, 07:33 AM
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
}
Glock
08-29-2002, 07:37 AM
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.
Logician
08-29-2002, 11:10 AM
edit mod/user.php, find:
if ($banuser['usergroupid']!=2 or $ismod) {
echo "<p>You may not ban someone who is not a normal registered user!</p>";
}
Replace it AS:
if ($banuser['usergroupid']==5 or $banuser['usergroupid']==6 OR $banuser['usergroupid']==7) {
echo "<p>You can not ban someone who is a Mod. S.Mod or an Admin!</p>";
}
Glock
08-29-2002, 04:00 PM
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.
Glock
08-29-2002, 04:03 PM
I am using 2.2.7 by the way, I believe I upgraded it correctly at least.
Logician
08-29-2002, 04:24 PM
Are you an Opera browser user? Then dont copy paste from here, try to type manually.. It shouldnt give you a parse error..
Glock
08-29-2002, 05:00 PM
Nope, IE 6.
Logician
08-29-2002, 06:31 PM
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..
Logician
09-01-2002, 08:26 AM
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?
Chris M
09-01-2002, 08:32 AM
You should use Binary to upload .php files:)
Also - Usergroupid = 5 is Supermods, not Mods...7 is for regular Moderators;)
Satan
Logician
09-01-2002, 08:38 AM
Originally posted by hellsatan
You should use Binary to upload .php files:)
Incorrect.. You meant ASCII, didnt you? ;)
Glock
09-01-2002, 03:18 PM
I'm uploading it correctly as I have all of my other files. I have no udergroup 7, usergroup 5 is "super" moderators, which all of my mods are.
Logician
09-01-2002, 03:27 PM
so can you please tell the exact error message you get?
Glock
09-01-2002, 07:01 PM
You may not ban someone who is not a normal registered user.
Logician
09-02-2002, 07:27 AM
You told above that you are getting "Parse Error" so I was trying to fix it. If it's not a parse error you are getting, it can be different causes. Can you clarify the problem you have. When do you get this message? You are supposed to get this message if you try to delete an Admin or Mod.
Glock
09-02-2002, 04:31 PM
Int he moderator control panel, it happens if I try to ban awaiting admin confirmation, or email confirmation, etc.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.