Commit 9b1d27c4 authored by Nigel McNie's avatar Nigel McNie
Browse files

Further stability when authinstance is not set in a users session.

parent 0b78886d
......@@ -1697,10 +1697,12 @@ function profile_sideblock() {
if ($SESSION->get('mnetuser')) {
$authinstance = $SESSION->get('authinstance');
$authobj = AuthFactory::create($authinstance);
$peer = get_peer($authobj->wwwroot);
$data['mnetloggedinfrom'] = get_string('youhaveloggedinfrom', 'auth.xmlrpc',
$authobj->wwwroot, $peer->name);
if ($authinstance) {
$authobj = AuthFactory::create($authinstance);
$peer = get_peer($authobj->wwwroot);
$data['mnetloggedinfrom'] = get_string('youhaveloggedinfrom', 'auth.xmlrpc',
$authobj->wwwroot, $peer->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');
......
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