@@ -, +, @@ empty cardnumber(s) - Use a patron with an empty cardnumber to authenticate with ILSDI AuthenticatePatron (cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=userid&password=pass), - make sure you have other patron(s) with empty cardnumber and there borrowernumber is smaller than the one you authenticate with, - you should get a wrong borrowernumber, - apply this patch, - test again, you should get the right one --- C4/ILSDI/Services.pm | 2 +- t/db_dependent/ILSDI_Services.t | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) --- a/C4/ILSDI/Services.pm +++ a/C4/ILSDI/Services.pm @@ -357,7 +357,7 @@ sub AuthenticatePatron { my ($status, $cardnumber, $userid) = C4::Auth::checkpw( C4::Context->dbh, $username, $password ); if ( $status ) { # Get the borrower - my $patron = Koha::Patrons->find( { cardnumber => $cardnumber } ); + my $patron = Koha::Patrons->find( { userid => $userid } ); return { id => $patron->borrowernumber }; } else { --- a/t/db_dependent/ILSDI_Services.t +++ a/t/db_dependent/ILSDI_Services.t @@ -42,9 +42,17 @@ subtest 'AuthenticatePatron test' => sub { my $plain_password = 'tomasito'; + $builder->build({ + source => 'Borrower', + value => { + cardnumber => undef, + } + }); + my $borrower = $builder->build({ source => 'Borrower', value => { + cardnumber => undef, password => Koha::AuthUtils::hash_password( $plain_password ) } }); --