diff --git a/core/config.php b/core/config.php index b884ed4..144af13 100644 --- a/core/config.php +++ b/core/config.php @@ -215,3 +215,10 @@ if (!defined('USE_CAPTCHA')) { define('USE_CAPTCHA', true); } + + /** + * Флаг использования защиты от DDoS + */ + if (!defined('USE_DDOS_PROTECTION')) { + define('USE_DDOS_PROTECTION', false); + } diff --git a/core/lib/Core/Helpers/DDosProtection.class.php b/core/lib/Core/Helpers/DDosProtection.class.php index d9d2cac..9a84c28 100644 --- a/core/lib/Core/Helpers/DDosProtection.class.php +++ b/core/lib/Core/Helpers/DDosProtection.class.php @@ -94,7 +94,7 @@ $DB = DB::getInstance(); $item = $DB->getItem(self::TABLE, ['observed_key' => $this->observedKey]); if ($item) { - if ($item['attempts'] >= $item['attempts_limit'] && (time() - $item['last_active']) <= $item['time_interval']) { + if (USE_DDOS_PROTECTION && $item['attempts'] >= $item['attempts_limit'] && (time() - $item['last_active']) <= $item['time_interval']) { echo '