Example #1
0
<?php

if (!defined('ACCESS')) {
    die('Not access');
}
$script = function_exists('getenv') ? getenv('SCRIPT_NAME') : $_SERVER['SCRIPT_NAME'];
$script = strpos($script, '/') !== false ? dirname($script) : null;
$script = str_replace('\\', '/', $script);
define('IS_INSTALL_ROOT_DIRECTORY', $script == '.' || $script == '/');
define('IS_ACCESS_FILE_IN_FILE_MANAGER', defined('INDEX') && isset($_GET['not']));
define('DIRECTORY_FILE_MANAGER', strpos($script, '/') !== false ? @substr($script, strrpos($script, '/') + 1) : null);
define('PATH_FILE_MANAGER', str_replace('\\', '/', strtolower($_SERVER['DOCUMENT_ROOT'] . $script)));
define('NAME_DIRECTORY_INSTALL_FILE_MANAGER', !IS_INSTALL_ROOT_DIRECTORY ? preg_replace('#(\\/+|/\\+)(.+?)#s', '$2', $script) : null);
define('PARENT_PATH_FILE_MANAGER', substr(PATH_FILE_MANAGER, 0, strlen(PATH_FILE_MANAGER) - (NAME_DIRECTORY_INSTALL_FILE_MANAGER == null ? 0 : strlen(NAME_DIRECTORY_INSTALL_FILE_MANAGER) + 1)));
if (IS_INSTALL_ROOT_DIRECTORY || IS_ACCESS_FILE_IN_FILE_MANAGER || $script != '.' && $script != '/' && isPathNotPermission(processDirectory($dir)) || $script != '.' && $script != '/' && $name != null && isPathNotPermission(processDirectory($dir . '/' . $name))) {
    define('NOT_PERMISSION', true);
} else {
    define('NOT_PERMISSION', false);
}
if (!defined('INDEX') && !defined('LOGIN') && NOT_PERMISSION) {
    goURL('index.php?not');
}
if (NOT_PERMISSION) {
    $dir = null;
    $dirEncode = null;
}
if ($dir != null) {
    define('IS_ACCESS_PARENT_PATH_FILE_MANAGER', strtolower(processDirectory($dir)) == strtolower(processDirectory(PARENT_PATH_FILE_MANAGER)));
} else {
    define('IS_ACCESS_PARENT_PATH_FILE_MANAGER', strtolower(processDirectory(PARENT_PATH_FILE_MANAGER)) == strtolower(processDirectory($_SERVER['DOCUMENT_ROOT'])));
}
Example #2
0
function moves($entrys, $dir, $path)
{
    foreach ($entrys as $e) {
        $pa = $dir . '/' . $e;
        if (isPathNotPermission(processDirectory($path . '/' . $e))) {
            /* Entry not permission */
        } else {
            if (@is_file($pa)) {
                if (!@copy($pa, $path . '/' . $e)) {
                    return false;
                }
                @unlink($pa);
            } else {
                if (@is_dir($pa)) {
                    if (!movedir($pa, $path)) {
                        return false;
                    }
                } else {
                    return false;
                }
            }
        }
    }
    return true;
}
Example #3
0
         <div class="title">Chức năng</div>
         <ul class="list">
             <li><img src="icon/list.png"/> <a href="index.php' . $pages['paramater_0'] . '">Danh sách</a></li>
         </ul>';
 } else {
     $dir = processDirectory($dir);
     $format = getFormat($name);
     if (isset($_POST['submit'])) {
         echo '<div class="notice_failure">';
         if (empty($_POST['path'])) {
             echo 'Chưa nhập đầy đủ thông tin';
         } else {
             if ($dir == processDirectory($_POST['path'])) {
                 echo 'Đường dẫn mới phải khác đường dẫn hiện tại';
             } else {
                 if (isPathNotPermission(processDirectory($_POST['path']))) {
                     echo 'Bạn không thể sao chép tập tin tới đường dẫn của File Manager';
                 } else {
                     if (!@copy($dir . '/' . $name, processDirectory($_POST['path']) . '/' . $name)) {
                         echo 'Sao chép tập tin thất bại';
                     } else {
                         goURL('index.php?dir=' . $dirEncode . $pages['paramater_1']);
                     }
                 }
             }
         }
         echo '</div>';
     }
     echo '<div class="list">
             <span class="bull">&bull;</span><span>' . printPath($dir . '/' . $name) . '</span><hr/>
             <form action="file_copy.php?dir=' . $dirEncode . '&name=' . $name . $pages['paramater_1'] . '" method="post">
Example #4
0
<?php

define('ACCESS', true);
include_once 'function.php';
$path = isset($_GET['path']) && !empty($_GET['path']) ? rawurldecode($_GET['path']) : null;
if (IS_LOGIN && is_file($path) && isPathNotPermission($path) == false && getimagesize($path) !== false) {
    readfile($path);
} else {
    die('Not read image');
}
Example #5
0
 function callback_pre_extract($event, $header)
 {
     return isPathNotPermission($header['filename']) == false ? 1 : 0;
 }
Example #6
0
 $dir = processDirectory($dir);
 if (isset($_POST['submit'])) {
     echo '<div class="notice_failure">';
     if (empty($_POST['path'])) {
         echo 'Chưa nhập đầy đủ thông tin';
     } else {
         if ($dir == processDirectory($_POST['path'])) {
             echo 'Đường dẫn mới phải khác đường dẫn hiện tại';
         } else {
             if (!is_dir($_POST['path'])) {
                 echo 'Đường dẫn mới không tồn tại';
             } else {
                 if (isPathNotPermission(processDirectory($_POST['path']))) {
                     echo 'Bạn không thể sao chép thư mục tới đường dẫn của File Manager';
                 } else {
                     if (isPathNotPermission(processDirectory($_POST['path'] . '/' . $name))) {
                         echo 'Bạn không thể sao chép thư mục giống tên tới thư mục chứa thư mục của File Manager';
                     } else {
                         if (!copydir($dir . '/' . $name, processDirectory($_POST['path']))) {
                             echo 'Sao chép thư mục thất bại';
                         } else {
                             goURL('index.php?dir=' . $dirEncode . $pages['paramater_1']);
                         }
                     }
                 }
             }
         }
     }
     echo '</div>';
 }
 echo '<div class="list">