[open-ils-commits] r16569 - trunk/Open-ILS/src/perlmods/OpenILS/WWW (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jun 2 23:15:40 EDT 2010


Author: dbs
Date: 2010-06-02 23:15:38 -0400 (Wed, 02 Jun 2010)
New Revision: 16569

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm
Log:
Setting apache->status() caused 500 server errors for password reset requests

Don't do that.


Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm	2010-06-03 02:52:10 UTC (rev 16568)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm	2010-06-03 03:15:38 UTC (rev 16569)
@@ -107,20 +107,18 @@
 
     # In case non-matching passwords slip through our funky Web interface
     if ($password_1 and $password_2 and ($password_1 ne $password_2)) {
-        $apache->status(Apache2::Const::DECLINED);
         $ctx->{'status'} = {
             style => 'error',
             msg => $ctx->{'i18n'}{'NO_MATCH'}
         };
         $tt->process('password-reset/reset-form.tt2', $ctx)
             || die $tt->error();
-        return Apache2::Const::OK;
+        return Apache2::Const::DECLINED;
     }
 
     if ($password_1 and $password_2 and ($password_1 eq $password_2)) {
         my $response = $actor->request('open-ils.actor.patron.password_reset.commit', $uuid, $password_1)->gather();
         if (ref($response) && $response->{'textcode'}) {
-            $apache->status(Apache2::Const::DECLINED);
 
             if ($response->{'textcode'} eq 'PATRON_NOT_AN_ACTIVE_PASSWORD_RESET_REQUEST') {
                 $ctx->{'status'} = { 
@@ -138,7 +136,7 @@
             }
             $tt->process('password-reset/reset-form.tt2', $ctx)
                 || die $tt->error();
-            return Apache2::Const::OK;
+            return Apache2::Const::DECLINED;
         }
         $ctx->{'status'} = { 
             style => 'success',
@@ -175,7 +173,6 @@
     my $email = $cgi->param('email');
 
     if (!($barcode or $username or $email)) {
-        $apache->status(Apache2::Const::OK);
         $ctx->{'status'} = {
             style => 'plain',
             msg => $ctx->{'i18n'}{'IDENTIFY_YOURSELF'}
@@ -185,7 +182,6 @@
         return Apache2::Const::OK;
     } elsif ($barcode) {
         my $response = $actor->request('open-ils.actor.patron.password_reset.request', 'barcode', $barcode)->gather();
-        $apache->status(Apache2::Const::OK);
         $ctx->{'status'} = {
             style => 'plain',
             msg => $ctx->{'i18n'}{'REQUEST_SUCCESS'}
@@ -196,7 +192,6 @@
         return Apache2::Const::OK;
     } elsif ($username) {
         my $response = $actor->request('open-ils.actor.patron.password_reset.request', 'username', $username)->gather();
-        $apache->status(Apache2::Const::OK);
         $ctx->{'status'} = {
             style => 'plain',
             msg => $ctx->{'i18n'}{'REQUEST_SUCCESS'}



More information about the open-ils-commits mailing list