Commit 2b8552b3 authored by Nigel McNie's avatar Nigel McNie
Browse files

Add 'log in as X' to the profile viewing page, to assist admins.

(cherry picked from commit ea02642a)
parent df1bc647
......@@ -13,8 +13,11 @@
{$introduction}
<div class="fr user-icon">
<img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxwidth=100&amp;maxheight=100&amp;id={$USERID}" alt="">
<div>
{if !empty($loginas)}
<div class="center"><strong><a href="{$WWWROOT}admin/users/changeuser.php?id={$USERID}">{$loginas}</a></strong></div>
{/if}
{if $canmessage}
<br>
<a href="{$WWWROOT}user/sendmessage.php?id={$USERID}&amp;returnto=view" id="btn-sendmessage">{str tag='sendmessage' section='group'}</a>
{/if}
{if $relationship == 'existingfriend'}
......@@ -32,6 +35,7 @@
{if $addform}
{$addform}
{/if}
</div>
</div>
<ul id="user-info">
{foreach from=$USERFIELDS name=userfields key=key item=item}
......
......@@ -331,6 +331,13 @@ if ($loggedinid != $userid) {
}
if ($id != $USER->get('id') && is_null($USER->get('parentuser'))) {
$loginas = get_string('loginasuser', 'admin', $user->username);
} else {
$loginas = null;
}
$smarty->assign('loginas', $loginas);
if (isset($introduction)) {
$smarty->assign('introduction', $introduction);
}
......
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