@@ -, +, @@ fail with 500 error for local users if external auth (LDAP/CAS/Shibboleth) is enabled "userid": "koha", "password": "koha" --- C4/Auth.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -1997,9 +1997,10 @@ sub checkpw { # Nothing to check, account is locked } elsif ( $ldap && defined($password) ) { - my ( $retval, $retcard, $retuserid ); - ( $retval, $retcard, $retuserid, $patron ) = checkpw_ldap(@_); # EXTERNAL AUTH + my ( $retval, $retcard, $retuserid, $ldap_patron ); + ( $retval, $retcard, $retuserid, $ldap_patron ) = checkpw_ldap(@_); # EXTERNAL AUTH if ( $retval == 1 ) { + $patron = $ldap_patron if $ldap_patron; @return = ( $retval, $retcard, $retuserid, $patron ); $passwd_ok = 1; } @@ -2010,9 +2011,10 @@ sub checkpw { # In case of a CAS authentication, we use the ticket instead of the password my $ticket = $query->param('ticket'); $query->delete('ticket'); # remove ticket to come back to original URL - my ( $retval, $retcard, $retuserid, $cas_ticket, $patron ) = + my ( $retval, $retcard, $retuserid, $cas_ticket, $cas_patron ) = checkpw_cas( $ticket, $query, $type ); # EXTERNAL AUTH if ($retval) { + $patron = $cas_patron if $cas_patron; @return = ( $retval, $retcard, $retuserid, $patron, $cas_ticket ); } else { @return = (0); @@ -2031,9 +2033,10 @@ sub checkpw { # Then, we check if it matches a valid koha user if ($shib_login) { - my ( $retval, $retcard, $retuserid, $patron ) = + my ( $retval, $retcard, $retuserid, $shib_patron ) = C4::Auth_with_shibboleth::checkpw_shib($shib_login); # EXTERNAL AUTH if ($retval) { + $patron = $shib_patron if $shib_patron; @return = ( $retval, $retcard, $retuserid, $patron ); } $passwd_ok = $retval; --