#!/usr/bin/perl ############################### # Hot Links Pro 3 password.cgi # Created by Mike Ramirez # Nothing below here is configurable ############################### # Display error if setup hasn't been run unless (-e './source/config.pl') { print "Content-type: text/html\n\n"; print "You must run the setup script."; exit; } require './source/headerfooter.pl'; require './source/config.pl'; require './lang/langset.pl'; ################################################## read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); if (length($buffer) < 5) { $buffer = $ENV{QUERY_STRING}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($key, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/[\;\|\\ ]/ /ig; $FORM{$key} = $value; } ################################################## print "Content-type: text/html\n\n"; if ($FORM{action} eq "lookup") { my $filetolock = $datafilepath; my $tempfile = $filetolock . ".lock"; open (LOCK, ">$tempfile"); if ($useflock == 1) {flock (LOCK, 2)} open (FILE, "$datafilepath"); @alllinks = ; close(FILE); close(LOCK); unlink ($tempfile); foreach $line (@alllinks) { @linkinfo = split(/\|/, $line); if ($FORM{linkid} == $linkinfo[0]) {$email = $linkinfo[4]; $password = $linkinfo[6];} } if (($email eq '') || ($password eq '')) { &header; print <<"HTML";
$altext24
$pstext1
HTML &footer; } else { open (MAIL, "|$sendmail -t") || &error("$shtext9"); print MAIL "To: $email\n"; print MAIL "From: $adminemail\n", "Subject: $pstext2\n\n", "$pstext3 $password\n", "$pstext4\n", "$addscript?action=edit\n", "\n$pstext5\n", "$pstext6\n", "\n$pstext7\n", "$title"; close (MAIL); &header; print <<"HTML";
$pstext8
$pstext9
$pstext10 $adminemail
HTML &footer; } } else { &header; print <<"HTML";
$pstext11
$pstext12
$shtext8:
HTML &footer; } sub error { &header; print <<"HTML";
$altext24
$_[0]
HTML &footer; }