vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Moderators can ban by IP address (https://vborg.vbsupport.ru/showthread.php?t=109310)

mikellogg 03-01-2006 10:00 PM

Moderators can ban by IP address
 
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:
PHP Code:

require_once ('connect.php'); 

// 2) change chdir("C:\Inetpub\forum"); to the correct directory of your forums
PHP Code:

 chdir("C:\Inetpub\forum"); 

// 3) password to give to moderators: $_POST['passw'] ==
PHP Code:

 { if ($_POST['passw'] == 'your password goes here'

// 4) administrator's IP address in !strpos($sVal,'12.34.56.78')
PHP Code:

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.


All times are GMT. The time now is 07:27 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00995 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete