This commit is contained in:
Eloy Lafuente (stronk7) 2014-08-18 23:58:27 +02:00
commit 6ea7fde09c

View file

@ -4132,11 +4132,19 @@ class settings_navigation extends navigation_node {
} }
$canaccessallgroups = has_capability('moodle/site:accessallgroups', $coursecontext); $canaccessallgroups = has_capability('moodle/site:accessallgroups', $coursecontext);
if (!$canaccessallgroups && groups_get_course_groupmode($course) == SEPARATEGROUPS) { if (!$canaccessallgroups && groups_get_course_groupmode($course) == SEPARATEGROUPS) {
// If groups are in use, make sure we can see that group // If groups are in use, make sure we can see that group (MDL-45874).
if ($courseid == $this->page->course->id) {
$mygroups = get_fast_modinfo($this->page->course)->groups;
} else {
$mygroups = groups_get_user_groups($courseid);
}
$usergroups = groups_get_user_groups($courseid, $userid);
if (!array_intersect_key($mygroups[0], $usergroups[0])) {
return false; return false;
} }
} }
} }
}
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $this->page->context)); $fullname = fullname($user, has_capability('moodle/site:viewfullnames', $this->page->context));