From a5e84d45c07a62d682c25251d2f3fcc9577c6d97 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 28 Apr 2017 17:14:53 -0300 Subject: [PATCH] Bug 18314: Fix reset number of login attempts on login success Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall --- C4/Auth.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 74c2792477..9e787c0567 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1815,8 +1815,12 @@ sub checkpw { if ( $return[0] == 0 ) { $patron->update({ login_attempts => $patron->login_attempts + 1 }) if $patron; - } elsif ( $return[1] == 1 ) { - $patron->update({ login_attempts => 0 })->store if $patron; + } elsif ( $return[0] == 1 ) { + if ( $patron ) { + # FIXME Koha::Object->update should return a Koha::Object to allow chaining + $patron->update({ login_attempts => 0 }); + $patron->store; + } } return @return; } -- 2.20.1