Skip to content

Commit

Permalink
MDL-45126 do not allow guests see name and summary of hidden course
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy authored and danpoltawski committed May 7, 2014
1 parent 437240b commit ec22de0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions enrol/index.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
redirect("$CFG->wwwroot/"); redirect("$CFG->wwwroot/");
} }


if (!$course->visible && !has_capability('moodle/course:viewhiddencourses', context_course::instance($course->id))) {
print_error('coursehidden');
}

$PAGE->set_course($course); $PAGE->set_course($course);
$PAGE->set_pagelayout('course'); $PAGE->set_pagelayout('course');
$PAGE->set_url('/enrol/index.php', array('id'=>$course->id)); $PAGE->set_url('/enrol/index.php', array('id'=>$course->id));
Expand Down

0 comments on commit ec22de0

Please sign in to comment.