Файл: modules/guest/admin.php
Строк: 185
<?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');
####################
$str = filter($_GET['str']);
$page = filter($_GET['page']);
$for = filter($_GET['for']);
####################
if($_GET[act]=='ans')
{
include ("../../themes/$themes.php");
if(isset($_SESSION['pass']) && isset($passw) && $_SESSION['pass'] == $passw && $status == "1")
{
echo '<p class="modul_name">Ответ админа</p>';
echo "<form action="admin.php?act=send&str=$str&page=$page&".session_name()."=".session_id()."" method="post">";
echo "<p class="b">Ответ для $for<br /><textarea rows="4" cols="15" name="otv"></textarea><br />
<input type="checkbox" name="msgtrans" value="1" /> Транслит сообщения";
echo "<br /><br />";
echo "<input type="submit" value="Ответить" /></p></form>";
echo "<p><a href="index.php?page=$page&".session_name()."=".session_id()."">В гостевую</a></p>";
}
else
{
echo "<p class="err">Ошибка авторизации!!!<br /></p>";
echo "<p><a href="index.php?".session_name()."=".session_id()."">В гостевую</a></p>";
}
include ('../../templates/foot.php');
}
####################
if($_GET[act]=='banuser')
{
if (isset($_SESSION['pass']) && isset($passw) && $_SESSION['pass'] == $passw && ($status == "1" || $status == "2" || $status == "3"))
{
include ("../../themes/$themes.php");
$kogo = filter($_GET['ban']);
echo'<p class="modul_name">Забанить пользователя '.$kogo.'</p>';
echo"<form method="post" action="../admin/users.php?act=ban&nick=$kogo&".session_name()."=".session_id().""><p class="b">";
echo"До какого времени:<br />";
echo"Год: <select name="god" class="textbox">";
for($g=2010; $g <= 2020; $g++)
{
if($g == date ("Y", time() + ($sdvigclock*3600)))
{ echo"<option selected="selected">$g</option>"; } else
{ echo"<option>$g</option>"; }
}
echo "</select>";
echo "Сейчас: ".date ("Y", time() + ($sdvigclock*3600))."<br />";
echo"Месяц: <select name="mes" class="textbox">";
for($m=1; $m <= 12; $m++)
{
if($m < 10) { $m = "0".$m; }
if($m == date ("m", time() + ($sdvigclock*3600)))
{ echo"<option selected="selected">$m</option>"; } else
{ echo"<option>$m</option>"; }
}
echo "</select>";
echo "Сейчас: ".date ("m", time() + ($sdvigclock*3600))."<br />";
echo"День: <select name="den" class="textbox">";
for($d=1; $d <= 31; $d++)
{
if($d < 10) { $d = "0".$d; }
if($d == date ("d", time() + ($sdvigclock*3600)))
{ echo"<option selected="selected">$d</option>"; } else
{ echo"<option>$d</option>"; }
}
echo "</select>";
echo "Сейчас: ".date ("d", time() + ($sdvigclock*3600))."<br />";
echo"Час: <select name="chas" class="textbox">";
for($ch=0; $ch <= 23; $ch++)
{
if($ch < 10) { $ch = "0".$ch; }
if($ch == date ("H", time() + ($sdvigclock*3600)))
{ echo"<option selected="selected">$ch</option>"; } else
{ echo"<option>$ch</option>"; }
}
echo "</select>";
echo "Сейчас: ".date ("H", time() + ($sdvigclock*3600))."<br />";
echo"Минут: <select name="minut" class="textbox">";
for($mi=0; $mi <= 59; $mi++)
{
if($mi < 10) { $mi = "0".$mi; }
if($mi == date ("i", time() + ($sdvigclock*3600)))
{ echo"<option selected="selected">$mi</option>"; } else
{ echo"<option>$mi</option>"; }
}
echo "</select>";
echo "Сейчас: ".date ("i", time() + ($sdvigclock*3600))."<br />";
echo"За (что?):<br /><input name="why" value="плохое поведение" /><br />";
echo"<input value="Применить" type="submit" /></p></form>";
echo "<p><a href="index.php?".session_name()."=".session_id()."">В гостевую</a></p>";
include ('../../templates/foot.php');
}
else
{
include ("../../themes/$themes.php");
echo "<p class="err">Ошибка авторизации!!!<br /></p>";
echo "<p><a href="index.php?".session_name()."=".session_id()."">В гостевую</a></p>";
include ('../../templates/foot.php');
}
}
####################
if($_GET[act]=='send')
{
if(isset($_SESSION['pass']) && isset($passw) && $_SESSION['pass'] == $passw && $status == "1")
{
$otv = filter($_POST['otv']);
if ($_POST[msgtrans]==1)
{
$otv = tr_to_win($otv);
}
$otv = stripslashes(smiles(bbcodes($otv)));
$otv = str_replace('
', '<br />', $otv);
$base = "../../data/gb.txt";
$basestr = file("$base");
$restr = trim($basestr[$str]);
$buff = @file_get_contents($base);
$buff = str_replace("$restrrn","$restr|$otvrn",$buff);
write_to_file($base, $buff);
header ("Location: index.php?page=$page&".session_name()."=".session_id()."");
}
else
{
include ("../../themes/$themes.php");
echo "<p class="err">Ошибка авторизации!!!<br /></p>";
echo "<p><a href="index.php?".session_name()."=".session_id()."">В гостевую</a></p>";
include ('../../templates/foot.php');
}
}
####################
if($_GET[act]=='del')
{
if(isset($_SESSION['pass']) && isset($passw) && $_SESSION['pass'] == $passw && ($status == "1" || $status == "2" || $status == "3"))
{
$basedel = "../../data/gb.txt";
$basestr = file("$basedel");
$delstr = trim($basestr[$str]);
$mes_exp = explode('|', $basestr[$str]);
$deleted_mes = trim($mes_exp[6]);
$buff = @file_get_contents($basedel);
$buff = str_replace("$delstrrn",'',$buff);
write_to_file($basedel, $buff);
$date = date('d.m.Y / H:i:s', time() + ($sdvigclock*3600));
$adm_log_f = @file('../../data/adm_log.php');
$adm_log_count = count($adm_log_f) - 2;
$mes_to_adm_log = "$login|$date|Удалил сообщение "$deleted_mes"rn";
for($i=2; $i < $adm_log_count; $i++)
{
$mes_to_adm_log .= $adm_log_f[$i];
}
$mes_to_adm_log = trim($mes_to_adm_log);
$adm_log_file = fopen('../../data/adm_log.php','w');
flock ($adm_log_file,LOCK_EX);
fputs($adm_log_file,"<?phprn/*rn$mes_to_adm_logrn*/rn?>");
fflush ($adm_log_file);
flock ($adm_log_file,LOCK_UN);
fclose($adm_log_file);
header ("Location: index.php?page=$page&".session_name()."=".session_id()."");
}
else
{
include ("../../themes/$themes.php");
echo "<p class="err">Ошибка авторизации!!!<br /></p>";
echo "<p><a href="index.php?".session_name()."=".session_id()."">В гостевую</a></p>";
include ('../../templates/foot.php');
}
}
####################
if($_GET[act]=='ban')
{
if (isset($_SESSION['pass']) && isset($passw) && $_SESSION['pass'] == $passw && ($status == "1" || $status == "2" || $status == "3"))
{
$ban_ip = htmlspecialchars(stripslashes(trim($_GET['ban'])));
$banlist = "../../data/ban.txt";
$file = fopen("$banlist","a+");
fputs($file,"$ban_iprn");
fclose($file);
$ban_exp = explode("||", $ban_ip);
$ban_ip = $ban_exp[0].' - '.$ban_exp[1];
$date = date("d.m.Y / H:i:s", time() + ($sdvigclock*3600));
$adm_log_f = @file('../../data/adm_log.php');
$adm_log_count = count($adm_log_f) - 2;
$mes_to_adm_log = "$login|$date|Забанил IP $ban_iprn";
for($i=2; $i < $adm_log_count; $i++)
{
$mes_to_adm_log .= "$adm_log_f[$i]";
}
$mes_to_adm_log = trim($mes_to_adm_log);
$adm_log_file = fopen('../../data/adm_log.php',"w");
flock ($adm_log_file,LOCK_EX);
fputs($adm_log_file,"<?phprn/*rn$mes_to_adm_logrn*/rn?>");
fflush ($adm_log_file);
flock ($adm_log_file,LOCK_UN);
fclose($adm_log_file);
include ("../../themes/$themes.php");
echo "<p class="b">IP и браузер забанены!<br /></p>";
echo "<p><a href="index.php?".session_name()."=".session_id()."">В гостевую</a></p>";
include ("../../templates/foot.php");
}
else
{
include ("../../themes/$themes.php");
echo "<p class="err">Ошибка авторизации!!!<br /></p>";
echo "<p><a href="index.php?".session_name()."=".session_id()."">В гостевую</a></p>";
include ('../../templates/foot.php');
}
}
####################
if ($_GET[act]=='clearguest')
{
if (isset($_SESSION['pass']) && isset($passw) && $_SESSION['pass'] == $passw && ($status == "1" || $status == "2"))
{
$basedel = "../../data/gb.txt";
$basestr = file("$basedel");
$buff = "$basestr[0]$basestr[1]$basestr[2]$basestr[3]$basestr[4]";
$file = fopen($basedel,"w");
flock ($file,LOCK_EX);
fputs($file,$buff);
fflush ($file);
flock ($file,LOCK_UN);
fclose($file);
$date = date("d.m.Y / H:i:s", time() + ($sdvigclock*3600));
$adm_log_f = @file('../../data/adm_log.php');
$adm_log_count = count($adm_log_f) - 2;
$mes_to_adm_log = "$login|$date|Очистил гостевуюrn";
for($i=2; $i < $adm_log_count; $i++)
{
$mes_to_adm_log .= $adm_log_f[$i];
}
$mes_to_adm_log = trim($mes_to_adm_log);
$adm_log_file = fopen('../../data/adm_log.php',"w");
flock ($adm_log_file,LOCK_EX);
fputs($adm_log_file,"<?phprn/*rn$mes_to_adm_logrn*/rn?>");
fflush ($adm_log_file);
flock ($adm_log_file,LOCK_UN);
fclose($adm_log_file);
header ("Location: index.php?".session_name()."=".session_id()."");
}
else
{
include ("../../themes/$themes.php");
echo "<p class="err">Ошибка авторизации!!!<br /></p>";
echo "<p><a href="index.php?".session_name()."=".session_id()."">В гостевую</a></p>";
include ('../../templates/foot.php');
}
}
####################
?>