]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18670 adding proper permissions for mkdir(); merged from MOODLE_19_STABLE
authorskodak <skodak>
Wed, 6 May 2009 16:10:45 +0000 (16:10 +0000)
committerskodak <skodak>
Wed, 6 May 2009 16:10:45 +0000 (16:10 +0000)
admin/langimport.php
backup/bb/restore_bb.php
mod/lesson/importppt.php
search/indexer.php

index 0c10185a49aa6f9b9f64401c7e3c87531d9a31a3..a3f1102ebace9b76910abd7203b2f8702b237a9a 100755 (executable)
@@ -50,8 +50,8 @@
 
             if (confirm_sesskey() and !empty($pack)) {
                 set_time_limit(0);
-                @mkdir ($CFG->dataroot.'/temp/');    //make it in case it's a fresh install, it might not be there
-                @mkdir ($CFG->dataroot.'/lang/');
+                @mkdir ($CFG->dataroot.'/temp/', $CFG->directorypermissions);    //make it in case it's a fresh install, it might not be there
+                @mkdir ($CFG->dataroot.'/lang/', $CFG->directorypermissions);
 
                 if (is_array($pack)) {
                     $packs = $pack;
                 }
             }
 
-            @mkdir ($CFG->dataroot.'/temp/');
-            @mkdir ($CFG->dataroot.'/lang/');
+            @mkdir ($CFG->dataroot.'/temp/', $CFG->directorypermissions);
+            @mkdir ($CFG->dataroot.'/lang/', $CFG->directorypermissions);
             foreach ($packs as $pack){    //for each of the remaining in the list, we
                 if ($pack == 'en_utf8') {    // no update for en_utf8
                     continue;
index 0793a860688864f9858572ab5bb6f97baf42f5c3..b55780c516857b6d2f8ba3102c6f6c0a5eb50b39 100644 (file)
@@ -74,7 +74,7 @@ function blackboard_convert($dir){
 
         // Copy the Blackboard course files into the moodle course_files structure
         $subdirs = get_subdirs($dir."/");
-        mkdir("$dir/course_files");
+        mkdir("$dir/course_files", $CFG->directorypermissions);
         foreach ($subdirs as $subdir){
             rename($subdir, "course_files/$subdir");
         }
index 968a61fda3925394597ebc08259b9815a79d42ca..a378ba5bc450485a593eab38a3ebe5b3012b2337 100644 (file)
@@ -126,7 +126,7 @@ function readdata($file, $courseid, $modname) {
     $path_parts = pathinfo($zipfile);
     $dirname = substr($zipfile, 0, strpos($zipfile, '.'.$path_parts['extension'])); // take off the extension
     if (!file_exists($base.$dirname)) {
-        mkdir($base.$dirname);
+        mkdir($base.$dirname, $CFG->directorypermissions);
     }
 
     // move our uploaded file to temp/lesson
@@ -204,7 +204,7 @@ function extract_data($pages, $courseid, $lessonname, $modname) {
     while(true) {
         if (!file_exists($imagedir.'/'.$lessonname.$i)) {
             // ok doesnt exist so make the directory and update our paths
-            mkdir($imagedir.'/'.$lessonname.$i);
+            mkdir($imagedir.'/'.$lessonname.$i, $CFG->directorypermissions);
             $imagedir = $imagedir.'/'.$lessonname.$i;
             $imagelink = $imagelink.'/'.$lessonname.$i;
             break;
@@ -575,9 +575,7 @@ function book_save_objects($chapters, $bookid, $pageid='0') {
     
     // nothing fancy, just save them all in order
     foreach ($chapters as $chapter) {
-        if (!$chapter->id = $DB->insert_record('book_chapters', $chapter)) {
-            print_error('cannotupdatebook', 'lesson');
-        }
+        $chapter->id = $DB->insert_record('book_chapters', $chapter);
     }
     return true;
 }
index 4b8efc08906e2cb402a519452ad780321490d90c..ef0115d9a8edc6e8d627f8dee5404766a264ae5d 100644 (file)
@@ -89,7 +89,7 @@ require_once($CFG->dirroot.'/search/lib.php');
 
     if (!file_exists($index_path)) {
         mtrace("Data directory ($index_path) does not exist, attempting to create.");
-        if (!mkdir($index_path)) {
+        if (!mkdir($index_path, $CFG->directorypermissions)) {
             search_pexit("Error creating data directory at: $index_path. Please correct.");
         } 
         else {