Commit b99fef72 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add link to mnet peer for xmlrpc users who log in using the mahara login form (bug 3425)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 0888cfe3
......@@ -1956,13 +1956,15 @@ function profile_sideblock() {
'profileicon' => $USER->get('profileicon') ? $USER->get('profileicon') : 0,
);
if ($SESSION->get('mnetuser')) {
$authinstance = $SESSION->get('authinstance');
if ($authinstance) {
$authobj = AuthFactory::create($authinstance);
$peer = get_peer($authobj->wwwroot);
$data['mnetloggedinfrom'] = get_string('youhaveloggedinfrom', 'auth.xmlrpc',
$authobj->wwwroot, $peer->name);
$authinstance = $SESSION->get('mnetuser') ? $SESSION->get('authinstance') : $USER->get('authinstance');
if ($authinstance) {
$authobj = AuthFactory::create($authinstance);
$peer = get_peer($authobj->wwwroot);
if ($SESSION->get('mnetuser')) {
$data['mnetloggedinfrom'] = get_string('youhaveloggedinfrom', 'auth.xmlrpc', $authobj->wwwroot, $peer->name);
}
else {
$data['peer'] = array('name' => $peer->name, 'wwwroot' => $peer->wwwroot);
}
}
$data['unreadnotifications'] = call_static_method(generate_class_name('notification', 'internal'), 'unread_count', $USER->get('id'));
......
......@@ -59,6 +59,8 @@
<a href="{$WWWROOT}?logout" class="btn-link" id="btn-logout">{str tag="logout"}</a>&nbsp;
<a href="{if get_config('httpswwwroot')}{$HTTPSWWWROOT}{else}{$WWWROOT}{/if}account/" class="btn-link">{str tag="settings"}</a>
</div>
{if $sbdata.peer} <div class="center"><a href="{$sbdata.peer.wwwroot}">{$sbdata.peer.name|escape}</a></div>
{/if}
{if $USERMASQUERADING} <div id="changeuser">{$becomeyouagain}</div>
{/if}
<div class="cb"></div>
......
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