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

Размер файла: 3.9Kb
  1. <?php
  2. // автор скрипта - Arab
  3. // icq - 9988817 сайт: http://bola.net.ru
  4.  
  5. include_once "../includ/functions.php";
  6. include_once "../includ/login.php";
  7. include_once "../includ/setting.php";
  8. include_once "../includ/online.php";
  9.  
  10. if (!$_SESSION[login]=="" && !md5($_SESSION[password])=="" && md5($_SESSION[password])==$npassword && $_SESSION[login]==$nlogin){
  11. if($m_level=="1" || $m_level=="2"){
  12. include_once "../../css/red/index.php";
  13.  
  14. echo'<div class=agr><center><b>Доступность сайта</b></center></div><div class=bgr><div class=url>';
  15.  
  16. if(isset($save)){
  17. $save=full_check($save);
  18. $site=check($site);
  19. $regis=check($regis);
  20. $forumx=check($forumx);
  21. $forum_upl=check($forum_upl);
  22.  
  23. $text = @file("$maindir/forum/data/mainconf.dat");
  24. if ($text!=""){
  25. $udata = explode("|",$text[0]);}
  26.  
  27. $text=$site.'|'.$regis.'|'.$forumx.'|'.$udata[3].'|'.$udata[4].'|'.$udata[5].'|'.$udata[6].'|'.$forum_upl.'|'.$udata[8].'|'.$udata[9].'|'.$udata[10].'|'.$udata[11].'|'.$udata[12].'|'.$udata[13].'|'.$udata[14].'|'.$udata[15].'|'.$udata[16].'|'.$udata[17].'|';
  28. $text=str_replace("\r\n", "", $text);
  29.  
  30. $fp=fopen("$maindir/forum/data/mainconf.dat","r+");
  31. flock($fp,LOCK_EX);
  32. ftruncate($fp,0);
  33. fputs($fp,"$text");
  34. fflush($fp);
  35. flock($fp,LOCK_UN);
  36. fclose($fp);
  37.  
  38. echo'Настройки сохранены!</div></div>';
  39. include_once "../../css/red/foot.php"; exit; }
  40.  
  41. // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  42.  
  43. $text = @file("$maindir/forum/data/mainconf.dat");
  44. if ($text!=""){ $id = explode("|",$text[0]);}
  45.  
  46. echo'<b>Авторизация:</b>
  47. <form method="post" action="onoff.php?save">';
  48. echo'Открыта<br>';
  49. if($id[0]=="0"){
  50. echo'<input name="site" type="radio" value="0" checked>';}else{echo'<input name="site" type="radio" value="0">';}
  51. echo'<br>Закрыта<br>';
  52. if($id[0]=="2"){
  53. echo'<input name="site" type="radio" value="2" checked>';}else{echo'<input name="site" type="radio" value="2">';}
  54.  
  55. ///////////
  56. echo'<br><br><div class="litegr"><b>Регистрация:</b></div>';
  57. echo'Открыта<br>';
  58. if($id[1]=="1"){
  59. echo'<input name="regis" type="radio" value="1" checked>';}else{echo'<input name="regis" type="radio" value="1">';}
  60. echo'<br>Закрыта<br>';
  61. if($id[1]=="2"){
  62. echo'<input name="regis" type="radio" value="2" checked>';}else{echo'<input name="regis" type="radio" value="2">';}
  63.  
  64. ///////////
  65. echo'<br><br><div class="litegr"><b>Форум:</b></div>';
  66. echo'Открыт только для администрации<br>';
  67. if($id[2]=="0"){
  68. echo'<input name="forumx" type="radio" value="0" checked>';}else{echo'<input name="forumx" type="radio" value="0">';}
  69. echo'<br>Открыт регистрированным<br>';
  70. if($id[2]=="1"){
  71. echo'<input name="forumx" type="radio" value="1" checked>';}else{echo'<input name="forumx" type="radio" value="1">';}
  72. echo'<br>Открыт всем<br>';
  73. if($id[2]=="2"){
  74. echo'<input name="forumx" type="radio" value="2" checked>';}else{echo'<input name="forumx" type="radio" value="2">';}
  75.  
  76. ///////////
  77. echo'<br><br><div class="litegr"><b>Выгрузка файлов на форум:</b></div>';
  78. echo'Закрыта для всех<br>';
  79. if($id[7]=="0"){
  80. echo'<input name="forum_upl" type="radio" value="0" checked>';}else{echo'<input name="forum_upl" type="radio" value="0">';}
  81. echo'<br>Только админам<br>';
  82. if($id[7]=="1"){
  83. echo'<input name="forum_upl" type="radio" value="1" checked>';}else{echo'<input name="forum_upl" type="radio" value="1">';}
  84. echo'<br>Всем пользователям<br>';
  85. if($id[7]=="2"){
  86. echo'<input name="forum_upl" type="radio" value="2" checked>';}else{echo'<input name="forum_upl" type="radio" value="2">';}
  87.  
  88. echo'<br><input value="Cохранить" type="submit"></form><br></div></div>';
  89.  
  90. include_once "../../css/red/foot.php";
  91.  
  92. } else { header ("Location: ../index.php"); }
  93. } else { header ("Location: ../index.php"); }
  94.  
  95. ?>