Вход Регистрация
Файл: sys/inc/chmod_test.php
Строк: 28
<?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 );
    if ( 
$f_chmod1 < $n_chmod1 || $f_chmod2 < $n_chmod2 || $f_chmod3 < $n_chmod3 ) {
        
$err[] = 'Установите CHMOD ' . $n_chmod1 . $n_chmod2 . $n_chmod3 . ' на ' . $show_df;
        echo 
'<span class="off">' . $show_df . ' : [' . $f_chmod1 . $f_chmod2 . $f_chmod3 . '] - > ' . $n_chmod1 . $n_chmod2 . $n_chmod3 . '</span><br />';
    } else {
        echo 
'<span class="on">' . $show_df . ' (' . $n_chmod1 . $n_chmod2 . $n_chmod3 . ') : ' . $f_chmod1 . $f_chmod2 . $f_chmod3 . ' (ok)</span><br />';
    }
}

test_chmod( H . 'sys/upgrade/', 777 );
test_chmod( H . 'sys/tmp/', 777 );
test_chmod( H . 'style/themes/', 777 );
Онлайн: 3
Реклама