Skip to content
Snippets Groups Projects
Commit 51301fa6 authored by Melanie Treitinger's avatar Melanie Treitinger Committed by Alexander Bias
Browse files

Profile button with "editadvanced" link for users with capability 'moodle/user:update' (#118)

Be consistent with function core_myprofile_navigation() in lib/myprofilelib.php:
Users with the capability 'moodle/user:update' shall be able to go to "user/editadvanced.php" when editing a non-admin user.
parent 0019f75e
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,7 @@ class core_renderer extends \core_renderer { ...@@ -168,7 +168,7 @@ class core_renderer extends \core_renderer {
$userid = optional_param('id', $USER->id, PARAM_INT); $userid = optional_param('id', $USER->id, PARAM_INT);
// Check if the shown and the operating user are identical. // Check if the shown and the operating user are identical.
$currentuser = $USER->id == $userid; $currentuser = $USER->id == $userid;
if (($currentuser || is_siteadmin($USER)) && if (($currentuser || is_siteadmin($USER) || !is_siteadmin($userid)) &&
has_capability('moodle/user:update', \context_system::instance())) { has_capability('moodle/user:update', \context_system::instance())) {
$url = new moodle_url('/user/editadvanced.php', array('id' => $userid, 'course' => $COURSE->id, $url = new moodle_url('/user/editadvanced.php', array('id' => $userid, 'course' => $COURSE->id,
'returnto' => 'profile')); 'returnto' => 'profile'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment