Просмотр файла admin_list/chmod.php

Размер файла: 3.53Kb
  1. <?php
  2. /*
  3. =============================================
  4. Движок: SHCMS Engine
  5. =============================================
  6. Название файла: Настройка навигации страниц.
  7. =============================================
  8. Official website: http://shcms.ru
  9. =============================================
  10. */
  11. define('SHCMS', true);
  12. include_once'../system/inc/basic_settings.php';
  13. $shcmsengine['title'] = 'SHCMS Engine Проверка CHMOD.';
  14. include_once'../template/head.php';
  15. registrat();
  16. $user4 = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id= $user_id"));
  17. if($user4['team'] < 6)
  18. {
  19. echo 'Ошибка';
  20. header('Refresh: 1; url=/index.php?'.$conservation.'&');
  21. include_once'../template/foot.php';
  22. exit();
  23. }
  24. include_once'secu.php';
  25. echo <<<HTML
  26. <div style="padding-top:5px;">
  27. <table width="100%"><tr><table width="100%">
  28. HTML;
  29. echo"<tr>
  30. <td height=\"25\">&nbsp;Папка
  31. <td width=\"100\" height=\"25\">&nbsp;Права
  32. <td width=\"100\" height=\"25\">&nbsp;Статус</tr><tr><td colspan=3><div class=\"hr_line\"></div><hr/></td></tr>";
  33. $important_files = array(
  34. '../system/tmp/',
  35. '../template/',
  36. '../download/files_obmen/',
  37. '../download/icons/',
  38. '../avatar/files/',
  39. '../template/shcms/',
  40. '../system/thumbs/',
  41. );
  42. $chmod_errors = 0;
  43. $not_found_errors = 0;
  44. foreach($important_files as $file){
  45.  
  46. if(!file_exists($file)){
  47. $file_status = "<font color=red>не найдено</font>";
  48. $not_found_errors ++;
  49. }
  50. elseif(is_writable($file)){
  51. $file_status = "<font color=green>разрешено</font>";
  52. }
  53. else{
  54. @chmod($file, 0777);
  55. if(is_writable($file)){
  56. $file_status = "<font color=green>разрешено</font>";
  57. }else{
  58. @chmod("$file", 0755);
  59. if(is_writable($file)){
  60. $file_status = "<font color=green>разрешено</font>";
  61. }else{
  62. $file_status = "<font color=red>запрещено</font>";
  63. $chmod_errors ++;
  64. }
  65. }
  66. }
  67. $chmod_value = @decoct(@fileperms($file)) % 1000;
  68. echo"<tr><td height=\"22\" class=\"tableborder main\">&nbsp;$file</td>
  69. <td>&nbsp; $chmod_value</td>
  70. <td>&nbsp; $file_status</td>
  71. </tr><tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=3></td></tr>";
  72. }
  73. if($chmod_errors == 0 and $not_found_errors == 0){
  74. $status_report = '<div class="mysql_yes">Все необходимы права на запись у вас имеются!</div>';
  75. }else{
  76. if($chmod_errors > 0){
  77. $status_report = "<div class='mysql_no'><font color=red>Внимание!!!</font><br /><br />
  78. Во время проверки обнаружены ошибки: <b>$chmod_errors</b>. Запрещена запись в файл.<br />
  79. Вы должны выставить для папок CHMOD 777, для файлов CHMOD 666, используя ФТП-клиент.<br /><br />
  80. ";
  81. }
  82. if($not_found_errors > 0){
  83. $status_report .= "<div class='mysql_no'><font color=red>Внимание!!!</font>
  84. <br />Во время проверки обнаружены ошибки: <b>$not_found_errors</b>. Файлы не найдены!<br />
  85. </div>";}
  86. }
  87. echo"<tr><td style=\"padding: 5px\" colspan=3>$status_report</td>
  88. </tr><tr></tr>";
  89.  
  90. echo <<<HTML
  91. </table>
  92. </td></tr>
  93. </table></div>
  94.  
  95. HTML;
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102. include_once'../template/foot.php';
  103.  
  104. ?>