Skip to content

Commit

Permalink
Merge branch 'MDL-29977-mnet-masquerade_21_STABLE' of git://github.co…
Browse files Browse the repository at this point in the history
…m/mudrd8mz/moodle into MOODLE_21_STABLE
  • Loading branch information
Aparup Banerjee committed Nov 9, 2011
2 parents 0734044 + e74ffa9 commit bc1f567
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions auth/mnet/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ function start_jump_session($mnethostid, $wantsurl, $wantsurlbackhere=false) {
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)
Expand Down
7 changes: 7 additions & 0 deletions blocks/mnet_hosts/block_mnet_hosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ function get_content() {
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
Expand Down
1 change: 1 addition & 0 deletions lang/en/mnet.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
$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';
Expand Down

0 comments on commit bc1f567

Please sign in to comment.