Размер файла: 3.53Kb
- <?php
- /*
- =============================================
- Движок: SHCMS Engine
- =============================================
- Название файла: Настройка навигации страниц.
- =============================================
- Official website: http://shcms.ru
- =============================================
- */
- define('SHCMS', true);
- include_once'../system/inc/basic_settings.php';
- $shcmsengine['title'] = 'SHCMS Engine Проверка CHMOD.';
- include_once'../template/head.php';
- registrat();
- $user4 = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id= $user_id"));
- if($user4['team'] < 6)
- {
- echo 'Ошибка';
- header('Refresh: 1; url=/index.php?'.$conservation.'&');
- include_once'../template/foot.php';
- exit();
- }
- include_once'secu.php';
- echo <<<HTML
- <div style="padding-top:5px;">
- <table width="100%"><tr><table width="100%">
- HTML;
- echo"<tr>
- <td height=\"25\"> Папка
- <td width=\"100\" height=\"25\"> Права
- <td width=\"100\" height=\"25\"> Статус</tr><tr><td colspan=3><div class=\"hr_line\"></div><hr/></td></tr>";
- $important_files = array(
- '../system/tmp/',
- '../template/',
- '../download/files_obmen/',
- '../download/icons/',
- '../avatar/files/',
- '../template/shcms/',
- '../system/thumbs/',
- );
- $chmod_errors = 0;
- $not_found_errors = 0;
- foreach($important_files as $file){
-
- if(!file_exists($file)){
- $file_status = "<font color=red>не найдено</font>";
- $not_found_errors ++;
- }
- elseif(is_writable($file)){
- $file_status = "<font color=green>разрешено</font>";
- }
- else{
- @chmod($file, 0777);
- if(is_writable($file)){
- $file_status = "<font color=green>разрешено</font>";
- }else{
- @chmod("$file", 0755);
- if(is_writable($file)){
- $file_status = "<font color=green>разрешено</font>";
- }else{
- $file_status = "<font color=red>запрещено</font>";
- $chmod_errors ++;
- }
- }
- }
- $chmod_value = @decoct(@fileperms($file)) % 1000;
- echo"<tr><td height=\"22\" class=\"tableborder main\"> $file</td>
- <td> $chmod_value</td>
- <td> $file_status</td>
- </tr><tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=3></td></tr>";
- }
- if($chmod_errors == 0 and $not_found_errors == 0){
- $status_report = '<div class="mysql_yes">Все необходимы права на запись у вас имеются!</div>';
- }else{
- if($chmod_errors > 0){
- $status_report = "<div class='mysql_no'><font color=red>Внимание!!!</font><br /><br />
- Во время проверки обнаружены ошибки: <b>$chmod_errors</b>. Запрещена запись в файл.<br />
- Вы должны выставить для папок CHMOD 777, для файлов CHMOD 666, используя ФТП-клиент.<br /><br />
- ";
- }
- if($not_found_errors > 0){
- $status_report .= "<div class='mysql_no'><font color=red>Внимание!!!</font>
- <br />Во время проверки обнаружены ошибки: <b>$not_found_errors</b>. Файлы не найдены!<br />
- </div>";}
- }
- echo"<tr><td style=\"padding: 5px\" colspan=3>$status_report</td>
- </tr><tr></tr>";
-
- echo <<<HTML
- </table>
- </td></tr>
- </table></div>
-
- HTML;
-
-
-
-
-
-
- include_once'../template/foot.php';
-
- ?>