Skip to content
Browse files

MDL-29977 MNet does not allow to start a remote session when masquera…

…ding as another user
  • Loading branch information...
1 parent f28a448 commit 408d3ca00035a8b24cc091ec93253e802e268c2d @mudrd8mz mudrd8mz committed Nov 4, 2011
Showing with 13 additions and 0 deletions.
  1. +4 −0 auth/mnet/auth.php
  2. +8 −0 blocks/mnet_hosts/block_mnet_hosts.php
  3. +1 −0 lang/en_utf8/mnet.php
View
4 auth/mnet/auth.php
@@ -170,6 +170,10 @@ function start_jump_session($mnethostid, $wantsurl) {
global $MNET;
require_once $CFG->dirroot . '/mnet/xmlrpc/client.php';
+ if (!empty($USER->realuser)) {
+ print_error('notpermittedtojumpas', 'mnet');
+ }
+
// check remote login permissions
if (! has_capability('moodle/site:mnetlogintoremote', get_context_instance(CONTEXT_SYSTEM))
or is_mnet_remote_user($USER)
View
8 blocks/mnet_hosts/block_mnet_hosts.php
@@ -32,6 +32,14 @@ function get_content() {
return '';
}
+ if (!empty($USER->realuser)) {
+ $this->content = new stdClass();
+ $this->content->items = array();
+ $this->content->icons = array();
+ $this->content->footer = get_string('notpermittedtojumpas', 'mnet');
+ return $this->content;
+ }
+
// check for outgoing roaming permission first
if (!has_capability('moodle/site:mnetlogintoremote', get_context_instance(CONTEXT_SYSTEM), NULL, false)) {
return '';
View
1 lang/en_utf8/mnet.php
@@ -208,6 +208,7 @@
$string['accesslevel'] = 'Access Level';
$string['ssoaccesscontrol'] = 'SSO Access Control';
$string['notpermittedtojump'] = 'You do not have permission to begin a remote session from this Moodle hub.';
+$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['authfail_nosessionexists'] = 'Authorisation failed: the mnet session does not exist.';
$string['authfail_sessiontimedout'] = 'Authorisation failed: the mnet session has timed out.';

0 comments on commit 408d3ca

Please sign in to comment.
Something went wrong with that request. Please try again.