Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Ban IP's In vBulletin Options Easily Details »»
Ban IP's In vBulletin Options Easily
Version: 1.0.2, by Simon Lloyd Simon Lloyd is offline
Developer Last Online: May 2023 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.x.x Rating:
Released: 08-07-2011 Last Update: 08-08-2011 Installs: 30
Uses Plugins
 
No support by the author.

What this mod does
With this simple mod you can enter a list of IP's that you want to ban (redirect) one per line, when trying to access your site the user of the IP will be redirected to an obscure google page with a 301 permanent redirect.

What this mod won't do
With this mod you cannot ban partial ranged IP's laid out like this 2.23.123 - 2.23.130

How to install
Simply go to Admincp>Manage Products and import product-baniparray.xml

Please mark as installed if you use this!

Version History
v1.0.1

Made it possible to use partial IP addresses
v1.0.2
Added custom redirect message box
Added custom redirect url box
Added IP Range boxes for banning IP's that fall within range
Ranged IP's parsed during checks
vbetaadded for test purposes 9/08/2011
Beta has email notification ability, this beta is for those of you that wish to test it and feed back!


Checked range block working only against my IP range, please report any bugs!

Download Now

File Type: xml product-baniparray4x.xml (6.9 KB, 108 views)
File Type: xml product-baniparraybeta.xml (9.8 KB, 57 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 11-02-2012, 09:44 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit: Must be a conflict with another mod you have.
Reply With Quote
  #33  
Old 11-02-2012, 10:22 PM
TheSupportForum TheSupportForum is offline
 
Join Date: Jan 2007
Posts: 1,158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
Edit: Must be a conflict with another mod you have.
i dont have any IP blocking scripts that use your

PHP Code:
function ip_redirect($to$code '301 Permanently Moved'
which points to your script

its does seem obvious to me its your function that's causing the issue shown in the erro_log, this is not shown on the main forum as an eror

PHP Code:
PHP Fatal error:  Cannot redeclare ip_redirect() (previously declared in  /archive/global.php(40) : eval()'d code:95) in /includes/class_bootstrap.php(996) :  eval()'d code on line 99 
Reply With Quote
  #34  
Old 11-03-2012, 09:01 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you check your /archive/global.php to see if it contains ip_redirect?
Reply With Quote
  #35  
Old 11-03-2012, 09:42 AM
TheSupportForum TheSupportForum is offline
 
Join Date: Jan 2007
Posts: 1,158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
Can you check your /archive/global.php to see if it contains ip_redirect?

yeah

as its a fresh install no pronlem
Reply With Quote
  #36  
Old 11-03-2012, 09:44 AM
tambo's Avatar
tambo tambo is offline
 
Join Date: Aug 2008
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Other than the ability to redirect to a custom page (which is quite an attractive feature, BTW), what is the difference between this mod and the standard IP Banning options under:

ACP > User Banning Options > Banned IP Addresses

Thanks,
TM
Reply With Quote
  #37  
Old 11-03-2012, 09:45 AM
TheSupportForum TheSupportForum is offline
 
Join Date: Jan 2007
Posts: 1,158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

for 4.2.0 pl3 it seems to be

PHP Code:
exec_header_redirect(fetch_seo_url('forumhome|bburl', array())); 
which has a header redirect, so 2 redirects are occurring, your ip_redirect
Reply With Quote
  #38  
Old 11-03-2012, 09:46 AM
TheSupportForum TheSupportForum is offline
 
Join Date: Jan 2007
Posts: 1,158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tambo View Post
Other than the ability to redirect to a custom page (which is quite an attractive feature, BTW), what is the difference between this mod and the standard IP Banning options under:

ACP > User Banning Options > Banned IP Addresses

Thanks,
TM
you have a point there, i suppose the developer should use that array in the plugin instead of a new textarea
Reply With Quote
  #39  
Old 11-03-2012, 10:00 AM
TheSupportForum TheSupportForum is offline
 
Join Date: Jan 2007
Posts: 1,158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
Can you check your /archive/global.php to see if it contains ip_redirect?
just checking it furthur this is the whole script that is affecting it


PHP Code:
// #############################################################################
// ### CACHE PERMISSIONS AND GRAB $permissions
// get the combined permissions for the current user
// this also creates the $fpermscache containing the user's forum permissions
$permissions cache_permissions($vbulletin->userinfo);
$vbulletin->userinfo['permissions'] =& $permissions;
// #############################################################################

// check that board is active - if not admin, then display error
if ((!$vbulletin->options['bbactive'] AND !($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])) OR !($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']))
{
    
exec_header_redirect(fetch_seo_url('forumhome|bburl', array()));
}

// if password is expired, deny access
if ($vbulletin->userinfo['userid'] AND $permissions['passwordexpires'])
{
    
$passworddaysold floor((TIMENOW $vbulletin->userinfo['passworddate']) / 86400);

    if (
$passworddaysold >= $permissions['passwordexpires'])
    {
        
exec_header_redirect(fetch_seo_url('forumhome|bburl', array()));
    }
}

verify_ip_ban();

$cache_templates = array('ad_archive_above_content1''ad_archive_above_content2''ad_archive_below_content');

(
$hook vBulletinHook::fetch_hook('archive_global')) ? eval($hook) : false;

cache_templates($cache_templates$style['templatelist']);
unset(
$cache_templates); 
Reply With Quote
  #40  
Old 11-03-2012, 10:12 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tambo View Post
Other than the ability to redirect to a custom page (which is quite an attractive feature, BTW), what is the difference between this mod and the standard IP Banning options under:

ACP > User Banning Options > Banned IP Addresses

Thanks,
TM
This does much more, did you read the settings?, you can ban single ip's, ip ranges, redirect to url of your choice and have notification if specific ip's have accessed your site - different enough?
Reply With Quote
  #41  
Old 11-03-2012, 10:15 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by simonhind View Post
just checking it furthur this is the whole script that is affecting it


PHP Code:
Code displayed above
Thats the archive/global.php, i cant seem to recreate it on my test site, my mod works at style fetch, so pretty much before anything else has been executed so redirect happens then, do you have any mods or custom code in your fresh install?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:55 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06561 seconds
  • Memory Usage 2,355KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete