Skip to content

Commit

Permalink
MDL-29982 fixed missing $userid
Browse files Browse the repository at this point in the history
Thanks Eloy!
  • Loading branch information
skodak committed Oct 30, 2011
1 parent 1344b0c commit 0f14c82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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)) {
/**
Expand Down

0 comments on commit 0f14c82

Please sign in to comment.