"MDL-22754, fixed file permission"
authorDongsheng Cai <unoter@gmail.com>
Tue, 15 Jun 2010 05:50:18 +0000 (05:50 +0000)
committerDongsheng Cai <unoter@gmail.com>
Tue, 15 Jun 2010 05:50:18 +0000 (05:50 +0000)
repository/filesystem/repository.class.php
repository/lib.php

index 695bca3..0aedb89 100644 (file)
@@ -37,7 +37,7 @@ class repository_filesystem extends repository {
         $this->root_path = $root . $subdir . '/';
         if (!empty($options['ajax'])) {
             if (!is_dir($this->root_path)) {
-                $created = mkdir($this->root_path, 0700);
+                $created = mkdir($this->root_path, $CFG->directorypermissions);
                 $ret = array();
                 $ret['msg'] = get_string('invalidpath', 'repository_filesystem');
                 $ret['nosearch'] = true;
index c01a76f..7ad0733 100644 (file)
@@ -1139,7 +1139,7 @@ abstract class repository {
     public function prepare_file($filename) {
         global $CFG;
         if (!file_exists($CFG->dataroot.'/temp/download')) {
-            mkdir($CFG->dataroot.'/temp/download/', 0777, true);
+            mkdir($CFG->dataroot.'/temp/download/', $CFG->directorypermissions, true);
         }
         if (is_dir($CFG->dataroot.'/temp/download')) {
             $dir = $CFG->dataroot.'/temp/download/';