summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-04-16 10:23:15 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-04-16 10:23:15 +0200
commit69289bf9438f11df8d75fd034776983b997aa7b0 (patch)
tree31a378c0c5991e76263e7f568aa25d88d6bb3d18 /lib/base.php
parent26841884af8ca6b1c02ca047b7ffe35900701754 (diff)
downloadnextcloud-server-69289bf9438f11df8d75fd034776983b997aa7b0.tar.gz
nextcloud-server-69289bf9438f11df8d75fd034776983b997aa7b0.zip
move chmodr to OC_HELPER
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php27
1 files changed, 2 insertions, 25 deletions
diff --git a/lib/base.php b/lib/base.php
index 9df61da78c3..c84d61b3214 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -256,7 +256,7 @@ class OC_UTIL {
}
$prems=substr(decoct(fileperms($CONFIG_DATADIRECTORY_ROOT)),-3);
if(substr($prems,-1)!='0'){
- chmodr($CONFIG_DATADIRECTORY_ROOT,0770);
+ OC_HELPER::chmodr($CONFIG_DATADIRECTORY_ROOT,0770);
clearstatcache();
$prems=substr(decoct(fileperms($CONFIG_DATADIRECTORY_ROOT)),-3);
if(substr($prems,2,1)!='0'){
@@ -266,7 +266,7 @@ class OC_UTIL {
if($CONFIG_ENABLEBACKUP){
$prems=substr(decoct(fileperms($CONFIG_BACKUPDIRECTORY)),-3);
if(substr($prems,-1)!='0'){
- chmodr($CONFIG_BACKUPDIRECTORY,0770);
+ OC_HELPER::chmodr($CONFIG_BACKUPDIRECTORY,0770);
clearstatcache();
$prems=substr(decoct(fileperms($CONFIG_BACKUPDIRECTORY)),-3);
if(substr($prems,2,1)!='0'){
@@ -349,27 +349,4 @@ class OC_HOOK{
return true;
}
}
-
-function chmodr($path, $filemode) {
-// echo "$path<br/>";
- if (!is_dir($path))
- return chmod($path, $filemode);
- $dh = opendir($path);
- 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(!chmodr($fullpath, $filemode))
- return FALSE;
- }
- }
- closedir($dh);
- if(chmod($path, $filemode))
- return TRUE;
- else
- return FALSE;
-}
?>