[LON-CAPA-cvs] cvs: modules /raeburn/register resetpw.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Sat, 04 Feb 2006 01:35:25 -0000


raeburn		Fri Feb  3 20:35:25 2006 EDT

  Modified files:              
    /modules/raeburn/register	resetpw.pm 
  Log:
  Changes so this works in Apache2. Routines in processform.pm now used to retrieve form parameters.  Fix return e-mail address.
  
  
Index: modules/raeburn/register/resetpw.pm
diff -u modules/raeburn/register/resetpw.pm:1.1 modules/raeburn/register/resetpw.pm:1.2
--- modules/raeburn/register/resetpw.pm:1.1	Mon Nov  1 14:51:22 2004
+++ modules/raeburn/register/resetpw.pm	Fri Feb  3 20:35:23 2006
@@ -3,17 +3,20 @@
 use strict;
 use MD5;
 use Crypt::PasswdMD5;
-use Apache::Constants qw(OK SERVER_ERROR);
+use Apache::RequestRec();
+use Apache::Const qw(OK SERVER_ERROR);
 use DBI;
+use Apache::LON::processform;
 
 sub handler {
     my $r = shift;
-    my %input = $r->args;
+    my %input = ();
+    &Apache::LON::processform::getitems($r,\%input);
     foreach (keys %input) {
         $input{$_} =~ s#`#'#g;
         $input{$_} =~ s#\$#\(\$\)#g;
     }
-    my $email = $input{'guestID'};
+    my $email = $input{'guestID'}[0];
     $email =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
     my $token = $input{'token'};
     my $dbpwd;
@@ -26,7 +29,7 @@
         chomp($dbpwd);
     }
 
-    my $contact_email = "helpdesk\@msu.edu";
+    my $contact_email = "helpdesk\@lon-capa.org";
     my $contact_name = "LON-CAPA support team";
 
     my %attr = (
@@ -87,6 +90,8 @@
 </body>
 </html>
 END
+    $r->content_type('text/html');
+    $r->send_http_header;
     $r->print($output);
     return OK;
 }