Файл: modules/guest/send.php
Строк: 77
<?php
########################################
## WAP-ENGINE ##
########################################
## ##
## Автор : CHUMA (Токарев Владимир) ##
## e-mail : crazychuma@gmail.com ##
## WAP : http://wap-engine.ru ##
## ##
########################################
## ВЫ НЕ ИМЕЕТЕ ПРАВО ##
## ИЗМЕНЯТЬ КОД СКРИПТА ##
## ДЛЯ ДАЛЬНЕЙШЕГО РАСПРОСТРАНЕНИЯ! ##
########################################
include ('../../config.php');
include ('../../templates/run.php');
include ('../../templates/func.php');
####################
$banlist = file('../../data/ban.txt');
$base = '../../data/gb.txt';
if(isset($_SESSION['pass']) && isset($passw) && $_SESSION['pass'] == $passw)
{
$name_guest = $login;
}
else
{
$name_guest = 'Гость';
}
$msg = filter($_POST['msg']);
$msg = str_replace('|', '', $msg);
$popravka = $sdvigclock*3600;
$time = date('H:i:s', time() + $popravka);
$date = date('d.m.Y', time() + $popravka);
$ip = filter($_SERVER['REMOTE_ADDR']);
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$brauzer = strtok($user_agent,' ');
$brauzer = filter($brauzer);
$brauzer = str_replace('|', '', $brauzer);
$ban = $brauzer.'||'.$ip;
foreach ($banlist as $key => $string)
{
if($ban == trim(array_shift($banlist)))
{
$errb = 1;
}
}
$date_now = date ('YmdHis', time() + $popravka);
if($bantime > $date_now)
{
$errb = 2;
}
$for = filter($_POST['for']);
$for = str_replace('|', '', $for);
$nicks = file('../../data/nicks.php');
$count_nicks = count($nicks);
$count_nicks = $count_nicks - 2;
for($i=2; $i <= $count_nicks; $i++)
{
if($for == trim($nicks[$i]))
{
$user_est = 1;
break;
}
}
if(!empty($for) && strlen($for) > 20)
{
header("Location: add.php?err=1");
}
elseif(!empty($for) && empty($user_est))
{
header("Location: add.php?err=2");
}
elseif(empty($msg))
{
header("Location: add.php?err=3");
}
elseif(strlen($msg) > 500)
{
header("Location: add.php?err=4");
}
elseif($name_guest=="Гость" && empty($_POST['imgrand']))
{
header("Location: add.php?err=5");
}
elseif($name_guest=="Гость" && !empty($_POST['imgrand']) && $_POST['imgrand'] != $_SESSION['rand'])
{
header("Location: add.php?err=6");
}
elseif($name_guest=="Гость" && $errb == 1)
{
header("Location: add.php?err=7");
}
elseif($errb == 2)
{
header("Location: add.php?err=8");
}
elseif($name_guest=="Гость" && $dostup_guest == "0")
{
header("Location: add.php?err=9");
}
else
{
if ($_POST[msgtrans]==1)
{
$msg = tr_to_win($msg);
}
$msg = smiles($msg);
$msg = antimat($msg);
$msg = bbcodes($msg);
$msg = stripslashes($msg);
$msg = str_replace('
', '<br />', $msg);
$back = @file_get_contents($base);
write_to_file($base, "$name_guest|$for|$brauzer|$ip|$time|$date|$msg"."rn"."$back");
if(isset($_SESSION['pass']) && isset($passw) && $_SESSION['pass'] == $passw)
{
$mes_guest = $mes_guest + 1;
$rating = $rating + 1;
if($rating == 10 && $status == '5')
{
$status = '4';
}
$str_to_user_file = str_user_data(); # Строка данных пользователя находится в файле templates/func.php
write_to_file('../../data/users/'.$login.'.php', "<?phprn/*rn$str_to_user_filern*/rn?>");
}
header ('Location: index.php?'.session_name().'='.session_id().'');
}
####################
?>