chmod command

This commit is contained in:
David Bartle
2015-06-01 09:17:54 -07:00
committed by nao-pon
parent 9801416cf1
commit 6d93c7ac64
5 changed files with 107 additions and 2 deletions
+20 -1
View File
@@ -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
*