Aardvark Topsites Aardvark Topsites 3.2.3 Manual
© 2000-2002 Aardvark Industries - License
IP Blocking

This page is only here because I promised I would add this feature to the script. I also didn't want to add a UI for it becasue then I'd have to update all the language files. So what we get is a dirty hack.

If you know the IP of someone and you don't want them to even be able to get to your topsites list, here's what you do. Open topsites.cgi in a text editor. Put a new line before the one that says use strict;. Put the following code on that line:
if ($ENV{'REMOTE_ADDR'} == 'IP NUMBER GOES HERE') { exit; }
That will leave them with a good old fashioned error message. If you want something more personal, try this:
if ($ENV{'REMOTE_ADDR'} == 'IP NUMBER GOES HERE') { print "Content-type: text/html\n\nNo way, loser!"; exit; }
Just put whatever text you want right after Content-type: text/html\n\n. But what if you want to block more than one person? Easy!
if ($ENV{'REMOTE_ADDR'} == 'IP NUMBER GOES HERE' || $ENV{'REMOTE_ADDR'} == 'ANOTHER IP NUMBER GOES HERE') { print "Content-type: text/html\n\nNo way, loser!"; exit; }
And that can go on, and on, and on, and on...
if ($ENV{'REMOTE_ADDR'} == 'IP NUMBER GOES HERE' || $ENV{'REMOTE_ADDR'} == 'ANOTHER IP NUMBER GOES HERE' || $ENV{'REMOTE_ADDR'} == 'ANOTHER IP NUMBER GOES HERE' || $ENV{'REMOTE_ADDR'} == 'ANOTHER IP NUMBER GOES HERE' || $ENV{'REMOTE_ADDR'} == 'ANOTHER IP NUMBER GOES HERE' || $ENV{'REMOTE_ADDR'} == 'ANOTHER IP NUMBER GOES HERE' || $ENV{'REMOTE_ADDR'} == 'ANOTHER IP NUMBER GOES HERE') { print "Content-type: text/html\n\nNo way, loser!"; exit; }