From: dbs Date: Fri, 4 Jun 2010 01:37:02 +0000 (+0000) Subject: Merge r16568 through r16572 from trunk for fixes to password reset functionality X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=218767dc5cd9f5fa6f1dc79badc627797a8ab793;p=Evergreen.git Merge r16568 through r16572 from trunk for fixes to password reset functionality git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@16587 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 0687e28ff3..561aa41d94 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -3528,8 +3528,9 @@ sub commit_password_reset { # Ensure we're still within the TTL for the request my $aupr_ttl = $U->ou_ancestor_setting_value($user->home_ou, 'circ.password_reset_request_time_to_live') || 24*60*60; my $threshold = DateTime::Format::ISO8601->parse_datetime(clense_ISO8601($aupr->[0]->request_time))->add(seconds => $aupr_ttl); - if ($threshold > DateTime->now(time_zone => 'local')) { + if ($threshold < DateTime->now(time_zone => 'local')) { $e->die_event; + $logger->info("Password reset request needed to be submitted before $threshold"); return OpenILS::Event->new('PATRON_NOT_AN_ACTIVE_PASSWORD_RESET_REQUEST'); } diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm b/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm index 410e7b216d..2e3fc2fbc0 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm @@ -107,7 +107,6 @@ sub reset_password { # 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'} @@ -120,7 +119,6 @@ sub reset_password { 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'} = { @@ -175,7 +173,6 @@ sub request_password_reset { 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 @@ sub request_password_reset { 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 @@ sub request_password_reset { 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'} diff --git a/Open-ILS/web/opac/skin/default/js/password_reset.js b/Open-ILS/web/opac/skin/default/js/password_reset.js index 9da98b4022..83db2721d9 100644 --- a/Open-ILS/web/opac/skin/default/js/password_reset.js +++ b/Open-ILS/web/opac/skin/default/js/password_reset.js @@ -73,7 +73,8 @@ function createResetDialog() { pwResetFormDlg.startup(); // Instantiate the form - var pwResetFormDiv = dojo.create("form", { id: "requestReset", style: "width: 30em", method: "post", action: "/opac/password/en-US" }); + var pwResetFormURL = "/opac/password/" + (OpenSRF.locale || "en-US") + "/"; + var pwResetFormDiv = dojo.create("form", { id: "requestReset", style: "width: 30em", method: "post", action: pwResetFormURL }); dojo.create("p", { innerHTML: opac_strings.PWD_RESET_SUBMIT_PROMPT }, pwResetFormDiv); var pwResetFormTable = dojo.create("table", null, pwResetFormDiv); var pwResetFormTbody = dojo.create("tbody", null, pwResetFormTable);