Version: 1.00, by Hotte
Developer Last Online: Jan 2006
Version: 2.2.x
Rating:
Released: 06-06-2002
Last Update: Never
Installs: 64
No support by the author.
Hi
I´ve wrote a little hack upon request of my "Main"-Moderators.
This hack allows them to temporary ban a given user per Userid. Simply userid, reason and how many hours. The banned user will see a modified no-permission screen when he tries to login. The User can automaticly access the board again, when the entered time is over.
For the other hackers: Feel free to modify the hack and distribute a "better" version of this if you want.
Sry for my bad english.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Hint:
In banuser.php at line 10:
if ($bbuserinfo[userid]!=1 and !$ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid] and forumid=2")) {
This is the permcheck if the user who tries accessing this file is authorized. In this case if the user ist not the administrator who was createn by the vbulletin-installation and is not a moderator of forumid 2, the script will quit. Change it to whatever you want. In Example to allow all moderators access delete lines 10-13 from the script.
I know, this hack is not "the best way" to code something, but it works
i tried using the format above to change it to look up for the usergroup for Admins and SuperModerators, but the only way it works is if i set it to allow the userid or else delete the permissions completely
Post #14 in this thread has the code to allow usergroups. That's what I am using.
Quote:
Originally posted by ladyfyre ok...that was it...
i tried using the format above to change it to look up for the usergroup for Admins and SuperModerators, but the only way it works is if i set it to allow the userid or else delete the permissions completely
Yea, I can't allow mods/supermods to use this until someone can post an update to the code to disallow banning of admins. The way it works now is any mod/supermod that has permissions to temp ban, can also temp ban an admin.
That doesn't seem to work here now. I went back to the original file and it works that way. I ran it from the admin directory though. I don't want any mods playing with it until I can get it working so no one can ban the admin.
Quote:
Originally posted by ladyfyre That is what i was using. I just get back:
Parse error: parse error in /banuser.php on line 13
If you just insert your own userid, you can still run it from your mod/index.php This way it can be run from your forums options drop down box in the forum, bottom right. No one will be able to ban you, because it looks for that userid, and if its not the same one as the person trying to access the file, the script will not run.
Ok, you lost me here. What do I need to do where to do what?
Quote:
Originally posted by Smoothie If you just insert your own userid, you can still run it from your mod/index.php This way it can be run from your forums options drop down box in the forum, bottom right. No one will be able to ban you, because it looks for that userid, and if its not the same one as the person trying to access the file, the script will not run.
What about the ismod part in that same line? I just want to make it so the admin and the supermod and whichever userid I want to enter can use it. That code they gave me in the earlier post doesn't work.
Quote:
Originally posted by Smoothie In the banuser.php file, I think its around line 10, where it says userid 1. If thats your userid, that no one else will be able to run the script.
It would be great if the person who created this hack could lend some assistance. I would like for my mods to be able to temp ban without the risk of one of them banning me.