========================================= Temporary IP Ban Script v1.0 By Mike L. www.ontarioabandonedplaces.com ========================================= WHAT THIS SCRIPT WILL DO ------------------------ Ban a user for a predetermined amount of time. It may be set in seconds, minutes, hours, weeks or months. It will inform the user of the amount of time remaining in the ban if they are already in the ban-list. If the script is called and the ban has expired, the IP is removed from the ban-list and access is granted. WHAT THIS SCRIPT WILL NOT DO ---------------------------- The script does not ban an IP that you would enter manually. In other words, you don't input IP addresses that you'd like to temporarily ban. Instead, when a situation has occured in your code where you feel a temp-ban is warranted, you call upon the script. This might be trying to login as an administrator, swearing, invalid login attempts, etc. INSTALL ------- 1) A folder to put the "bans.mdb" database file. This must have write/modify permissions assigned to it. Edit the bans.asp file for the proper path to the database. Place all other files into your root directory or other appropriate folder if you have one. 2) Insert the following lines of code to activate a ban: <% action = "add" %> This may be after invalid login attempts have been made, etc. You decide where you want to include those two lines of code. Also make sure the ban.asp is in the same directory otherwise you'll have to change the path. 3) Insert the following lines of code into pages where you want to check if a ban is already in place (such as the main index file of your website, forums, etc.) <% action = "verify" %> Basically you set the "action" variable to either "ban" to banish a user, or set it to "verify" to verify if there is a ban. The include command inserts the code from the ban.asp file into your own code. If a ban exists, the script stops in it's tracks. If no ban exists, your script continues to run. Note: It is HIGHLY RECOMMENDED that you turn of caching of your webpages. This will give the proper amount of time remaining for the ban as well as not serve up a cached copy of your website when an actual ban is still active. See the sample files, although there are different ways to disable caching. That's it! The code is rather crude, but it does work. ----------- HOW TO TEST ----------- Create a folder (example: TEST) Unzip files into TEST folder go to http://www.yoursite.com/test/index.asp (obviously changing the domain name) You should have access go to http://www.yoursite.com/test/sampleban.asp You should not have access and if you try to call up the main site (index.asp) it will refuse you. LICENSE ------- Freeware. You may modify the code accordingly. Future version may allow the manual input of IP addresses from an administrator page.