LP1901930 Patron stat/info return full data w/ invalid patron password
authorBill Erickson <berickxx@gmail.com>
Mon, 24 Oct 2022 19:25:51 +0000 (15:25 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 24 Oct 2022 19:25:53 +0000 (15:25 -0400)
Consistent with the current Evergreen SIP server, return all info on
patrons for the patron status / information messages even if the
provided patron password is not correct.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Patron.pm

index b0b3222..c8f99b2 100644 (file)
@@ -419,7 +419,7 @@ sub patron_response_common_data {
             {BH => $session->config->{settings}->{currency}},
             {BL => $SC->sipbool(1)},          # valid patron
             {BV => $details->{balance_owed}}, # fee amount
-            {CQ => $SC->sipbool($password)}   # password verified if exists
+            {CQ => $SC->sipbool($details->{valid_patron_password})}
         ]
     };
 }
index f757297..86da493 100644 (file)
@@ -19,7 +19,7 @@ sub get_patron_details {
     my $password = $params{password};
 
     my $e = $session->editor;
-    my $details = {};
+    my $details = {valid_patron_password => 0};
 
     my $card = $e->search_actor_card([{
         barcode => $barcode
@@ -43,9 +43,12 @@ sub get_patron_details {
     $card->usr($card->usr->id);
     $patron->card($card);
 
-    # We only attempt to verify the password if one is provided.
-    return undef if defined $password &&
-        !$U->verify_migrated_user_password($e, $patron->id, $password);
+    if (defined $password) {
+        # SIP still replies with the patron data if the password
+        # is not valid.
+        $details->{valid_patron_password} = 
+            $U->verify_migrated_user_password($e, $patron->id, $password);
+    }
 
     set_patron_privileges($session, $details);