# 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');
}
# 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'}
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'} = {
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'}
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'}
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'}
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);