Пример #1
0
// }
$fm = new Filemanager();
$response = '';
if (!auth()) {
    $fm->error($fm->lang('AUTHORIZATION_REQUIRED'));
}
if (!isset($_GET)) {
    $fm->error($fm->lang('INVALID_ACTION'));
} else {
    if (isset($_GET['mode']) && $_GET['mode'] != '') {
        switch ($_GET['mode']) {
            default:
                $fm->error($fm->lang('MODE_ERROR'));
                break;
            case 'getinfo':
                if ($fm->getvar('path')) {
                    $response = $fm->getinfo();
                }
                break;
            case 'getfolder':
                if ($fm->getvar('path')) {
                    $response = $fm->getfolder();
                }
                break;
            case 'rename':
                if ($fm->getvar('old') && $fm->getvar('new')) {
                    $response = $fm->rename();
                }
                break;
            case 'delete':
                if ($fm->getvar('path')) {
Пример #2
0
$fm->setFileRoot($SUB_FOLDER . $config['rel_path']);
#NETCAT END
$response = '';
if (!auth()) {
    $fm->error($fm->lang('AUTHORIZATION_REQUIRED'));
}
if (!isset($_GET)) {
    $fm->error($fm->lang('INVALID_ACTION'));
} else {
    if (isset($_GET['mode']) && $_GET['mode'] != '') {
        switch ($_GET['mode']) {
            default:
                $fm->error($fm->lang('MODE_ERROR'));
                break;
            case 'getinfo':
                if ($fm->getvar('path')) {
                    $response = $fm->getinfo();
                }
                break;
            case 'getfolder':
                if ($fm->getvar('path')) {
                    $response = $fm->getfolder();
                }
                break;
            case 'rename':
                if ($fm->getvar('old') && $fm->getvar('new')) {
                    $response = $fm->rename();
                }
                break;
            case 'move':
                // allow "../"