Просмотр файла pages/addpriv.php

Размер файла: 3.5Kb
<?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          #
#-----------------------------------------------------#
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/maincore.php";
require_once"../template/antidos.php";
require_once"../template/gzip.php";
require_once"../template/header.php";

$uz=check($uz); 

$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($uz==""){header ("Location: privat.php?action=submit&isset=nouz&uz=$uz&".SID); exit;}

$str=strlen($mess);
if($mess=="" || $str<6){header ("Location: privat.php?action=submit&isset=nomess&uz=$uz&".SID); exit;}

$proverka = @file("../local/profil/$uz.prof"); 
$ster=strlen($uz);
if (empty($proverka) || $ster<1){
{header ("Location: privat.php?action=submit&isset=nouzer&".SID); exit;}	
} else{

$filesize= filesize("../local/privat/$uz.$config_priv");
$filesize=round($filesize/1024,2);
$pers=round($filesize*100/$config_limitsmail);
if($pers>="99"){header ("Location: privat.php?action=submit&isset=fullmail&uz=$uz&".SID); exit;}

if (CheckIP ()){header ("Location: privat.php?action=submit&isset=antiflood&uz=$uz&".SID); exit;}
	
	

$mess = check($mess);
$log = check($log);
$mess=preg_replace ("|[\r\n]+|si","",$mess);
$mess=substr($mess,0,1500);


if($trans=="y"){$mess=str_replace($trans1,$trans2,$mess);};


$mess=base64_encode($mess);
$tex=$log.'|'.$mess.'|'.$currDate.' / '.$currTime.'|||'; 



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

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

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

$fp=fopen(BASEDIR."local/privat/$uz.$config_priv","a+");  
flock ($fp,LOCK_EX);                                                              
fputs($fp,$tex."\r\n");
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);  

header ("Location: ../index.php?isset=mail&".SID); exit;

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

?>