From: mjollnir_ Date: Fri, 8 May 2009 14:24:56 +0000 (+0000) Subject: fix for MDL-19110 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=00f270bc6c4eafd523e35d4bc4112818ae4dded7;p=moodle.git fix for MDL-19110 Author: Adrian Schlegel --- diff --git a/course/lib.php b/course/lib.php index 8ab86c2ecc..aff3060f33 100644 --- a/course/lib.php +++ b/course/lib.php @@ -3522,6 +3522,14 @@ function create_course($data) { unset($data->allowedmods); if ($CFG->restrictmodulesfor == 'all') { $data->restrictmodules = 1; + + // if the user is not an admin, get the default allowed modules because + // there are no modules passed by the form + if(!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) { + if(!$allowedmods && $CFG->defaultallowedmodules) { + $allowedmods = explode(',', $CFG->defaultallowedmodules); + } + } } else { $data->restrictmodules = 0; }