From f4c008c65f9ded6c6a8e58d735f15cca5ed09591 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Fri, 3 Jan 2025 18:07:34 +0200 Subject: [PATCH] Gets blacklisted ips --- app/classes/ratelimitrer.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/classes/ratelimitrer.php b/app/classes/ratelimitrer.php index 8af1023..76b10ca 100644 --- a/app/classes/ratelimitrer.php +++ b/app/classes/ratelimitrer.php @@ -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)) {