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

Размер файла: 4.88Kb
  1. <?php
  2. /*
  3. =============================================
  4. Движок: SHCMS Engine
  5. =============================================
  6. Название файла: SHCMS Engine Информация о системе
  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 Информация о системе';
  14. include_once'../template/head.php';
  15. registrat();
  16. $adminka ->admin();
  17.  
  18. $user4 = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$user_id'"));
  19. if($user4['team'] < 6)
  20. {
  21. echo 'Ошибка';
  22. header('Refresh: 1; url=/index.php?'.$conservation.'&');
  23. include_once'../template/foot.php';
  24. exit();
  25. }
  26. include_once'secu.php';
  27.  
  28.  
  29.  
  30.  
  31. echo '<div class="maintitle"><strong>Информация о Системе</strong></div>';
  32. echo '<div class="maintext">';
  33. $status = phpversion() < '5.1' ? '<font color=red><b>Нет</b></font>' : '<font color=green><b>Да</b></font>';
  34. echo 'Версия PHP 5.1 и выше -> '.$status.'<br/><hr/>';
  35. $status = function_exists('mysql_connect') ? '<font color=green><b>Да</b></font>' : '<font color=red><b>Нет</b></font>';;
  36. echo ' MySQL -> '.$status.'<br/><hr/>';
  37. $status = extension_loaded('xml') ? '<font color=green><b>Да</b></font>' : '<font color=red><b>Нет</b></font>';
  38. echo 'XML -> '.$status.'<br/><hr/>';
  39. $status = function_exists('iconv') ? '<font color=green><b>Да</b></font>' : '<font color=red><b>Нет</b></font>';
  40. echo 'Iconv - >'.$status.' <hr/>';
  41. $status = extension_loaded('zlib') ? '<font color=green><b>Да</b></font>' : '<font color=red><b>Нет</b></font>';
  42. echo 'Сжатия ZLib - >'.$status.' <hr/>';
  43. $status = ini_get('session.auto_start') ? '<font color=red><b>Включено</b></font>' : '<font color=green><b> Отключено</b></font>';
  44. echo 'session auto start - >'.$status.' <hr/>';
  45.  
  46. $status = ini_get('register_globals') ? '<font color=red><b>Включено</b></font>' : '<font color=green><b>Выключено</b></font>';
  47.  
  48.  
  49. echo '</div>';
  50.  
  51.  
  52. echo '</div><div class="maintitle"><strong>Информация о CHMOD</strong></div>';
  53.  
  54. echo '<div class="maintext">';
  55.  
  56. echo <<<HTML
  57. <table width="100%">
  58. <tr>
  59. HTML;
  60. echo"<tr>
  61. <td height=\"25\">&nbsp;Папка</td>
  62. <td width=\"100\" height=\"25\">&nbsp;Права</td>
  63. <td width=\"100\" height=\"25\">&nbsp;Статус</td></tr>";
  64. $important_files = array(
  65. '../system/tmp/',
  66. '../system/inc/',
  67. '../template/designs/',
  68. '../download/files_obmen/',
  69. '../download/screen/',
  70. '../download/icons/',
  71. '../forum/icon/icon_cat/',
  72. '../forum/icon/icon_razd/',
  73. '../avatar/files/',
  74. '../photo/files/',
  75. '../system/thumbs/',
  76. );
  77. $chmod_errors = 0;
  78. $not_found_errors = 0;
  79. foreach($important_files as $file){
  80.  
  81. if(!file_exists($file)){
  82. $file_status = "<font color=red>не найдено</font>";
  83. $not_found_errors ++;
  84. }
  85. elseif(is_writable($file)){
  86. $file_status = "<font color=green>разрешено</font>";
  87. }
  88. else{
  89. @chmod($file, 0777);
  90. if(is_writable($file)){
  91. $file_status = "<font color=green>разрешено</font>";
  92. }else{
  93. @chmod("$file", 0755);
  94. if(is_writable($file)){
  95. $file_status = "<font color=green>разрешено</font>";
  96. }else{
  97. $file_status = "<font color=red>запрещено</font>";
  98. $chmod_errors ++;
  99. }
  100. }
  101. }
  102. $chmod_value = @decoct(@fileperms($file)) % 1000;
  103. echo"<tr><td height=\"22\">&nbsp;$file</td>
  104. <td>&nbsp; $chmod_value</td>
  105. <td>&nbsp; $file_status</td>
  106. </tr>";
  107. }
  108. if($chmod_errors == 0 and $not_found_errors == 0){
  109. $status_report = '<div class="mysql_yes">Все необходимы права на запись у вас имеются!</div>';
  110. }else{
  111. if($chmod_errors > 0){
  112. $status_report = "<div class='mysql_no'><font color=red>Внимание!!!</font><br /><br />
  113. Во время проверки обнаружены ошибки: <b>$chmod_errors</b>. Запрещена запись в файл.<br />
  114. Вы должны выставить для папок CHMOD 777, для файлов CHMOD 666, используя ФТП-клиент.<br /></div>
  115. ";
  116. }
  117. if($not_found_errors > 0){
  118. $status_report .= "<div class='mysql_no'><font color=red>Внимание!!!</font>
  119. <br />Во время проверки обнаружены ошибки: <b>$not_found_errors</b>. Файлы не найдены!<br />
  120. </div>";}
  121. }
  122. echo"<tr><td style=\"padding: 5px\" colspan=3>$status_report</td>
  123. </tr>";
  124.  
  125. echo <<<HTML
  126.  
  127.  
  128. </tr>
  129. </table></div>
  130. HTML;
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137. include_once'../template/foot.php';
  138. ?>