From 4ce41be3dfc303a999ab28e10b1e051aa36fc0e4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 21 Mar 2017 21:18:10 -0300 Subject: [PATCH] Bug 18314: Resetting the password removes the lock When a password is changed (updated by a staff member or using the "recover password via email" feature, the counter/flag needs to be reset. Signed-off-by: Jonathan Field Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall --- Koha/Patron.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 860a4b6cf2..015cb41eba 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -334,7 +334,12 @@ sub update_password { my ( $self, $userid, $password ) = @_; eval { $self->userid($userid)->store; }; return if $@; # Make sure the userid is not already in used by another patron - $self->password($password)->store; + $self->update( + { + password => $password, + login_attempts => 0, + } + ); logaction( "MEMBERS", "CHANGE PASS", $self->borrowernumber, "" ) if C4::Context->preference("BorrowersLog"); return 1; } -- 2.39.5