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;
// 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");
}
$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
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;
// 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;
}
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 {