aboutsummaryrefslogtreecommitdiff
path: root/src/globals.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/globals.php')
-rwxr-xr-xsrc/globals.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/globals.php b/src/globals.php
index d49a3c7..6c51f41 100755
--- a/src/globals.php
+++ b/src/globals.php
@@ -43,8 +43,11 @@ function filedownload($oid,$fname,$msg='') {
function dirrec($dir, $user, $group, $dirPermissions, $filePermissions, $avoid=array()) {
$ds = DIRECTORY_SEPARATOR;
if($ds=="") $ds = "/";
- if(chown($dir, $user) === false) echo "cannot chown $dir\n";
- if(chgrp($dir, $group) === false) echo "cannot chgrp $dir\n";
+ $t = myunique();
+ rename($dir, $dir . '.tmp' . $t);
+ rename($dir . '.tmp' . $t, $dir);
+ //if(chown($dir, $user) === false) echo "cannot chown $dir\n";
+ //if(chgrp($dir, $group) === false) echo "cannot chgrp $dir\n";
if(is_dir($dir)) {
if(chmod($dir, $dirPermissions) === false) echo "cannot chmod $dir\n";
if(($dp = opendir($dir)) === false) return;