mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
chmod command
This commit is contained in:
@@ -127,7 +127,8 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
'read' => false,
|
||||
'write' => false,
|
||||
'locked' => true,
|
||||
'hidden' => true
|
||||
'hidden' => true,
|
||||
'chmod' => false
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -334,6 +335,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
$stat['mime'] = 'symlink-broken';
|
||||
$stat['read'] = false;
|
||||
$stat['write'] = false;
|
||||
$stat['chmod'] = 0;
|
||||
$stat['size'] = 0;
|
||||
return $stat;
|
||||
}
|
||||
@@ -367,6 +369,13 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
$stat['read'] = is_readable($path)? null : false;
|
||||
$stat['write'] = is_writable($path)? null : false;
|
||||
|
||||
if( function_exists('posix_geteuid') && posix_geteuid() == $uid ) {
|
||||
$stat['chmod'] = 1;
|
||||
}
|
||||
else {
|
||||
$stat['chmod'] = 0;
|
||||
}
|
||||
|
||||
if (is_null($stat['read'])) {
|
||||
$stat['size'] = $dir ? 0 : $size;
|
||||
}
|
||||
@@ -635,6 +644,16 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* chmod availability
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
protected function _chmod($path, $mode) {
|
||||
$modeOct = is_string($mode) ? octdec($mode) : octdec(sprintf("%04o",$mode));
|
||||
chmod($path, $modeOct);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack archive
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user