#!/usr/bin/perl # # Perl CGI script for emailing a password which was forgotten # # get some standard routines require "../../etc/pasha_conf.pl"; require "${Pasha_dir}/lib/lib_cgi.pl"; require "${Pasha_dir}/lib/lib_pasha.pl"; # see what data was sent to us %Cgi = %{&get_cgi_input()}; # print the top of the HTML page &print_head(); # if we have the email address if ($Cgi{email} =~ /\w/) { &email_password($Cgi{am}, $Cgi{email}); # otherwise ask for registered email address } else { &print_email_box($Cgi{am}); } # print the bottom of the HTML page &print_foot(); ## # Look up password for email address and email it ## sub email_password { my($am) = $_[0]; my($email) = $_[1]; my($id, $pass); # look up password - failure bails due to error handling in &parse_ routines if ($am eq "author") { $id = &parse_authors($email, "find"); $pass = $Authors{$id}{pass}; } elsif ($am eq "reviewer") { $id = &parse_reviewers($email, "find"); $pass = $Reviewers{$id}{pass}; } # see whether we got something if ($pass =~ /\w/) { # send it off &send_mail($Conference_email_technical, $email, "Your $am password for $Conference_nym", "Email address: $email\nPassword: $pass\n" ); print "Your password has been emailed to: $email\n"; # or give sad news } else { print "No password was found for email address: $email\n

\n"; # give another chance &print_email_box($am); } } # end &email_password() ## # Show box for email address input so we can password there ## sub print_email_box { my($am) = $_[0]; print <
Password lookup tool ($am)
  Your email address:
END } # end &print_email_box()