< is not >; get our time-to-live threshold comparison correct
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Jun 2010 03:39:16 +0000 (03:39 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Jun 2010 03:39:16 +0000 (03:39 +0000)
Also add a useful log entry to differentiate this not-active-request reason from the others

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16570 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Actor.pm

index 061122f..4a347ba 100644 (file)
@@ -3877,8 +3877,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');
     }