Bugzilla – Attachment 158660 Details for
Bug 21431
Differentiate password change and password reset in action logs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21431: Add action parameter to set_password
Bug-21431-Add-action-parameter-to-setpassword.patch (text/plain), 2.69 KB, created by
Martin Renvoize (ashimema)
on 2023-11-08 12:29:30 UTC
(
hide
)
Description:
Bug 21431: Add action parameter to set_password
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-11-08 12:29:30 UTC
Size:
2.69 KB
patch
obsolete
>From 09a8556a9a9ec6bbc0bcc7920ecec4463415a611 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 2 Nov 2023 12:51:35 +0000 >Subject: [PATCH] Bug 21431: Add action parameter to set_password > >Added to the call in opac-password-recovery.pl. This allows >differentiating between password change and password reset when >viewing the logs. > >Test plan: >Enable BorrowersLog. >Do a password recovery on OPAC. >Check with log viewer for 'RESET PASS' action. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Patron.pm | 7 +++++-- > opac/opac-password-recovery.pl | 2 +- > 2 files changed, 6 insertions(+), 3 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 7571ca82fdd..f5066ec5e9a 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -902,10 +902,12 @@ sub is_going_to_expire { > > =head3 set_password > >- $patron->set_password({ password => $plain_text_password [, skip_validation => 1 ] }); >+ $patron->set_password({ password => $plain_text_password [, skip_validation => 1, action => NAME ] }); > > Set the patron's password. > >+Allows optional action parameter to change name of action logged (when enabled). Used for reset password. >+ > =head4 Exceptions > > The passed string is validated against the current password enforcement policy. >@@ -931,6 +933,7 @@ sub set_password { > my ( $self, $args ) = @_; > > my $password = $args->{password}; >+ my $action = $args->{action} || "CHANGE PASS"; > > unless ( $args->{skip_validation} ) { > my ( $is_valid, $error ) = Koha::AuthUtils::is_password_valid( $password, $self->category ); >@@ -1019,7 +1022,7 @@ sub set_password { > $self->login_attempts(0); > $self->SUPER::store; > >- logaction( "MEMBERS", "CHANGE PASS", $self->borrowernumber, "" ) >+ logaction( "MEMBERS", $action, $self->borrowernumber, "" ) > if C4::Context->preference("BorrowersLog"); > > return $self; >diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl >index 5d568298464..0c0824c6745 100755 >--- a/opac/opac-password-recovery.pl >+++ b/opac/opac-password-recovery.pl >@@ -162,7 +162,7 @@ elsif ( $query->param('passwordReset') ) { > $min_password_length = $borrower->category->effective_min_password_length; > $require_strong_password = $borrower->category->effective_require_strong_password; > try { >- $borrower->set_password({ password => $password }); >+ $borrower->set_password({ password => $password, action => 'RESET PASS' }); > > CompletePasswordRecovery($uniqueKey); > $template->param( >-- >2.41.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 21431
:
158256
|
158257
|
158258
|
158268
|
158269
|
158270
| 158660 |
158661
|
158662