Bugzilla – Attachment 76806 Details for
Bug 21046
ILSDI - AuthenticatePatron returns a wrong borrowernumber if cardnumber is empty
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21046: Return the correct borrowernumber when there is empty cardnumber(s)
0001-Bug-21046-Return-the-correct-borrowernumber-when-the.patch (text/plain), 2.07 KB, created by
Kyle M Hall (khall)
on 2018-07-10 11:09:15 UTC
(
hide
)
Description:
Bug 21046: Return the correct borrowernumber when there is empty cardnumber(s)
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-07-10 11:09:15 UTC
Size:
2.07 KB
patch
obsolete
>From 0f0f4bf89445e42e59578fbe4386c7fb06273b99 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Fri, 6 Jul 2018 13:40:53 +0000 >Subject: [PATCH] Bug 21046: Return the correct borrowernumber when there is > empty cardnumber(s) > >Test plan: > - 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 > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/ILSDI/Services.pm | 2 +- > t/db_dependent/ILSDI_Services.t | 8 ++++++++ > 2 files changed, 9 insertions(+), 1 deletion(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 158ff8e0cb..5534d3ccbc 100644 >--- a/C4/ILSDI/Services.pm >+++ b/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 { >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index d918e43a73..1eca594137 100644 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/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 ) > } > }); >-- >2.15.2 (Apple Git-101.1) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21046
:
76737
|
76806
|
76854