Просмотр файла template/cookies.php

Размер файла: 3.11Kb
<?php
#-----------------------------------------------------#
#        ********* WAP-MOTORS WebMod *********        #
#-----------------------------------------------------#
#    Original Made by   :  VANTUZ                     #
#               E-mail  :  [email protected]             #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#-----------------------------------------------------#
#      WebMod Made by   :  X-ray (Юрий)               #
#               E-mail  :  [email protected]           #
#                 Site  :  http://city.zugdidi.us     #
#             WAP-Site  :  http://zugdidi.us          #
#-----------------------------------------------------#
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------# 
if($config_cookies=="1"){
if(empty($_SESSION['par']) && empty($_SESSION['log']) && !empty($_COOKIE['cookpar']) && !empty($_COOKIE['cooklog'])) {
$unlog=base64_decode($_COOKIE['cooklog']);
$unpar=base64_decode($_COOKIE['cookpar']);

$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['counton']=0;	
$_SESSION['currs']=$currs;
$_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);
}

if($currs>$udata[53] && $udata[54]>0){
header ("Location: ".BASEDIR."games/kredit.php?".SID);  exit;} //если просрочен кредит

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

//---------------------- функция проверки ip и браузера --------------------------//
if (isset($_SESSION[log]) && isset($_SESSION[par])) { 
$pr_ip = explode(".",$ip);
$new_ip=$pr_ip[0].$pr_ip[1].$pr_ip[2];	

if($new_ip!=$_SESSION[my_ip] || $brow!=$_SESSION[my_brow]){
session_unset();
setcookie(session_name(), '');
session_destroy();
}}
//--------------------------------------------------------------//
if(!file(BASEDIR."themes/$config_themes/index.php")){$config_themes="default";}

/*
$phpself = substr($_SERVER['PHP_SELF'],1);
$phpself =str_replace ("/","_",$phpself );
if(!eregi("[^a-z0-9_/.-]",$phpself)){
include_once BASEDIR."language/$config_language/$phpself";}
*/
?>