|
|
|
|
@ -343,35 +343,6 @@ class OC_Helper { |
|
|
|
|
return $bytes; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @brief Recursive editing of file permissions |
|
|
|
|
* @param string $path path to file or folder |
|
|
|
|
* @param int $filemode unix style file permissions |
|
|
|
|
* @return bool |
|
|
|
|
*/ |
|
|
|
|
static function chmodr($path, $filemode) { |
|
|
|
|
if (!is_dir($path)) |
|
|
|
|
return chmod($path, $filemode); |
|
|
|
|
$dh = opendir($path); |
|
|
|
|
if(is_resource($dh)) { |
|
|
|
|
while (($file = readdir($dh)) !== false) { |
|
|
|
|
if ($file != '.' && $file != '..') { |
|
|
|
|
$fullpath = $path . '/' . $file; |
|
|
|
|
if (is_link($fullpath)) |
|
|
|
|
return false; |
|
|
|
|
elseif (!is_dir($fullpath) && !@chmod($fullpath, $filemode)) |
|
|
|
|
return false; elseif (!self::chmodr($fullpath, $filemode)) |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
closedir($dh); |
|
|
|
|
} |
|
|
|
|
if (@chmod($path, $filemode)) |
|
|
|
|
return true; |
|
|
|
|
else |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @brief Recursive copying of folders |
|
|
|
|
* @param string $src source folder |
|
|
|
|
|