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

Prevent a crash when view user profile pages, to do with loginas.

This happened if you weren't an admin, so I missed it the first time around.
parent 35f5ac9d
......@@ -331,7 +331,7 @@ if ($loggedinid != $userid) {
}
if ($userid != $USER->get('id') && $USER->is_admin_for_user($userid) && is_null($USER->get('parentuser'))) {
if ($userid != $USER->get('id') && $USER->is_admin_for_user($user) && is_null($USER->get('parentuser'))) {
$loginas = get_string('loginasuser', 'admin', $user->username);
} else {
$loginas = null;
......
Supports Markdown
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