Skip to content

Commit

Permalink
Fix limit retry feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ctgraham committed Aug 27, 2021
1 parent 066d25e commit 89e2199
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion features/LimitRetry.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ private function _handleTemplateDisplay() : void {
$time = $user->getFailedTime();

// Discard old bad password attempts
// When the memory has expired
if ($count && $time < time() - $this->_lockExpiresSeconds) {
$badpwFailedLoginsDao->resetCount($user);
// And the user is not currently locked
if ($user->getCount() < $this->_maxRetries || $user->getFailedTime() <= time() - $this->_lockSeconds) {
$badpwFailedLoginsDao->resetCount($user);
}
}

// Update the count to represent this failed attempt
Expand Down
File renamed without changes.

0 comments on commit 89e2199

Please sign in to comment.