fix for MDL-19110

Author: Adrian Schlegel <[email protected]>
This commit is contained in:
mjollnir_
2009-05-08 14:26:17 +00:00
parent 2e14051ba0
commit e0eb5d21f5
+8
View File
@@ -3278,6 +3278,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;
}