Use this tag to quickly compare a list of banned IP addresses, IP Ranges, or IP Subnets to a user's [Client_IP]. The tag which is named "Banned_IP" appropriately reports either TRUE if the user is in your banned list or FALSE if they are not.
This tag is intended to aid site administrators in denying or allowing users login privileges, session capabilities, blog/forum posting, and much more.
Technical Details:
Whether you're storing your banned IP's, ranges, or subnets in a database table or elsewhere the tag looks for a single array named "banned_ipv4" which contains them all.
Formatting of your items should be as follows.
IP Address: 192.168.1.1
IP Range: 192.168.1.1/25
IP Subnet: 192.168.1
When invoking the tag make sure the [$banned_ipv4] variable exists. Sample usage is as follows:
To test the tag, find out your own [Client_IP] by going to a site like http://whatismyip.org/. Once you've got your own IP address you can type it into the [$banned_ipv4] array and the tag should output TRUE.
Feel free to drop me a line if you need any help or see anything that needs improvement.
Parameters
none
Sample Usage
Sample usage is as follows:
var('banned_ipv4' = (:'192.168.1.1', '192.168.1.1/25', '192.168.1'));
banned_ip;
Testing:
To test the tag, find out your own [Client_IP]
by going to a site like http://whatismyip.org/.
Once you've got your own IP address you can
type it into the [$banned_ipv4] array and the
tag should output TRUE.
Feel free to drop me a line if you need any
help or see anything that needs improvement.
Source Code
Click the "Download" button below to retrieve a copy of this tag,
including the complete documentation and sample usage shown
on this page. Place the downloaded ".inc" file in your
LassoStartup folder, restart Lasso, and you can begin using this
tag immediately.