Loads the ratelimiter class and fixes typos

main
Yasen Pramatarov 2025-01-03 18:44:08 +02:00
parent a076c28a30
commit 8f32a79d0e
3 changed files with 4 additions and 3 deletions

View File

@ -22,8 +22,7 @@ class RateLimiter {
id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER PRIMARY KEY AUTOINCREMENT,
ip_address TEXT NOT NULL, ip_address TEXT NOT NULL,
username TEXT NOT NULL, username TEXT NOT NULL,
attempted_at TEXT DEFAULT (DATETIME('now')), attempted_at TEXT DEFAULT (DATETIME('now'))
INDEX idx_ip_username (ip_address, username)
)"; )";
$this->db->exec($sql); $this->db->exec($sql);

View File

@ -33,7 +33,6 @@ CREATE TABLE login_attempts (
username TEXT NOT NULL, username TEXT NOT NULL,
attempted_at TEXT DEFAULT (DATETIME('now')), attempted_at TEXT DEFAULT (DATETIME('now')),
); );
CREATE INDEX idx_ip_username ON login_attempts (ip_address, username);
CREATE TABLE ip_whitelist ( CREATE TABLE ip_whitelist (
id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER PRIMARY KEY AUTOINCREMENT,

View File

@ -111,6 +111,9 @@ include '../app/helpers/logs.php';
$logObject = new Log($dbWeb); $logObject = new Log($dbWeb);
$user_IP = getUserIP(); $user_IP = getUserIP();
// init rate limiter
require '../app/classes/ratelimiter.php';
// get platforms details // get platforms details
require '../app/classes/platform.php'; require '../app/classes/platform.php';
$platformObject = new Platform($dbWeb); $platformObject = new Platform($dbWeb);