Файл: pages/panel/index.php
Строк: 53
<?php
include '../../system/mysql.php';
include '../../system/sys_func.php';
if ($user['position'] != 'admin') {
    $title = 'Кабинет/Ошибка';
    include '../../system/head.php';
    echo '<div class="err">У вас недостаточно прав!</div>';
    include '../../system/foot.php';
    exit;
}
$menu = (isset($_GET['menu'])?htmlspecialchars($_GET['menu']):false);
switch ($menu) {
    default:
$title = 'Кабинет/Админ-панель';
include '../../system/head.php';
echo '<div class="title"><a href="/pages/personal/">Кабинет</a> / Админ-панель</div>';
echo '
<a class="link" href="rekl.php">Управление рекламой</a>
<a class="link" href="?menu=info_cms">Информация по CMS</a>
<a class="link" href="/pages/personal/"><img src="/design/imgs/arr_b.png" align="center"> Кабинет</a>';
    break;
case 'info_cms':
    $title = 'Кабинет/Информация по CMS';
    include '../../system/head.php';
    echo '<div class="title"><a href="/pages/personal/">Кабинет</a> / <a href="/pages/panel/">Админ-панель</a></div>';
echo '<div class="post">Версия PeasCMS '.$HOME['Sversion'].'</div>';
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 '<div class="err">'. $err .' : ' . $show_df . ' : [' . $f_chmod1 . $f_chmod2 . $f_chmod3 . '] - > ' . $n_chmod1 . $n_chmod2 . $n_chmod3 . '</div>';
    }
    else
    {
        echo '<div class="post">' . $show_df . ' (' . $n_chmod1 . $n_chmod2 . $n_chmod3 . ') : ' . 
        $f_chmod1 . $f_chmod2 . $f_chmod3 . ' <b>(ok)</b></div>';
    }
}
test_chmod(H.'files/',777);
test_chmod(H.'files/avatars/',777);
test_chmod(H.'files/diaries/',777);
test_chmod(H.'files/user.files/',777);
test_chmod(H.'files/user.files.screen/',777);
    break;
}
include '../../system/foot.php';
?>