From 00f270bc6c4eafd523e35d4bc4112818ae4dded7 Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Fri, 8 May 2009 14:24:56 +0000 Subject: [PATCH] fix for MDL-19110 Author: Adrian Schlegel --- course/lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.39.5