View Full Version : Moderators can ban by IP address
mikellogg
03-01-2006, 10:00 PM
This PHP file allows your moderators to ban by IP address.
It is:
A simple form that allows your moderators to add to (or subtract from) the list of banned IPs.
A separate .php file and updates are controlled by a password that only your moderators know.
Ugly but functional. ;) If you have the time and the know-how, please improve it.
Some safeguards:
Password protected
IP addresses must have at least 3 octets (so "12.34.56.", not just "12." which could ban a lot of users)
Can't ban administrator's IP
I hope people find this helpful!
bashy
03-02-2006, 05:55 PM
Nice 1 installed, well will be once i can figure out the settings :(
Looks a little over my head :(
Just a quicky though, can this be changed to just super mods?
mikellogg
03-02-2006, 05:59 PM
Thanks.
Access is controlled by password, not usergroup. Only those people who have the password can change the list of banned IPs.
bashy
03-02-2006, 06:24 PM
Ah right...yeah i get ya now
I am actually struggling to get this to work
I am trying to create an internal page using Logicans web templates
I have also tried creating an internal PHP page using the manager for
my portal, still no go....
I noticed there are 2 ip addys for the administrator, do i change both?
Its asking for address url of forum, not sure what to put there,
is it the path such as www.bashys-place.com/forums or is it the
sites/home/bashys......1
Also this bit 1) mysql database connection string location, whats that all about?
And this bit 3) password to give to moderators: $_POST['passw'] ==
Wherere exactly does the password go? is it in between == or after it then space
then the password?
This is confusing the hell out of me pmsl....
I think you need to do a tutorial m8 as i have done a few bits here an there
well say about 200 hacks installed lol and for peeps just starting this is gonna
scare the hell out of them lol......
mikellogg
03-02-2006, 07:48 PM
Hi Bashy,
Since this is outside the vBulletin structure, it requires a MySQL connection string just like any PHP page that connects to a MySQL database. If you are creating "an internal page using Logicans web templates", then you probably won't need that connection string anymore.
Also, all lines that start with // or are between /* */ are comment lines. Where I say "// 3) password to give to moderators: $_POST['passw'] ==", just look at the line underneath it to find that code and the spot for the password.
No offense, but maybe it is best that someone who understands PHP a little better than both you and I does the work to integrate this into the vB structure. ;)
mikellogg
03-02-2006, 07:55 PM
OK, here's my tutorial. :)
To get this working on your board, you should change a few things in the file first.
// 1) Change this to the correct location of your MySQL connection string:
require_once ('connect.php');
// 2) change chdir("C:\Inetpub\forum"); to the correct directory of your forums chdir("C:\Inetpub\forum");
// 3) password to give to moderators: $_POST['passw'] ==
{ if ($_POST['passw'] == 'your password goes here')
// 4) administrator's IP address in !strpos($sVal,'12.34.56.78')
if (eregi("^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(\.[0-9]{1,3})* )+$", $sVal) && !strpos($sVal,'12.34.56.78'))
bashy
03-02-2006, 08:56 PM
Hi m8
Yeah i did figure your tut out myself apart from the password bit lol
But like ya said m8 its well over my head, think im gonna leave it for now till some1
can do sommat with it :)
Protonus
12-06-2006, 08:03 PM
Has anyone tried this in 3.6.x?
mikellogg
12-06-2006, 08:58 PM
Yes, it works the same in 3.6.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.