package secure;

print "Content-Type: text/html\n\n";

# If you wand to disable security check - remark next line.

if (($ENV{HTTP_REFERER}!~/^http[s]?:\/\/localhost\/a/)&&($ENV{HTTP_REFERER}!~/^http[s]?:\/\/127\.0\.0\.\d+\/a/)){print "<a href=\"http://localhost/a/\">Security alert!</a><br><b>Possible attack</b> HTTP_REFERER is not localhost. but '<b>".$ENV{HTTP_REFERER}."</b>'.<br><br> (to disable this warning go: /home/admin/CGI/Secure.pm)</center></body></html>";exit;};

return 1;