I have a problem with flood protection; when it’s enabled, it throws errors. Here are the codes.
if(!in_array(ICPConnect::get_client_ip(),array_merge($AllowedIps, $rangeMercadoPagoIps)) || strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'googlebot') === false){
$FloodProtection = new FloodProtection('ICPNetworks', 45, 60, null, false);
if($FloodProtection->check(ICPConnect::get_client_ip())){
header("HTTP/1.1 429 Too Many Requests");
exit("
<html>
<title>GamesAddicts - Flood Protection</title>
<body style=\"text-align:center;\">
<h1>Games Addicts Flood Protection</h1><br>
<img src=\"images/miscs/what.jfif\"><br>
<h3>Your IP ".ICPConnect::get_client_ip()." has been blocked!</h3>
Wait a few seconds and try to access again.<br><br>
</body>
</html>
");
}
}
Error
Fatal error: Uncaught Error: Call to undefined function frdl\security\floodprotection\get_current_user() in /home/vol3_7/infinityfree.com/if0_35690765/htdocs/engine/classes/FloodProtection.php:68 Stack trace:
#0 /home/vol3_7/infinityfree.com/if0_35690765/htdocs/engine/classes/FloodProtection.php(24): frdl\security\floodprotection\FloodProtection->getCacheDir('FRDL-FLOODPROTE...')
#1 /home/vol3_7/infinityfree.com/if0_35690765/htdocs/engine/classes/ICP_Connect.php(125): frdl\security\floodprotection\FloodProtection->__construct('ICPNetworks', 45, 60, NULL, false)
#2 /home/vol3_7/infinityfree.com/if0_35690765/htdocs/engine/connect.php(15): ICPConnect::connect('game', true, 'remotmysqlIP', 'remotemysqldb', 'remotmysqluser', 'remotmysqlpass')
#3 /home/vol3_7/infinityfree.com/if0_35690765/htdocs/index.php(18): require_once('/home/vol3_7/in...')
#4 {main} thrown in /home/vol3_7/infinityfree.com/if0_35690765/htdocs/engine/classes/FloodProtection.php on line 68
Could someone help me solve it?