#!/usr/bin/perl # +-------------------------------------------+ # | council_password.cgi -- Password | # | protection | # | CGI script | # | Author : Unknown | # | Created On : Unknown | # | Last Modified By : Ryan William Facer | # | Last Modified On : Thursday July 30, 1998 | # | Update Count : 2 | # | E-Mail : cattails@cattails.ca | # +-------------------------------------------+ # | 1. Renamed everything to council | # | 2. Change title to Council | # +-------------------------------------------+ # Set Variables $passwd = "com2"; # The password you want $login = "council"; # The username you want $protected = "http://www.secretan.com/wwwboard/council_discuss.html"; # The URL of the protected page $cgiurl = "http://www.secretan.com/cgi/council_password.cgi"; # The URL of the script. $log = "0"; # 1 to log unsuccessfull attempts to get passed the script, anything else # to not log the attempts $logfile = "council.log"; # The file to log unsuccessfull attempts to get through. must be chmod 777 $bodycolor = "
"; # The tag and whatever attributes you want to give it, you can # also include a or or # and anything else you want at the top. note that all quotes (") need # to have a \ in front of them (\") $title = "Higher Ground Community Council Discussion Forum Password Protection"; # The Title of the page. # # Done Setting Variables ########################################## if ($ENV{QUERY_STRING} eq "about"){ &about; }; # if if ($ENV{REQUEST_METHOD} eq "GET"){ &get_login; } else { &parse_form; }; # if $password = $input{'password'}; $username = $input{'username'}; if ($username eq $login) { if ($password eq $passwd){ print "Location: $protected\n\n"; } else { &error; }; # if } else { &error; }; # if sub parse_form { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); if (length($buffer) < 5) { $buffer = $ENV{QUERY_STRING}; }; # if @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $input{$name} = $value; }; # foreach }; # parse_form sub get_login{ print "Content-type: text/html\n\n"; print "