]> git.mjollnir.org Git - moodle.git/commitdiff
Now, when copying files/folders, CFG->directorypermissions is forced
authorstronk7 <stronk7>
Mon, 13 Oct 2003 22:44:41 +0000 (22:44 +0000)
committerstronk7 <stronk7>
Mon, 13 Oct 2003 22:44:41 +0000 (22:44 +0000)
(previously permissions were copied from original)

backup/lib.php

index 4b7f91ba800481aba9a04c9974b2b4ca96cd4522..b2d270fd51f59f9595d9b88ca9116f11822ca20c 100644 (file)
     //Little modifications done
   
     function backup_copy_file ($from_file,$to_file) {
+
+        global $CFG;
+
         if (is_file($from_file)) {
             //echo "<br>Copying ".$from_file." to ".$to_file;              //Debug
-            $perms=fileperms($from_file);
-            return copy($from_file,$to_file) && chmod($to_file,$perms);
+            //$perms=fileperms($from_file);
+            //return copy($from_file,$to_file) && chmod($to_file,$perms);
+            umask(0000);
+            return copy($from_file,$to_file) && chmod($to_file,$CFG->directorypermissions);
         }
         else if (is_dir($from_file)) {
             return backup_copy_dir($from_file,$to_file);
 
         if (!is_dir($to_file)) {
             //echo "<br>Creating ".$to_file;                                //Debug
+            umask(0000);
             $status = mkdir($to_file,$CFG->directorypermissions);
         }
         $dir = opendir($from_file);