#!/usr/bin/perl # # $Id: forgot.pl,v 1.2 2006/01/23 21:39:30 ddoughty Exp $ # # Source File: forgot.pl # Get config require 'sitecfg.pl'; require 'testlib.pl'; &traceoutput("login.pl"); # TRACE IF ACTIVE &app_initialize; print "Content-Type: text/html\n\n"; $SESSION{'clid'} = $FORM{'clid'}; $SESSION{'lang'} = $FORM{'lang'}; &get_client_configuration(); &traceoutput("login.pl:$FORM{'clid'}:$FORM{'uid'}:$FORM{'pwd'}"); # TRACE IF ACTIVE &setbrowsertype(); # Load Index.html if ($FORM{'home'} eq 'client') { if ($FORM{'uid'} eq '' || $FORM{'clid'} eq '') { warn "ERROR: Forgot Password started without both Candidate ID $FORM{'uid'}, and Client ID $FORM{'clid'} " ; &show_illegal_access_warning("user"); exit 0; } else { my $tmpfile = "cnd.$FORM{'clid'}"; my @cnds = &get_data($tmpfile); foreach my $cnd (@cnds) { chop ($cnd); my @flds = split(/&/, $cnd); if ($flds[0] eq $FORM{'uid'}) { my $pw = $flds[1]; my $email = $flds[11]; $mmsubj = "Password for ".$CLIENT{'clnmc'}; $mmbody = "Dear $flds[3],\n"; $mmbody .= " Your password for the "; $mmbody .= $CLIENT{'clnmc'}; $mmbody .= " Test Manager system is: $pw.\n"; &send_mail($mmautonotifyfrom, $email, $mmsubj, $mmbody); } } @lines = &get_template("cindex"); } } else { @lines = &get_template("shome"); } foreach $line (@lines) { $line = &xlatline($line); }