Search code examples
elfinder

prevent mkdir in Elfinder


Im trying to disable the mkdir-option in elfinder. I just want uploads in my (root)-folder allowed. The following solution does not disable the mkdir option (even I removed the mkdir). Any hints?

tinyMCE.activeEditor.windowManager.open({
file : 'elfinder/elfinder.html',
        title : 'elFinder 2.0',
        width : 950,  
        height : 630,
        resizable : "yes",

    uiOptions: {
        toolbar : [
            // toolbar configuration
            ['open'],
            ['back', 'forward'],
            ['reload'],
            ['home', 'up'],
            ['mkfile', 'upload'],
            ['info'],
            ['quicklook'],
            ['copy', 'cut', 'paste'],
            ['rm'],
            ['duplicate', 'rename', 'edit'],
            ['extract', 'archive'],
            ['search'],
            ['view'],
            ['help']
        ]
    },

   commands : [
    'open', 'reload', 'home', 'up', 'back', 'forward', 'getfile', 'quicklook',
    'download', 'rm', 'duplicate', 'rename', 'mkfile', 'upload', 'copy',
    'cut', 'paste', 'edit', 'extract', 'archive', 'search', 'info', 'view', 'help'
   ],                       
}

Solution

  • Edit the connector.php file and add a key named 'disabled'

        'roots' => array(
                array(
                        'driver'     => 'LocalFileSystem',
                        'path'       => '../../ava/externo/',
                        'startPath'  => '../../ava/externo/',
                        'URL'        => dirname($_SERVER['PHP_SELF']) . '/../../ava/externo',
                        'tmbPath'    => '.tmb',
                        'utf8fix'    => true,
                        'tmbCrop'    => false,
                        'tmbBgColor' => 'transparent',
                        'accessControl' => 'access',
                        'acceptedName'    => '/^[^\.].*$/',
                        'disabled' => array('extract', 'archive', 'mkdir'),
                        'tmbSize' => 128,
                        'attributes' => array(
                                array(
                                        'pattern' => '/^\/icons$/',
                                        'read' => true,
                                        'write' => false
                                ),
                                array(
                                        'pattern' => '/\.php$/',
                                        'hidden' => true,
                                        'read' => false
                                ),
                                array(
                                        'pattern' => '/\.zip$/',
                                        'read' => true,
                                        'write' => true
                                )
                        ),
                        'uploadDeny' => array('text/php')