<?php
#-----------------------------------------------------#
#          ********* WAP-MOTORS *********             #
#             Made by   :  VANTUZ                     #
#               E-mail  :  vsem@pizdec.ru             #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#	 
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"); 
$udata = explode(":||:",$cookles[0]);
if (md5($unpar)==$udata[1] && $unlog==$udata[0] && $unlog!=="" && md5($unpar)!=="") {
$log=$unlog;
$par=$unpar;
$currs=time();

$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]="$currDate/$currTime2";

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);
}

$phpself = substr($_SERVER['PHP_SELF'],1);
header ("Location: ".BASEDIR.$phpself."?".SID);
}}}
?>