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

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);
    
//list($m_chmod1,$m_chmod2,$m_chmod3)=str_split($max_chmod);

    
if ($f_chmod1 < $n_chmod1 || $f_chmod2 < $n_chmod2 || $f_chmod3 < $n_chmod3) {
        
$err[] = "Установите CHMOD $n_chmod1$n_chmod2$n_chmod3 на $show_df";
        echo 
img16('cancel.png') . " $show_df : [$f_chmod1$f_chmod2$f_chmod3] - >$n_chmod1$n_chmod2$n_chmod3<br />n";
    } else {
        echo 
img16('ok.png') . " $show_df ($n_chmod1$n_chmod2$n_chmod3) : $f_chmod1$f_chmod2$f_chmod3 (OK)<br />n";
    }
}

if (
file_exists(H . 'install/')) {
    
test_chmod(H . 'install/', 777);
}
test_chmod(H . 'sys/avatar/', 777);
test_chmod(H . 'sys/ini/', 777);
test_chmod(H . 'sys/classes/', 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/obmen/files/', 777);
test_chmod(H . 'sys/obmen/screens/', 777);
test_chmod(H . 'sys/inc/', 777);
test_chmod(H . 'sys/diary/', 777);
test_chmod(H . 'sys/forum/', 777);
test_chmod(H . 'sys/files/', 777);
test_chmod(H . 'sys/wall/', 777);
test_chmod(H . 'sys/news/', 777);
test_chmod(H . 'sys/fnc/', 777);
test_chmod(H . 'sys/txt/', 777);
test_chmod(H . 'sys/js/', 777);
test_chmod(H . 'sys/update/', 777);
test_chmod(H . 'sys/tmp/', 777);
test_chmod(H . 'style/themes/', 777);
if (
file_exists(H . 'sys/ini/settings.ini')) {
    
test_chmod(H . 'sys/ini/settings.ini', 666);
}
Онлайн: 2
Реклама