MDL-29977 MNet does not allow to start a remote session when masquerading as another user

This commit is contained in:
David Mudrak 2011-11-04 09:33:58 +01:00
parent 735de1c276
commit 10df8657c1
3 changed files with 12 additions and 0 deletions

View File

@ -132,6 +132,10 @@ class auth_plugin_mnet extends auth_plugin_base {
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)

View File

@ -25,6 +25,13 @@ class block_mnet_hosts extends block_list {
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

View File

@ -159,6 +159,7 @@ $string['notinxmlrpcserver'] = 'Attempt to access the MNet remote client, not du
$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';