mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
MDL-29982 fixed missing $userid
Thanks Eloy!
This commit is contained in:
parent
1344b0ca7f
commit
0f14c8273e
@ -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)) {
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user