Gets blacklisted ips

main
Yasen Pramatarov 2025-01-03 18:07:34 +02:00
parent 13947e2099
commit f4c008c65f
1 changed files with 7 additions and 0 deletions

View File

@ -303,6 +303,13 @@ class RateLimiter {
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function getBlacklistedIps() {
$stmt = $this->db->prepare("SELECT * FROM {$this->blacklistTable} ORDER BY created_at DESC");
$stmt->execute();
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
public function attempt($username, $ipAddress) {
// Skip rate limiting for whitelisted IPs
if ($this->isIpWhitelisted($ipAddress)) {