From: stronk7 Date: Mon, 13 Oct 2003 22:44:41 +0000 (+0000) Subject: Now, when copying files/folders, CFG->directorypermissions is forced X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f654deea1192283b07f5361237ef96b0b9625a03;p=moodle.git Now, when copying files/folders, CFG->directorypermissions is forced (previously permissions were copied from original) --- diff --git a/backup/lib.php b/backup/lib.php index 4b7f91ba80..b2d270fd51 100644 --- a/backup/lib.php +++ b/backup/lib.php @@ -252,10 +252,15 @@ //Little modifications done function backup_copy_file ($from_file,$to_file) { + + global $CFG; + if (is_file($from_file)) { //echo "
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); @@ -272,6 +277,7 @@ if (!is_dir($to_file)) { //echo "
Creating ".$to_file; //Debug + umask(0000); $status = mkdir($to_file,$CFG->directorypermissions); } $dir = opendir($from_file);