From 3e0551a464e308cc3e9cc5d419c5228d33ee315d Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 18 Feb 2013 10:54:41 +0000 Subject: [PATCH] Fixed incorrect fail counting. --- Webperl/AuthMethod/Database.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Webperl/AuthMethod/Database.pm b/Webperl/AuthMethod/Database.pm index cd102c6..c073f35 100644 --- a/Webperl/AuthMethod/Database.pm +++ b/Webperl/AuthMethod/Database.pm @@ -306,7 +306,7 @@ sub set_password { my $cryptpass = $self -> hash_password($password); my $reseth = $self -> {"dbh"} -> prepare("UPDATE ".$self -> {"settings"} -> {"database"} -> {"users"}." - SET password = ?, password_set = UNIX_TIMESTAMP() + SET password = ?, password_set = UNIX_TIMESTAMP(), force_change = 0 WHERE user_id = ?"); my $rows = $reseth -> execute($cryptpass, $userid); return $self -> self_error("Unable to perform user update: ". $self -> {"dbh"} -> errstr) if(!$rows); @@ -393,6 +393,8 @@ sub mark_loginfail { # Do nothing if limiting is not enabled return (0, 0) unless($self -> {"policy_max_loginfail"}); + # Get and increment the fail counter. + $failcount = $failcount -> [0] || 0; ++$failcount; # update the login fail counter