Bugzilla – Attachment 94735 Details for
Bug 21190
Add logging of successful/unsuccessful login attempts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21190: Add authentication logging to checkpw
Bug-21190-Add-authentication-logging-to-checkpw.patch (text/plain), 1.43 KB, created by
Marcel de Rooy
on 2019-10-25 10:08:35 UTC
(
hide
)
Description:
Bug 21190: Add authentication logging to checkpw
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2019-10-25 10:08:35 UTC
Size:
1.43 KB
patch
obsolete
>From 1ca48260a7c680c12cbc56b68733f22a58be61d8 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 25 Oct 2019 09:55:32 +0000 >Subject: [PATCH] Bug 21190: Add authentication logging to checkpw >Content-Type: text/plain; charset=utf-8 > >Add optional logging for successful and failing login attempts in >checkpw. > >Test plan: >Enable the preferences >Perform a good login and a bad attempt >Check action_logs > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Auth.pm | 9 +++++++++ > 1 file changed, 9 insertions(+) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index cd53ecd3c6..5becae5ff3 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -45,6 +45,7 @@ use List::MoreUtils qw/ any /; > use Encode qw( encode is_utf8); > use C4::Auth_with_shibboleth; > use Net::CIDR; >+use C4::Log qw/logaction/; > > # use utf8; > use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug $ldap $cas $caslogout); >@@ -1855,6 +1856,14 @@ sub checkpw { > $patron->update({ login_attempts => $patron->login_attempts + 1 }); > } > } >+ >+ # Optionally log success or failure >+ 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 ); >+ } >+ > return @return; > } > >-- >2.11.0
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 21190
:
94713
|
94714
|
94715
|
94717
|
94732
|
94733
|
94734
|
94735
|
94736
|
94805
|
98067
|
98068
|
98069
|
98070
|
98071
|
98072
|
98073
|
98074
|
98110
|
98111
|
98112
|
98113
|
98114
|
98115
|
98116
|
98117
|
98125
|
98133
|
98134
|
98135
|
98136
|
98137
|
98138
|
98139
|
98140
|
98141
|
101971
|
101972
|
101973
|
101974
|
101975
|
101976
|
101977
|
101978
|
101979
|
102493
|
102494
|
102496
|
102497
|
102498
|
102499
|
102500
|
102501
|
102502
|
123540