Skip to content

Commit

Permalink
fix for MDL-19110
Browse files Browse the repository at this point in the history
Author: Adrian Schlegel <adrian@liip.ch>
  • Loading branch information
mjollnir_ committed May 8, 2009
1 parent 2e14051 commit e0eb5d2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions course/lib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3278,6 +3278,14 @@ function create_course($data) {
unset($data->allowedmods); unset($data->allowedmods);
if ($CFG->restrictmodulesfor == 'all') { if ($CFG->restrictmodulesfor == 'all') {
$data->restrictmodules = 1; $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 { } else {
$data->restrictmodules = 0; $data->restrictmodules = 0;
} }
Expand Down

0 comments on commit e0eb5d2

Please sign in to comment.