MDL-21782 fixed wrong removal of hidden courses - thanks Jay Knight for the report!

This commit is contained in:
Petr Skoda
2010-07-27 19:04:59 +00:00
parent 8a01ae6e81
commit 55880bdd9a
+2 -2
View File
@@ -502,11 +502,11 @@ function enrol_get_my_courses($fields = NULL, $sort = 'visible DESC,sortorder AS
context_instance_preload($course);
if (!$course->visible) {
if (!$context = get_context_instance(CONTEXT_COURSE, $id)) {
unset($course[$id]);
unset($courses[$id]);
continue;
}
if (!has_capability('moodle/course:viewhiddencourses', $context)) {
unset($course[$id]);
unset($courses[$id]);
continue;
}
}