Bug 21190: (follow-up) Save patron id in failure when available
The wrong password might belong to an existing user. If that is the case, we have a $patron. Note that logaction will save the object info but has no user in the context environment for a failure. Test plan: Login with good user, bad pw and bad user, bad pw. Check logviewer. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
a2f24f8e58
commit
73fd85fd02
1 changed files with 1 additions and 1 deletions
|
@ -1868,7 +1868,7 @@ sub checkpw {
|
|||
if( $patron && $passwd_ok && C4::Context->preference('AuthSuccessLog') ) {
|
||||
logaction( 'AUTH', 'SUCCESS', $patron->id, "Valid password for $userid", $type );
|
||||
} elsif( !$passwd_ok && C4::Context->preference('AuthFailureLog') ) {
|
||||
logaction( 'AUTH', 'FAILURE', 0, "Wrong password for $userid", $type );
|
||||
logaction( 'AUTH', 'FAILURE', $patron ? $patron->id : 0, "Wrong password for $userid", $type );
|
||||
}
|
||||
|
||||
return @return;
|
||||
|
|
Loading…
Reference in a new issue