if ($set['antidos']){
$antidos[]=array('time'=>$time);$k_loads=0;
if (is_file(H.'anti/ddos/antidos_'.$iplong.'.dat')){$antidos_dat=unserialize(file_get_contents(H.'anti/ddos/antidos_'.$iplong.'.dat'));
for ($i=0;$i<150 && $i<sizeof($antidos_dat);$i++)
{
if($antidos_dat[$i]['time']>$time-5)
{
$k_loads++;
$antidos[]=$antidos_dat[$i];
}
}
}
if ($k_loads>100)
{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban_ip` WHERE `min` <= '$iplong' AND `max` >= '$iplong'"), 0)==0)
mysql_query("INSERT INTO `ban_ip` (`min`, `max`, `prich`) values('$iplong', '$iplong', 'AntiDos')",$db);
}
@file_put_contents(H.'anti/ddos/antidos_'.$iplong.'.dat', serialize($antidos));
@chmod(H.'anti/ddos/antidos_'.$iplong.'.dat', 0777);
}
// бан по IP
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban_ip` WHERE `min` <= '$iplong' AND `max` >= '$iplong'"), 0)!=0){
if (!isset($ban_ip_page)){header("Location: /ban_ip.php");exit;}}
if (isset($ip2['cl']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `ban_ip` WHERE `min` <= '".ip2long($ip2['cl'])."' AND `max` >= '".ip2long($ip2['cl'])."'"), 0)!=0){
if (!isset($ban_ip_page)){header("Location: /ban_ip.php");exit;}}
if (isset($ip2['xff']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `ban_ip` WHERE `min` <= '".ip2long($ip2['xff'])."' AND `max` >= '".ip2long($ip2['xff'])."'"), 0)!=0){
if (!isset($ban_ip_page)){header("Location: /ban_ip.php");exit;}}
