Вход Регистрация
Файл: sys/inc/chmod_test.php
Строк: 46
<?php

/* DCMS S (Special)
 * Версия файла 0.0.1
 * Дата последнего редактирования 21.11.2015
 * Модифицировал densnet
 */

function permissions($filez) {
    return 
decoct(@fileperms("$filez")) % 1000;
}

function 
test_chmod($df, $chmod) {
    global 
$err, $user;
    if (isset(
$user) && $user['level'] == 10) {
        
$show_df = preg_replace('#^' . preg_quote(H) . '#', '/', $df);
    } else {
        
$show_df = $df;
    }


    @list(
$f_chmod1, $f_chmod2, $f_chmod3) = str_split(permissions($df));
    list(
$n_chmod1, $n_chmod2, $n_chmod3) = str_split($chmod);

    if (
$f_chmod1 < $n_chmod1 || $f_chmod2 < $n_chmod2 || $f_chmod3 < $n_chmod3) {
        
$err[] = "Установите CHMOD $n_chmod1$n_chmod2$n_chmod3 на $show_df";
        if (
$f_chmod1 || $f_chmod2 || $f_chmod3 == 0) {
            
$dir = "Нет папки";
        } else {
            
$dir = "Ok";
        }
        echo 
"<span class='label label-danger'> $show_df : [$f_chmod1$f_chmod2$f_chmod3] - >$n_chmod1$n_chmod2$n_chmod3</span><br />n";
    } else {
        echo 
"<span class='label label-success'> $show_df ($n_chmod1$n_chmod2$n_chmod3) : $f_chmod1$f_chmod2$f_chmod3</span><br />n";
    }
}

if (
file_exists(H . 'install/')) {
    
test_chmod(H . 'install/', 777);
}
test_chmod(H . 'sys/ini/', 777);
test_chmod(H . 'sys/classes/', 777);
test_chmod(H . 'sys/inc/', 777);
test_chmod(H . 'sys/obmen/files/', 777);
test_chmod(H . 'sys/obmen/screens/', 777);
test_chmod(H . 'sys/gallery/48/', 777);
test_chmod(H . 'sys/gallery/128/', 777);
test_chmod(H . 'sys/gallery/640/', 777);
test_chmod(H . 'sys/gallery/foto/', 777);
test_chmod(H . 'sys/wall/', 777);
test_chmod(H . 'sys/mail/', 777);
test_chmod(H . 'sys/fnc/', 777);
test_chmod(H . 'sys/txt/', 777);
test_chmod(H . 'sys/update/', 777);
test_chmod(H . 'sys/tmp/', 777);
if (
file_exists(H . 'sys/ini/settings.ini')) {
    
test_chmod(H . 'sys/ini/settings.ini', 666);
}
Онлайн: 2
Реклама