Bugzilla – Attachment 5895 Details for
Bug 5995
Glitch with checkauth
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Propose Followup Patch
0001-Bug-5995-Followup-checkpw-was-returning-inconsistent.patch (text/plain), 3.13 KB, created by
Ian Walls
on 2011-10-14 20:42:06 UTC
(
hide
)
Description:
Propose Followup Patch
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2011-10-14 20:42:06 UTC
Size:
3.13 KB
patch
obsolete
>From 90468681e68774f78b43913ffd340ff249b2ed2b Mon Sep 17 00:00:00 2001 >From: Ian Walls <ian.walls@bywatersolutions.com> >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. >--- > C4/Auth.pm | 10 +++++----- > C4/Auth_with_ldap.pm | 4 ++-- > 2 files changed, 7 insertions(+), 7 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 54fb74c..36a6472 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -755,7 +755,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) { >@@ -1431,8 +1431,8 @@ sub checkpw { > my ( $dbh, $userid, $password, $query ) = @_; > if ($ldap) { > $debug and print "## checkpw - checking LDAP\n"; >- my ($retval,$retcard) = checkpw_ldap(@_); # EXTERNAL AUTH >- ($retval) and return ($retval,$retcard); >+ my ($retval,$retcard,$retuserid) = checkpw_ldap(@_); # EXTERNAL AUTH >+ ($retval) and return ($retval,$retcard,$retuserid); > } > > if ($cas && $query && $query->param('ticket')) { >@@ -1458,7 +1458,7 @@ sub checkpw { > > C4::Context->set_userenv( "$borrowernumber", $userid, $cardnumber, > $firstname, $surname, $branchcode, $flags ); >- return 1, $userid; >+ return 1, $cardnumber, $userid; > } > } > $sth = >@@ -1474,7 +1474,7 @@ sub checkpw { > > C4::Context->set_userenv( $borrowernumber, $userid, $cardnumber, > $firstname, $surname, $branchcode, $flags ); >- return 1, $userid; >+ return 1, $cardnumber, $userid; > } > } > if ( $userid && $userid eq C4::Context->config('user') >diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm >index 5baa07f..7f56d9c 100644 >--- a/C4/Auth_with_ldap.pm >+++ b/C4/Auth_with_ldap.pm >@@ -161,7 +161,7 @@ sub checkpw_ldap { > ($cardnumber eq $c2) or warn "update_local returned cardnumber '$c2' instead of '$cardnumber'"; > } else { # C1, D1 > # maybe update just the password? >- return(1, $cardnumber); # FIXME dpavlin -- don't destroy ExtendedPatronAttributes >+ return(1, $cardnumber, $local_userid); > } > } elsif ($config{replicate}) { # A2, C2 > $borrowernumber = AddMember(%borrower) or die "AddMember failed"; >@@ -189,7 +189,7 @@ sub checkpw_ldap { > } > C4::Members::Attributes::SetBorrowerAttributes($borrowernumber, $extended_patron_attributes); > } >-return(1, $cardnumber); >+return(1, $cardnumber, $userid); > } > > # Pass LDAP entry object and local cardnumber (userid). >-- >1.7.4.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 5995
:
3508
|
4091
| 5895 |
5953
|
6022