mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-12373 - More instances of links to the participants list being shown in the navigation bar to people without the necessary capability.
I have not copied and pasted the same code into lots of different places. That sucks. We really need to refactor this into a function that builds the navigation up to, and including the user's name. However, I don't have time now. A list of the places touched by this bug (MDL-12373) will at least give a complete list of places that such a refactoring would have to touch.
This commit is contained in:
parent
d1a2a97ba3
commit
b26adbef4c
9 changed files with 41 additions and 13 deletions
|
@ -40,7 +40,9 @@
|
|||
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $syscontext));
|
||||
|
||||
$navlinks = array();
|
||||
$navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'core');
|
||||
if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $course->id)) || has_capability('moodle/site:viewparticipants', $syscontext)) {
|
||||
$navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'core');
|
||||
}
|
||||
$navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id", 'type' => 'title');
|
||||
$navlinks[] = array('name' => $strforumposts, 'link' => '', 'type' => 'title');
|
||||
$navlinks[] = array('name' => $strmode, 'link' => '', 'type' => 'title');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue