From bb3fae14950ef013bb55c4d2d1b12558b12ade0a Mon Sep 17 00:00:00 2001 From: Ian Walls Date: Fri, 14 Oct 2011 16:37:54 -0400 Subject: [PATCH] Bug 5995 Followup: checkpw was returning inconsistent values In the case of LDAP, checkpw was returning the cardnumber of there user, but it was being treated as the userid. This patch updates checkpw_ldap to return the cardnumber AND the userid, and updates checkpw to uniformly return cardnumber and userid in all instances, so that whoever is authenticating can use the desired value in the right way. (cherry picked from commit dcb4ac77fbfd813cc0eb39e060b49a7b8d491016) Signed-off-by: Chris Nighswonger --- C4/Auth.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index b33f677428..57d9880b6f 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -750,7 +750,7 @@ sub checkauth { $info{'invalidCasLogin'} = 1 unless ($return); } else { my $retuserid; - ( $return, $retuserid ) = checkpw( $dbh, $userid, $password, $query ); + ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query ); $userid = $retuserid if ($retuserid ne ''); } if ($return) { @@ -1452,7 +1452,7 @@ sub checkpw { C4::Context->set_userenv( "$borrowernumber", $userid, $cardnumber, $firstname, $surname, $branchcode, $flags ); - return 1, $userid; + return 1, $cardnumber, $userid; } } $sth = -- 2.39.5