]> git.mjollnir.org Git - moodle.git/commitdiff
You can choose not to show notices on make_upload_directory
authormoodler <moodler>
Thu, 12 Aug 2004 15:54:43 +0000 (15:54 +0000)
committermoodler <moodler>
Thu, 12 Aug 2004 15:54:43 +0000 (15:54 +0000)
The installer script uses this.

lib/moodlelib.php

index f65be0edc9ce6a9cccdda5c0b28607f09a9fe994..f5acccee087d24a483e47108e6872f1baa41db1d 100644 (file)
@@ -1578,7 +1578,7 @@ function send_password_change_confirmation_email($user) {
 /// FILE HANDLING  /////////////////////////////////////////////
 
 
-function make_upload_directory($directory) {
+function make_upload_directory($directory, $shownotices=true) {
 /// $directory = a string of directory names under $CFG->dataroot
 /// eg  stuff/assignment/1
 /// Returns full directory if successful, false if not
@@ -1591,7 +1591,9 @@ function make_upload_directory($directory) {
 
     if (!file_exists($currdir)) {
         if (! mkdir($currdir, $CFG->directorypermissions)) {
-            notify("ERROR: You need to create the directory $currdir with web server write access");
+            if ($shownotices) {
+                notify("ERROR: You need to create the directory $currdir with web server write access");
+            }
             return false;
         }
     }
@@ -1602,7 +1604,9 @@ function make_upload_directory($directory) {
         $currdir = "$currdir/$dir";
         if (! file_exists($currdir)) {
             if (! mkdir($currdir, $CFG->directorypermissions)) {
-                notify("ERROR: Could not find or create a directory ($currdir)");
+                if ($shownotices) {
+                    notify("ERROR: Could not find or create a directory ($currdir)");
+                }
                 return false;
             }
             @chmod($currdir, $CFG->directorypermissions);  // Just in case mkdir didn't do it