Version: 1.0.2, by Simon Lloyd
Developer Last Online: May 2023
Category: Miscellaneous Hacks -
Version: 3.8.x
Rating:
Released: 08-07-2011
Last Update: 08-08-2011
Installs: 24
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 vbeta added 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!
To answer this simply, if you entered x12.35p.6-51?54e in the list then anything matching that will be redirected, if you enter x12 then anything that contains x12 will be redirected.
Quote:
Originally Posted by nhawk
Here's a little snippet of code for IPv4 addresses that I use in several private mods.
You should be able to figure out how to compare a range of numbers with that.
IPv6 is very similar.
I really have no idea what an IPv4 or 6 is, the mod, as it stands does not use regular expressions to check the entire octet hut instead goes for a simple match, there are enhancements coming soon with this mod but (until i understand it myself) for now it will remain simply as a match.
I really have no idea what an IPv4 or 6 is, the mod, as it stands does not use regular expressions to check the entire octet hut instead goes for a simple match, there are enhancements coming soon with this mod but (until i understand it myself) for now it will remain simply as a match.
The code I gave you converts the IPv4 ip address (xxx.xxx.xxx.xxx) to it's true numeric value. Hence it can then be used in a < > comparison.
IPv6 can be done in a similar way, but it uses hexadecimal values and will result in an insanely large number.
// Checks for valid IP Address since some proxies will send invalid user
// agent strings.
//
// usage: if (!isValidIPv4($ipaddress))
function isValidIPv4($addr) {
$octs = explode('.',$addr);
if (count($octs) != 4) return false;
foreach ($octs as $oct) {
if (!ctype_digit($oct)) return false;
$oct = intval($oct);
if ($oct < 0 || $oct > 255) return false;
}
return true;
}
I noticed that I have had a lot of Japanese ips sitting in my "who's online". I found this product and thought it would be a good idea to ban these ips.
I have installed. I re-logged into my forum and still see these ips on my "who's online" list.