Closed imdong closed 13 years ago
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. However, how the two directories should be assigned separate read and write access it?
Thanks Google Translate
Just assign an attributes
array inside the specific mounted driver you would like to set the permissions for.
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:
'read' => true/false,
'write' => true/false,
'locked' => true/false,
'hidden' => true/false
Hope this helped!
This must be added to Wiki, please help us
https://github.com/Studio-42/elFinder/wiki/Multiple-roots https://github.com/Studio-42/elFinder/wiki/Simple-file-permissions-control
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. Hidden .tmd folder. Can not hide Htaccess files?
I'm not understanding? What are you trying to do?
No, now very satisfied. I was doing.
'accessControl' => 'upfile' // disable and hide dot starting files (OPTIONAL)
Thank you for your help.
Also, put a proposal: There should be anonymous and management differences.
I was doing.
function access($attr, $path, $data, $volume) { session_start(); if ($_SESSION['elFinder_login']=="Yes") $Write = "write"; else $Write = "locked";
return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
? !($attr == 'read' || $attr == $Write) // set read+write to false, other (locked+hidden) set to true
: ($attr == 'read' || $attr == $Write); // else set read+write to true, locked+hidden to false
}
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. It was horrible. Prohibit the uploading, I was not convenient to manage files. Should have "visitors" and "administrator" difference. To be a landing.
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:
'attributes' => array(
array(
'pattern' => '/^*/', //You can also set permissions for file types by adding, for example, .jpg inside pattern.
'read' => true,
'write' => false,
'locked' => false,
'hidden' => false
)
)
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