Commit 6337de86 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't try to call get_peer when the user's authinstance is not xmlrpc


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent b99fef72
......@@ -1959,12 +1959,14 @@ function profile_sideblock() {
$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);
if ($authobj->authname == 'xmlrpc') {
$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'));
......
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