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

This commit is contained in:
Petr Skoda
2010-07-27 21:28:29 +00:00
parent 12b8f43314
commit 4a5aba7c95
+2 -2
View File
@@ -612,11 +612,11 @@ function enrol_get_users_courses($userid, $onlyactive = false, $fields = NULL, $
if ($onlyactive) {
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, $userid)) {
unset($course[$id]);
unset($courses[$id]);
continue;
}
}