Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge remote-tracking branch 'kc/new/bug_5995' into kcmaster

  • Loading branch information...
commit a118102d4e2d7cf6bc1157a560c52fd6deb6f7a7 2 parents d139d40 + dcb4ac7
Chris Cormack authored October 15, 2011
10  C4/Auth.pm
@@ -755,7 +755,7 @@ sub checkauth {
755 755
 		    $info{'invalidCasLogin'} = 1 unless ($return);
756 756
         	} else {
757 757
 		    my $retuserid;
758  
-		    ( $return, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
  758
+		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
759 759
 		    $userid = $retuserid if ($retuserid ne '');
760 760
 		}
761 761
 		if ($return) {
@@ -1431,8 +1431,8 @@ sub checkpw {
1431 1431
     my ( $dbh, $userid, $password, $query ) = @_;
1432 1432
     if ($ldap) {
1433 1433
         $debug and print "## checkpw - checking LDAP\n";
1434  
-        my ($retval,$retcard) = checkpw_ldap(@_);    # EXTERNAL AUTH
1435  
-        ($retval) and return ($retval,$retcard);
  1434
+        my ($retval,$retcard,$retuserid) = checkpw_ldap(@_);    # EXTERNAL AUTH
  1435
+        ($retval) and return ($retval,$retcard,$retuserid);
1436 1436
     }
1437 1437
 
1438 1438
     if ($cas && $query && $query->param('ticket')) {
@@ -1458,7 +1458,7 @@ sub checkpw {
1458 1458
 
1459 1459
             C4::Context->set_userenv( "$borrowernumber", $userid, $cardnumber,
1460 1460
                 $firstname, $surname, $branchcode, $flags );
1461  
-            return 1, $userid;
  1461
+            return 1, $cardnumber, $userid;
1462 1462
         }
1463 1463
     }
1464 1464
     $sth =
@@ -1474,7 +1474,7 @@ sub checkpw {
1474 1474
 
1475 1475
             C4::Context->set_userenv( $borrowernumber, $userid, $cardnumber,
1476 1476
                 $firstname, $surname, $branchcode, $flags );
1477  
-            return 1, $userid;
  1477
+            return 1, $cardnumber, $userid;
1478 1478
         }
1479 1479
     }
1480 1480
     if (   $userid && $userid eq C4::Context->config('user')
4  C4/Auth_with_ldap.pm
@@ -161,7 +161,7 @@ sub checkpw_ldap {
161 161
             ($cardnumber eq $c2) or warn "update_local returned cardnumber '$c2' instead of '$cardnumber'";
162 162
         } else { # C1, D1
163 163
             # maybe update just the password?
164  
-		return(1, $cardnumber); # FIXME dpavlin -- don't destroy ExtendedPatronAttributes
  164
+		return(1, $cardnumber, $local_userid);
165 165
         }
166 166
     } elsif ($config{replicate}) { # A2, C2
167 167
         $borrowernumber = AddMember(%borrower) or die "AddMember failed";
@@ -189,7 +189,7 @@ sub checkpw_ldap {
189 189
 		}
190 190
            C4::Members::Attributes::SetBorrowerAttributes($borrowernumber, $extended_patron_attributes);
191 191
   	}
192  
-return(1, $cardnumber);
  192
+return(1, $cardnumber, $userid);
193 193
 }
194 194
 
195 195
 # Pass LDAP entry object and local cardnumber (userid).

0 notes on commit a118102

Please sign in to comment.
Something went wrong with that request. Please try again.