diff --git a/C4/Auth.pm b/C4/Auth.pm index e4bd2277ec..a8a6d63e1c 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1971,8 +1971,8 @@ sub checkpw { # INTERNAL AUTH @return = checkpw_internal( $userid, $password, $no_set_userenv ); - $passwd_ok = 1 if $return[0] > 0; # 1 or 2 - $patron = $return[3]; + $passwd_ok = $return[0]; + $patron = $passwd_ok ? $return[3] : undef; } if ( defined $userid && !$patron ) { diff --git a/C4/Auth_with_shibboleth.pm b/C4/Auth_with_shibboleth.pm index 4e32784051..00af2b9de7 100644 --- a/C4/Auth_with_shibboleth.pm +++ b/C4/Auth_with_shibboleth.pm @@ -373,7 +373,7 @@ This routine is NOT exported =head2 _autocreate - my ( $retval, $retcard, $retuserid ) = _autocreate( $config, $match ); + my ( $retval, $retcard, $retuserid, $patron ) = _autocreate( $config, $match, $patron ); Given a shibboleth attribute reference and a userid this internal routine will add the given user to Koha and return their user credentials.