From f35528e2e3030a97a86f8359a629bf38f1e2f641 Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Thu, 16 May 2019 14:43:37 +0200 Subject: [PATCH] Bug 22925 : Disable ILS-DI AuthenticatePatron if patron has lost card. test plan: 1 / set a patron as card lost in the intranet 2 / query ILS-DI with login and password -> should respond with borrowernumber 3 / apply patch 4 / Repeat 2, should respond code "PatronLostCard" --- C4/ILSDI/Services.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 43935bbf8f..ef2a157d20 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -369,14 +369,16 @@ sub AuthenticatePatron { my $username = $cgi->param('username'); my $password = $cgi->param('password'); my ($status, $cardnumber, $userid) = C4::Auth::checkpw( C4::Context->dbh, $username, $password ); - if ( $status ) { + if ( $status ) # Get the borrower my $patron = Koha::Patrons->find( { userid => $userid } ); - return { id => $patron->borrowernumber }; - } - else { + else return { code => 'PatronNotFound' }; - } + + if ( $patron->lost ) + return { code => 'PatronLostCard' }; + + return { id => $patron->borrowernumber }; } =head2 GetPatronInfo -- 2.11.0