extend rate limiter

This commit is contained in:
O K
2026-04-05 21:20:54 +03:00
parent 811451bd1c
commit 961c1ed53d
5 changed files with 58 additions and 38 deletions

View File

@@ -1,11 +1,21 @@
<?php
require_once dirname(__FILE__) . '/../../classes/BotLogger.php';
require_once dirname(__FILE__) . '/../../classes/RuleManager.php';
class BotLimiterVerifyModuleFrontController extends ModuleFrontController
{
public function initContent()
{
$ip = BotLogger::getRealIp();
// If they hit the verify page itself more than 5 times in 30 seconds
if (RateLimiter::checkIsRateLimited($ip, 'verify_page_load', 5, 30)) {
BotLogger::logBan($ip, 'VERIFY_PAGE_FLOOD');
header('HTTP/1.1 429 Too Many Requests');
die('Too many verification attempts.');
}
parent::initContent(); // This initializes the Standard PS Cookie
$ip = BotLogger::getRealIp();