<?php
#-----------------------------------------------------#
#          ********* WAP-MOTORS *********             #
#             Made by   :  VANTUZ                     #
#               E-mail  :  visavi.net@mail.ru         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#	 
if (!defined("BASEDIR")) { header("Location:../index.php"); exit; }

if($config_cookies=="1"){
if(empty($_SESSION['par']) && empty($_SESSION['log']) && !empty($_COOKIE['cookpar']) && !empty($_COOKIE['cooklog'])) {
$unlog=xoft_decode($_COOKIE['cooklog'],$config_keypass);
$unpar=xoft_decode($_COOKIE['cookpar'],$config_keypass);

$cookles = file(BASEDIR."local/profil/$unlog.prof"); 
if ($cookles!=""){
$udata = explode(":||:",$cookles[0]);
if (md5($unpar)==$udata[1] && $unlog==$udata[0] && $unlog!=="" && md5($unpar)!=="") {
$log=$unlog;
$par=$unpar;

$pr_ip = explode(".",$ip);
$my_ip=$pr_ip[0].$pr_ip[1].$pr_ip[2];

$_SESSION['log']=$log;
$_SESSION['par']=$par;
$_SESSION['my_ip']=$my_ip;
$_SESSION['my_brow']=$brow;

//------------------------------ Запись в профиль ----------------------------//
$ufile = file(BASEDIR."local/profil/$log.prof"); 
$udata = explode(":||:",$ufile[0]);

$udata[11]++;
$udata[14]=$ip;
$udata[44]=$sitetime;

$utext="";
for ($u=0; $u<$config_userprofkey; $u++){
$utext.=$udata[$u].':||:';}

if($udata[0]!="" && $udata[1]!="" && $udata[4]!="" && $utext!=""){
$fp=fopen(BASEDIR."local/profil/$log.prof","a+");    
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                
fputs($fp,$utext);
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);  
unset($utext);
}

//$request_uri = urldecode($_SERVER['REQUEST_URI']);
//$request=substr(strtok($request_uri,'SID'),1);
//header ("Location: ".BASEDIR.$request);
}}}}
?>