vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Ban IP's In vBulletin Options Easily (https://vborg.vbsupport.ru/showthread.php?t=268147)

Simon Lloyd 08-07-2011 10:00 PM

Ban IP's In vBulletin Options Easily
 
1 Attachment(s)
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!

bosanci28 08-08-2011 02:37 AM

well when i enable in 4.1.5 i get this error:

Code:

Warning: stristr() [function.stristr]: Empty delimiter in [path]/includes/class_bootstrap.php(917) : eval()'d code on line 13

Simon Lloyd 08-08-2011 02:54 AM

When you enabled it did you have any ip's in the list? if not it will produce an error.

bosanci28 08-08-2011 04:32 AM

yap,that fixed it.

now let say i ban someones ip,and then i will erase his account,what will happen then?
can he register again or?

thanks friend.

Simon Lloyd 08-08-2011 04:46 PM

Quote:

Originally Posted by bosanci28 (Post 2230770)
yap,that fixed it.

now let say i ban someones ip,and then i will erase his account,what will happen then?
can he register again or?

thanks friend.

No not with the same IP, if they use the same IP they will never get to see your site again only the redirect site. There will be further enhancements coming soon with this mod :)

FReeSTER 08-08-2011 06:12 PM

Quote:

Originally Posted by Simon Lloyd (Post 2230955)
No not with the same IP, if they use the same IP they will never get to see your site again only the redirect site. There will be further enhancements coming soon with this mod :)

Good stuff, I will tag for later use. Cant wait for more options. lol

DonosOdD 08-08-2011 06:45 PM

I can see this is good work in progress. Tagged for later.

steve1966 08-08-2011 07:35 PM

Hi thank you but where do i add the isp in the usual banning options page?

Simon Lloyd 08-08-2011 10:32 PM

If you mean in my mod then it's self explanatory. This mod does not interact with or affect vb's built in banning options page.

Simon Lloyd 08-08-2011 10:45 PM

Product updated - new enhancements!

Boofo 08-08-2011 10:49 PM

Looks good. How about an email notification on select blocked IPs?

Simon Lloyd 08-08-2011 10:54 PM

Lol, you haven't marked this as installed!, i can do that but lets see how the mod floats for now before i go messing around with it, if everyone is happy over the next week then i'll add either emailing, creating a thread or writing to a log on your server.

Simon Lloyd 08-08-2011 10:55 PM

To be honest the log is probably the better way to go or you could get thousands of emails or threads created!

Boofo 08-08-2011 11:13 PM

There, I marked it as installed even though I have not installed it yet. The email option would work best for me, but only for those IPs I designate, not for all of them in the setting.

Simon Lloyd 08-08-2011 11:18 PM

Well thats probably going to be an add on then rather than a mod change as i think you are talking about not having emails from the blocked range and not having emails from those sigularly blocked, you want to be able to have a section where you enter IP's and emails sent to you if they access your site?

Simon Lloyd 08-09-2011 12:08 AM

Beat product added with email capability. :)

Boofo 08-09-2011 12:44 AM

Quote:

Originally Posted by Simon Lloyd (Post 2231088)
Well thats probably going to be an add on then rather than a mod change as i think you are talking about not having emails from the blocked range and not having emails from those sigularly blocked, you want to be able to have a section where you enter IP's and emails sent to you if they access your site?

Yes. Whether they are in the block setting or not. I will test it and let you know.

Simon Lloyd 08-09-2011 12:51 AM

Boofo, uninstall that last beta and install the new one, the last one had a typo so wouldn't work!

Boofo 08-09-2011 01:12 AM

Downloaded. Thanks.

steviewonder44 02-07-2012 08:45 PM

Thanks this will help

Simon Lloyd 02-07-2012 08:46 PM

Hope you like it :)

TombstoneWarrior 02-12-2012 12:55 AM

should i use the beta.xml or the 4.xml?

Simon Lloyd 02-12-2012 05:59 AM

The beta is stable it was in beta when i added the emailing capability, thats the only difference, so if you dont want emailing capability then the 4.xml is fine :)

TombstoneWarrior 02-12-2012 07:04 AM

installed in 4.1.9 and get this error evveytime with both xml files>>>>>>> error>>>>>>>>>>> Warning: stristr() [function.stristr]: Empty delimiter in [path]/includes/class_bootstrap.php(965) : eval()'d code on line 12

BlueCheri 02-12-2012 07:14 AM

I was getting following error:

Warning: stristr() [function.stristr]: Empty delimiter in [path]/includes/class_bootstrap.php(965) : eval()'d code on line 181

G!

Quote:

Originally Posted by TombstoneWarrior (Post 2298772)
installed in 4.1.9 and get this error evveytime with both xml files>>>>>>> error>>>>>>>>>>> Warning: stristr() [function.stristr]: Empty delimiter in [path]/includes/class_bootstrap.php(965) : eval()'d code on line 12


Simon Lloyd 02-12-2012 09:10 AM

If you've installed this please mark it as installed :)

You got that error because you have the mod activated but no IP's in the list to deal with, deactivate it until you have use for it ;)

TombstoneWarrior 02-12-2012 06:47 PM

Quote:

Originally Posted by Simon Lloyd (Post 2298792)
If you've installed this please mark it as installed :)

You got that error because you have the mod activated but no IP's in the list to deal with, deactivate it until you have use for it ;)

i uninstalled it thats why its not marked as installed... ill wait to install if i need this mod

TombstoneWarrior 03-09-2012 01:39 PM

5 stars and marked as installed reinstalled since you gave me he code error reason thank you very much!!!

Simon Lloyd 03-09-2012 03:02 PM

Your welcome, try out my ban spider by useragent and you'll save on valuable resources too :)

TheSupportForum 11-02-2012 07:43 PM

bug found :



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


Simon Lloyd 11-02-2012 09:44 PM

Edit: Must be a conflict with another mod you have.

TheSupportForum 11-02-2012 10:22 PM

Quote:

Originally Posted by Simon Lloyd (Post 2377923)
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 


Simon Lloyd 11-03-2012 09:01 AM

Can you check your /archive/global.php to see if it contains ip_redirect?

TheSupportForum 11-03-2012 09:42 AM

Quote:

Originally Posted by Simon Lloyd (Post 2378009)
Can you check your /archive/global.php to see if it contains ip_redirect?


yeah

as its a fresh install no pronlem

tambo 11-03-2012 09:44 AM

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

TheSupportForum 11-03-2012 09:45 AM

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

TheSupportForum 11-03-2012 09:46 AM

Quote:

Originally Posted by tambo (Post 2378018)
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

TheSupportForum 11-03-2012 10:00 AM

Quote:

Originally Posted by Simon Lloyd (Post 2378009)
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); 


Simon Lloyd 11-03-2012 10:12 AM

Quote:

Originally Posted by tambo (Post 2378018)
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? :)

Simon Lloyd 11-03-2012 10:15 AM

Quote:

Originally Posted by simonhind (Post 2378026)
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?


All times are GMT. The time now is 11:50 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.01483 seconds
  • Memory Usage 1,837KB
  • 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
  • (2)bbcode_code_printable
  • (5)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete