2.0.3_login_attempts.sql

main 19 lines · 878 bytes Raw
Alex Alex Commit Initial commit 01/10/2026 09:20
1-- ---------------------------------------------------------------------------
2-- ZnoteX 2.0.3 - Login attempt tracking / IP lockout
3--
4-- Every login attempt (success or failure) is logged by IP. Admin Panel >
5-- Security > Login Protection reads this to lock an IP out after too many
6-- failures in a short window. Rows are pruned automatically as new ones are
7-- written, so this table never grows without bound.
8-- ---------------------------------------------------------------------------
9
10CREATE TABLE IF NOT EXISTS `znote_login_attempts` (
11 `id` int NOT NULL AUTO_INCREMENT,
12 `ip` varchar(45) NOT NULL,
13 `username` varchar(32) NOT NULL DEFAULT '',
14 `success` tinyint(1) NOT NULL DEFAULT '0',
15 `created_at` int NOT NULL,
16 PRIMARY KEY (`id`),
17 KEY `ip_time` (`ip`, `created_at`)
18) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
19
Top