<?php
#-----------------------------------------------------#
#          ********* WAP-MOTORS *********             #
#             Made by   :  VANTUZ                     #
#               E-mail  :  vsem@pizdec.ru             #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#	
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/gzip.php";
require_once"../template/header.php";


$text = file("../local/profil/$log.prof"); 
if ($text!=""){
$udata = explode(":||:",$text[0]);
$provlog=trim($udata[0]);
$provpar=trim($udata[1]);}

if ($_SESSION['log']!="" && md5($_SESSION['par'])!="" && md5($_SESSION['par'])==$provpar && $_SESSION['log']==$provlog ) {
if(eregi("[^0-9]",$bookpostus) || $bookpostus>50 || empty($bookpostus)){ header ("Location: setting.php?isset=incorrect&".SID);  exit;}
if(eregi("[^0-9]",$news)|| $news>50 || empty($news)){ header ("Location: setting.php?isset=incorrect&".SID);  exit;}
if(eregi("[^0-9]",$forumpost)|| $forumpost>50 || empty($forumpost)){ header ("Location: setting.php?isset=incorrect&".SID);  exit;}
if(eregi("[^0-9]",$forumtem)|| $forumtem>50 || empty($forumtem)){ header ("Location: setting.php?isset=incorrect&".SID);  exit;}
if(eregi("[^0-9]",$userlist)||$userlist>50 || empty($userlist)){ header ("Location: setting.php?isset=incorrect&".SID);  exit;}
if(eregi("[^0-9]",$chatpost)|| $chatpost>50 || empty($chatpost)){ header ("Location: setting.php?isset=incorrect&".SID);  exit;}
if(eregi("[^0-9]",$rewnew)|| $rewnew>300 || empty($rewnew)){ header ("Location: setting.php?isset=incorrect&".SID);  exit;}
if(eregi("[^0-9]",$board)|| $board>50 || empty($board)){ header ("Location: setting.php?isset=incorrect&".SID);  exit;}
if(eregi("[^0-9]",$prrivs)|| $prrivs>50 || empty($prrivs)){ header ("Location: setting.php?isset=incorrect&".SID);  exit;}
if(eregi("[^0-9+-]",$sdvig) || $sdvig===""){ header ("Location: setting.php?isset=incorrect&".SID);  exit;}

$_SESSION['my_themes']="";
unset($_SESSION['my_themes']); // Удаление темы из сессии

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

$udata[14]=$ip;
$udata[20]=check($skins);
$udata[21]=(int)$bookpostus;
$udata[22]=(int)$news;
$udata[23]=(int)$forumpost;
$udata[24]=(int)$forumtem;
$udata[25]=(int)$userlist;
$udata[26]=(int)$chatpost;
$udata[27]=(int)$rewnew;
$udata[28]=(int)$board;
$udata[30]=check($sdvig);
$udata[31]=(int)$times;
$udata[32]=(int)$prrivs;
$udata[42]=(int)$graffic;
$udata[45]=(int)$editavator;
$udata[55]=(int)$editperson;
$udata[66]=(int)$ipcontrol;

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);
}
header ("Location: ../index.php?isset=editsetting&".SID);

}else{
header ("Location: ../index.php?isset=inputoff&".SID); exit;}                    
?>