예제 #1
0
    return true;
}
// @todo Work on plugins registration
// if (isset($config['plugin']) && !empty($config['plugin'])) {
// 	$pluginPath = 'plugins' . DIRECTORY_SEPARATOR . $config['plugin'] . DIRECTORY_SEPARATOR;
// 	require_once($pluginPath . 'filemanager.' . $config['plugin'] . '.config.php');
// 	require_once($pluginPath . 'filemanager.' . $config['plugin'] . '.class.php');
// 	$className = 'Filemanager'.strtoupper($config['plugin']);
// 	$fm = new $className($config);
// } else {
// 	$fm = new Filemanager($config);
// }
$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':
예제 #2
0
파일: crop.php 프로젝트: Blu2z/implsk
    }
    include $doc_root . '/vars.inc.php';
    $type = str_replace('.', '', substr($_REQUEST['img'], -4));
    $info = parse_url($_REQUEST['img']);
    parse_str($info['query']);
    $img_src = str_replace('//', '/', $doc_root . $HTTP_FILES_PATH . "userfiles" . $path);
    //$img_src = $doc_root.
    // start netcat & fm
    require_once './inc/filemanager.inc.php';
    #NETCAT START
    require_once 'filemanager.config.php';
    #NETCAT END
    require_once 'filemanager.class.php';
    $fm = new Filemanager();
    if (!auth()) {
        $fm->error($fm->lang('AUTHORIZATION_REQUIRED'));
        return false;
    }
    $x = $_REQUEST['x'];
    $y = $_REQUEST['y'];
    $w = $_REQUEST['w'];
    $h = $_REQUEST['h'];
    $cropped_img = img_helper::crop($img_src, $x, $y, $w, $h);
    if (img_helper::save($cropped_img, $img_src, $type) !== false) {
        // make new thumbnail
        $fm->setFileRoot($SUB_FOLDER . $config['rel_path']);
        $fm->get_thumbnail($img_src, true);
        return true;
    }
}
class img_helper