global $CFG, $USER, $DB;
require_once $CFG->dirroot . '/mnet/xmlrpc/client.php';
+ if (session_is_loggedinas()) {
+ print_error('notpermittedtojumpas', 'mnet');
+ }
+
// check remote login permissions
if (! has_capability('moodle/site:mnetlogintoremote', get_system_context())
or is_mnet_remote_user($USER)
return false;
}
+ if (session_is_loggedinas()) {
+ $this->content = new stdClass();
+ $this->content->footer = html_writer::tag('span',
+ get_string('notpermittedtojumpas', 'mnet'));
+ return $this->content;
+ }
+
// according to start_jump_session,
// remote users can't on-jump
// so don't show this block to them
$string['notmoodleapplication'] = 'WARNING: This is not a Moodle application, so some of the inspection methods may not work properly.';
$string['notPEM'] = 'This key is not in PEM format. It will not work.';
$string['notpermittedtojump'] = 'You do not have permission to begin a remote session from this Moodle server.';
+$string['notpermittedtojumpas'] = 'You can\'t begin a remote session while you are logged in as another user.';
$string['notpermittedtoland'] = 'You do not have permission to begin a remote session.';
$string['off'] = 'Off';
$string['on'] = 'On';