MDL-29982 fixed missing $userid

Thanks Eloy!
This commit is contained in:
Petr Skoda 2011-10-30 10:53:42 +01:00
parent 1344b0ca7f
commit 0f14c8273e

View File

@ -2016,7 +2016,7 @@ function can_access_course(stdClass $course, $user = null, $withcapability = '',
}
}
if (!$course->visible and !has_capability('moodle/course:viewhiddencourses', $coursecontext)) {
if (!$course->visible and !has_capability('moodle/course:viewhiddencourses', $coursecontext, $userid)) {
return false;
}
@ -2029,6 +2029,8 @@ function can_access_course(stdClass $course, $user = null, $withcapability = '',
return is_enrolled($coursecontext, $userid, '', $onlyactive);
}
// === from here we deal only with $USER ===
// verify our caches
if (!isset($USER->enrol)) {
/**