Commit 9d1ecf98 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add restore from loggedinas link to profile sideblock

parent 49a6d015
......@@ -1687,6 +1687,10 @@ function profile_sideblock() {
$data = array(
'id' => $USER->get('id'),
);
$saveduser = $USER->get('parentuser');
if (!empty($saveduser) && $saveduser->name) {
$data['realuser'] = $saveduser->name;
}
$data['unreadnotifications'] = call_static_method(generate_class_name('notification', 'internal'), 'unread_count', $USER->get('id'));
$data['unreadnotificationsmessage'] = $data['unreadnotifications'] == 1 ? get_string('unreadmessage') : get_string('unreadmessages');
$invitedgroups = get_invited_groups();
......
......@@ -65,3 +65,8 @@
<a href="{$WWWROOT}?logout">{str tag="logout"}</a>
| <a href="{$WWWROOT}account/">{str tag="settings"}</a>
</div>
{if $data.realuser}
<div>
<a href="{$WWWROOT}admin/users/changeuser.php?restore=1">{str tag=becomeadminagain section=admin args=$data.realuser}</a>
</div>
{/if}
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