From e244b91aa8613f089fd91df7fe9591d6d0cfde96 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. --- Koha/Patron.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 3c1c0d4..a766478 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -333,7 +333,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.9.3