Просмотр файла forum/admin/adminlist.php

Размер файла: 3.91Kb
  1. <?php
  2. // автор скрипта - Arab
  3. // icq - 9988817 сайт: http://bola.net.ru
  4. Error_Reporting(E_ALL & ~E_NOTICE);
  5. Error_Reporting (ERROR | WARNING);
  6.  
  7. include_once "../includ/functions.php";
  8. include_once "../includ/login.php";
  9. include_once "../includ/setting.php";
  10. include_once "../includ/online.php";
  11.  
  12. if (!$_SESSION[login]=="" && !md5($_SESSION[password])=="" && md5($_SESSION[password])==$npassword && $_SESSION[login]==$nlogin){
  13. if($m_level=="1" || $m_level=="2"){
  14. include_once "../../css/red/index.php";
  15.  
  16. echo'<div class="agr"><center><b>Администрация</b></center></div><div class="bgr"><div class="url">';
  17. echo'Привет '.$login.'<br>';
  18. echo'<a href="../login/menu.php?'.SID.'">Личное меню</a> | <a href="../forum/?'.SID.'">Форум</a><hr>';
  19. if($privat>0){ echo'<a href="privat.php?'.SID.'">
  20. <img src="../images/mail.gif" alt=""> <font color="#ff2222"><b>Новое сообщение - ('.$privat.')</b></font></a><br>'; }
  21.  
  22.  
  23.  
  24. $dir = opendir ("$maindir/forum/data/users");
  25. while ($file = readdir ($dir))
  26. {if (ereg (".log$", $file))
  27. {$a[]=$file;}}
  28. closedir ($dir);
  29. $total = count($a);
  30.  
  31. for ($i = 0; $i < $total; $i++){
  32. $tex = file("$maindir/forum/data/users/".check($a[$i])."");
  33. $data = explode("|",$tex[0]);
  34. if($data[5]>=1 && $data[5]<=2){
  35. $a[$i]=str_replace(".log","",$a[$i]);
  36. $dat_user[]=$a[$i];
  37. $dat_status[]=$data[4];
  38. }}
  39.  
  40. arsort($dat_user);
  41. foreach($dat_status as $k=>$v){
  42. $gg++;
  43.  
  44. $text = @file("$maindir/forum/data/users/".check($dat_user[$k]).".log");
  45. if ($text!=""){ $dt = explode("|",$text[0]);
  46.  
  47. // deleting
  48. if(isset($del)){
  49. $del=full_check($del);
  50. if($m_level=="1" || $m_level=="2"){
  51.  
  52. if(empty($user)){$user=$login;}
  53. $user=check($user);
  54. $text = @file("$maindir/forum/data/users/".check($user).".log");
  55. if ($text!=""){ $dt = explode("|",$text[0]); }
  56.  
  57. if($user=="$login" || $dt[5]=="2"){
  58. echo'Невозможно удалить</div></div>';
  59. include_once "../../css/red/foot.php"; exit; }
  60.  
  61. if(!file_exists("$maindir/forum/data/users/".check($user).".log")){
  62. echo'Пользователя '.check($user).' не существует!</div></div>';
  63. include_once "../../css/red/foot.php"; exit; }
  64.  
  65. echo'Вы уверены что хотите удалить <a href="anketa.php?user='.check($user).'"><b>'.check($user).'</b></a> ?<br>
  66. [<a href="adminlist.php?yesdel&user='.check($user).'">Да</a>] [<a href="adminlist.php?'.SID.'">Нет</a>]</div></div>';
  67. include_once "../../css/red/foot.php"; exit; }else{
  68. echo'Идите нахуй</div></div>'; include_once "../../css/red/foot.php"; exit; }}
  69.  
  70. if(isset($yesdel)){
  71. $yesdel=full_check($yesdel);
  72. if($m_level=="1" || $m_level=="2"){
  73.  
  74. if($user=="$login" || $dt[5]=="2"){
  75. echo'Невозможно удалить</div></div>';
  76. include_once "../../css/red/foot.php"; exit; }
  77.  
  78. @unlink("$maindir/forum/data/users/".check($user).".log");
  79. @unlink("$maindir/forum/data/privat/".check($user).".dat");
  80. echo''.check($user).' был успешно удален!</div></div>';
  81. include_once "../../css/red/foot.php"; exit;
  82. }else{
  83. echo'Идите нахуй</div></div>';
  84. include_once "../../css/red/foot.php"; exit; }} // end
  85.  
  86. if($dt[5]!=""){
  87. $status=$dt[5];
  88. $status=check($status);
  89. if($status=="1"){ $status="Админ";}
  90. if($status=="2"){ $status="Админ";}
  91. if($status=="3"){ $status="Модер";}
  92.  
  93. echo ''.check($gg).'. <a href="anketa.php?user='.check($dat_user[$k]).'&amp;'.SID.'"> '.check($dat_user[$k]).' </a>
  94. [ '.$status.' ]<br>';
  95.  
  96. $text = @file("$maindir/forum/data/users/$login.log");
  97. if ($text!=""){ $m_level = explode("|",$text[0]);}
  98.  
  99. if($m_level[5]=="1"){
  100. 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>';
  101. }}}}
  102.  
  103. include_once "../../css/red/foot.php";
  104. } else { header ("Location: ../index.php"); }
  105. } else { header ("Location: ../index.php"); }
  106.  
  107. ?>