#!/usr/bin/perl # Michael Tartaglia # This page verifies login by comparing entered data with that in # ../passwords.txt use CGI ':standard'; my $fileName = "/home/csru1600/tartagli/public_html/cgi-bin/password.txt"; my %PASSES; my $savedName; my $savedPass; my $pw = param('pw'); $pw = crypt("\L$pw\E", 3); my $name = param('name'); $name = "\L$name\E"; $name =~ s/://g; # OPEN PASSWORDS FILE open (P, "<$fileName"); flock (P, 1); my @keys =

; close (P); foreach (@keys) { ($savedName, $savedPass) = split(/:/,$_); $PASSES{$savedName} = $savedPass; $PASSES{$savedName} =~ s/\n//; } # PRINT PAGE HEADERS print "Content-type:text/html\n\n", "\n", "M Tartaglia \@ Fordham - Chat", "\n"; # IF VALID PASSWORD IS ENTERED, LOAD CHATROOM INTO A FRAMESET if ($pw eq $PASSES{$name}) { print "\n", "\n", "\n", "\n\n", "Great!\n", "You would now have access, but you have frames ", "disabled.
\nPlease re-enable them via your ", "browser\'s preferences and reload this page."; # ELSE AN INVALID PASSWORD IS ENTERED, SO TELL USER } else { print "Incorrect Login!
", "Still no access. Go back and try again."; } print "";