-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[From China] elFinder 2.0 How to add an extra root #98
Comments
Simple. Just "mount" another set of driver and name it "LocalFileSystem" on your opts inside connector.php Example: <?php
$opts = array(
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => 'path/to/files/root', // path to files (REQUIRED)
'URL' => 'http://www.localhost.com/files/root/', // URL to files (REQUIRED)
'alias' => 'Root',
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
),
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => 'path/to/files/second_root', // path to files (REQUIRED)
'URL' => 'http://www.localhost.com/files/second_root/', // URL to files (REQUIRED)
'alias' => 'Secondary Root',
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
); |
Very grateful "Gamerz" Help, I've added a second root directory. Thanks Google Translate |
Just assign an For example, you would like to lock out the "TEST" Folder inside the "Main Root" root, you would do this: <?php
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => 'path/to/files/main_root', // path to files (REQUIRED)
'accessControl' => 'access', // disable and hide dot starting files (OPTIONAL)
'attributes' => array(
array(
'pattern' => '/\TEST$/', //You can also set permissions for file types by adding, for example, <b>.jpg</b> inside pattern.
'read' => false,
'write' => false,
'locked' => true
)
)
), You can set the following true/false to the attributes:
Hope this helped! |
This must be added to Wiki, please help us https://github.com/Studio-42/elFinder/wiki/Multiple-roots |
Haha, thanks Troex for adding the code view. I was actually trying to find the code format, but never actually got it. EDIT: The two wikis has now been fully completed. |
However, if only to set permissions on a directory. |
I'm not understanding? What are you trying to do? |
No, now very satisfied. 'accessControl' => 'upfile' // disable and hide dot starting files (OPTIONAL) Thank you for your help. Also, put a proposal: I was doing. function access($attr, $path, $data, $volume) {
} |
imdong, "anonymous" or "user" is that what you need to do yourself, what you have done is a right way also. |
I assume this issue as fixed |
Anyone can upload files, including the shell. I made a simple login authentication. |
Better to use in elFinderVolumeDriver.class.php |
I have a really thick question, but how do I disable Deleting/Renaming the first level of folders in root? For Example if my root path is path/to/files then I want to prevent the user from being able to delete/rename the first level of folders after the root path/to/files/first_level_folder, but the user should be able to have full control inside the path/to/files/first_level_folder/Subfolders. I tried doing:
But it has no effect whatsoever - i can still delete and rename first level folders. Am i missing the point completely as always? Thank you for your time. |
@uFlock try '/^.+/' for your pattern EDIT - hmm this seems to effect all files. Not sure how to target folders, unless you target their specific name? |
Thank you elFinder, it is useful, I like it.
However, I have a question, like to seek your help.
How can the same as your demo site, it adds a second root directory.
http://elfinder.org/
I hope there is a private, public display.
The other is free to upload.
Appreciate your help.
If you can, I hope that the answer can be more detailed.
汉语:
很感谢您的elFinder,它很好用,我很喜欢它。
但是,我有一个疑问,像寻求您的帮助。
如何才能像您的演示站点一样,为它添加第二个根目录。
我希望有一个是私用,公开展示的。
另一个是自由上传的。
很感谢您的帮助。
如果可以,我希望答案可以详细一些。
Thanks Google Translate
The text was updated successfully, but these errors were encountered: