Adds back auto-blacklisting in rate limiter
parent
4a18c344c8
commit
ecad8e2801
|
@ -461,7 +461,21 @@ class RateLimiter {
|
||||||
$stmt->execute([':ip' => $ipAddress]);
|
$stmt->execute([':ip' => $ipAddress]);
|
||||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
return $result['attempts'] >= $this->maxAttempts;
|
$tooMany = $result['attempts'] >= $this->maxAttempts;
|
||||||
|
|
||||||
|
// Auto-blacklist if too many attempts
|
||||||
|
if ($tooMany) {
|
||||||
|
$this->addToBlacklist(
|
||||||
|
$ipAddress,
|
||||||
|
false,
|
||||||
|
'Auto-blacklisted due to excessive login attempts',
|
||||||
|
'system',
|
||||||
|
null,
|
||||||
|
$this->autoBlacklistDuration
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $tooMany;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clearOldAttempts() {
|
public function clearOldAttempts() {
|
||||||
|
|
Loading…
Reference in New Issue