Commit d14230d3 authored by Nigel McNie's avatar Nigel McNie
Browse files

Only show "login as" link if the user is actually an admin for the user being viewed.

parent 996fbf8f
......@@ -331,7 +331,7 @@ if ($loggedinid != $userid) {
}
if ($userid != $USER->get('id') && is_null($USER->get('parentuser'))) {
if ($userid != $USER->get('id') && $USER->is_admin_for_user($userid) && is_null($USER->get('parentuser'))) {
$loginas = get_string('loginasuser', 'admin', $user->username);
} else {
$loginas = null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment