<?
ini_set('display_errors',0); 
include_once("inclydings/sql.php");
$stop_injection = new InitVars();
$stop_injection->checkVars();
if(getenv("HTTP_X_FORWARDED_FOR")){ $agent = getenv("HTTP_X_FORWARDED_FOR"); }else{
if(getenv("REMOTE_ADDR")) $agent = getenv("REMOTE_ADDR");}
$ugent=htmlspecialchars(stripslashes(getenv('HTTP_USER_AGENT')));
$agent=$agent.'|'.$ugent;
$time=time();
$oftime=$time-600;
$bans0="L2dbnam/esql2db/online.dat";
$lines0=file("$bans0");
$itogo0=count($lines0);
if($itogo0>="100"){
$fp=@fopen("L2dbnam/esql2db/online.dat","w");
flock($fp,LOCK_EX);
fputs($fp,"$time#$agent#$log#");
flock($fp,LOCK_UN);
fclose($fp);
}
$aron=@file("L2dbnam/esql2db/online.dat");
$ton=0;
foreach($aron as $key => $val) {
$artext=@explode("#",$val);
if($artext[0]>$oftime & $agent!=$artext[1] & $artext[1]!=""){
$newar[$ton]=$val;
$ton=round($ton+1);}
if($agent==$artext[1] & $artext[0]>$oftime){$metod="xit";}}
$newar[$ton]=$time."#".$agent."#".$log."#\r\n";
$fp=@fopen("L2dbnam/esql2db/online.dat","a+");
ftruncate($fp,0);
fclose($fp);
foreach($newar as $key => $val) {
$fp=@fopen("L2dbnam/esql2db/online.dat","a");
flock($fp,LOCK_EX);
fputs($fp,$val);
flock($fp,LOCK_UN);
fclose($fp);}
$online=round($ton+1);
$str = @implode("",@file("L2dbnam/esql2db/online.dat"));
$substr_count = substr_count($str,"##");
$bans="L2dbnam/esql2db/online.dat";
$lines=file("$bans");
$itogo=count($lines);
?>