From 5689f03091aeeaed4486078f70d0f5620b416bb0 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 --- Koha/Patron.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 860a4b6..015cb41 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.1.4