[open-ils-commits] r16587 - in branches/rel_1_6/Open-ILS: src/perlmods/OpenILS/Application src/perlmods/OpenILS/WWW web/opac/skin/default/js (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jun 3 21:37:04 EDT 2010
Author: dbs
Date: 2010-06-03 21:37:02 -0400 (Thu, 03 Jun 2010)
New Revision: 16587
Modified:
branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm
branches/rel_1_6/Open-ILS/web/opac/skin/default/js/password_reset.js
Log:
Merge r16568 through r16572 from trunk for fixes to password reset functionality
Modified: branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2010-06-03 20:02:39 UTC (rev 16586)
+++ branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2010-06-04 01:37:02 UTC (rev 16587)
@@ -3528,8 +3528,9 @@
# 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');
}
Modified: branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm
===================================================================
--- branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm 2010-06-03 20:02:39 UTC (rev 16586)
+++ branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/PasswordReset.pm 2010-06-04 01:37:02 UTC (rev 16587)
@@ -107,7 +107,6 @@
# 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 @@
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 @@
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'}
Modified: branches/rel_1_6/Open-ILS/web/opac/skin/default/js/password_reset.js
===================================================================
--- branches/rel_1_6/Open-ILS/web/opac/skin/default/js/password_reset.js 2010-06-03 20:02:39 UTC (rev 16586)
+++ branches/rel_1_6/Open-ILS/web/opac/skin/default/js/password_reset.js 2010-06-04 01:37:02 UTC (rev 16587)
@@ -73,7 +73,8 @@
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);
More information about the open-ils-commits
mailing list