Просмотр файла forum/admin/adminlist.php
- <?php
- // автор скрипта - Arab
- // icq - 9988817 сайт: http://bola.net.ru
- Error_Reporting(E_ALL & ~E_NOTICE);
- Error_Reporting (ERROR | WARNING);
- include_once "../includ/functions.php";
- include_once "../includ/login.php";
- include_once "../includ/setting.php";
- include_once "../includ/online.php";
- if (!$_SESSION[login]=="" && !md5($_SESSION[password])=="" && md5($_SESSION[password])==$npassword && $_SESSION[login]==$nlogin){
- if($m_level=="1" || $m_level=="2"){
- include_once "../../css/red/index.php";
- echo'<div class="agr"><center><b>Администрация</b></center></div><div class="bgr"><div class="url">';
- echo'Привет '.$login.'<br>';
- echo'<a href="../login/menu.php?'.SID.'">Личное меню</a> | <a href="../forum/?'.SID.'">Форум</a><hr>';
- if($privat>0){ echo'<a href="privat.php?'.SID.'">
- <img src="../images/mail.gif" alt=""> <font color="#ff2222"><b>Новое сообщение - ('.$privat.')</b></font></a><br>'; }
- $dir = opendir ("$maindir/forum/data/users");
- while ($file = readdir ($dir))
- {if (ereg (".log$", $file))
- {$a[]=$file;}}
- closedir ($dir);
- $total = count($a);
- for ($i = 0; $i < $total; $i++){
- $tex = file("$maindir/forum/data/users/".check($a[$i])."");
- $data = explode("|",$tex[0]);
- if($data[5]>=1 && $data[5]<=2){
- $a[$i]=str_replace(".log","",$a[$i]);
- $dat_user[]=$a[$i];
- $dat_status[]=$data[4];
- }}
- arsort($dat_user);
- foreach($dat_status as $k=>$v){
- $gg++;
- $text = @file("$maindir/forum/data/users/".check($dat_user[$k]).".log");
- if ($text!=""){ $dt = explode("|",$text[0]);
- // deleting
- if(isset($del)){
- $del=full_check($del);
- if($m_level=="1" || $m_level=="2"){
- if(empty($user)){$user=$login;}
- $user=check($user);
- $text = @file("$maindir/forum/data/users/".check($user).".log");
- if ($text!=""){ $dt = explode("|",$text[0]); }
- if($user=="$login" || $dt[5]=="2"){
- echo'Невозможно удалить</div></div>';
- include_once "../../css/red/foot.php"; exit; }
- if(!file_exists("$maindir/forum/data/users/".check($user).".log")){
- echo'Пользователя '.check($user).' не существует!</div></div>';
- include_once "../../css/red/foot.php"; exit; }
- echo'Вы уверены что хотите удалить <a href="anketa.php?user='.check($user).'"><b>'.check($user).'</b></a> ?<br>
- [<a href="adminlist.php?yesdel&user='.check($user).'">Да</a>] [<a href="adminlist.php?'.SID.'">Нет</a>]</div></div>';
- include_once "../../css/red/foot.php"; exit; }else{
- echo'Идите нахуй</div></div>'; include_once "../../css/red/foot.php"; exit; }}
- if(isset($yesdel)){
- $yesdel=full_check($yesdel);
- if($m_level=="1" || $m_level=="2"){
- if($user=="$login" || $dt[5]=="2"){
- echo'Невозможно удалить</div></div>';
- include_once "../../css/red/foot.php"; exit; }
- @unlink("$maindir/forum/data/users/".check($user).".log");
- @unlink("$maindir/forum/data/privat/".check($user).".dat");
- echo''.check($user).' был успешно удален!</div></div>';
- include_once "../../css/red/foot.php"; exit;
- }else{
- echo'Идите нахуй</div></div>';
- include_once "../../css/red/foot.php"; exit; }} // end
- if($dt[5]!=""){
- $status=$dt[5];
- $status=check($status);
- if($status=="1"){ $status="Админ";}
- if($status=="2"){ $status="Админ";}
- if($status=="3"){ $status="Модер";}
- echo ''.check($gg).'. <a href="anketa.php?user='.check($dat_user[$k]).'&'.SID.'"> '.check($dat_user[$k]).' </a>
- [ '.$status.' ]<br>';
- $text = @file("$maindir/forum/data/users/$login.log");
- if ($text!=""){ $m_level = explode("|",$text[0]);}
- if($m_level[5]=="1"){
- echo '<a href="userchange.php?change&user='.check($dat_user[$k]).'">Изменить</a> | <a href="adminlist.php?del&user='.check($dat_user[$k]).'">Удалить</a><br></div></div>';
- }}}}
- include_once "../../css/red/foot.php";
- } else { header ("Location: ../index.php"); }
- } else { header ("Location: ../index.php"); }
- ?>