MDL-10386 Refactored the grader report file (index.php), and extracted the grade_repo...
[moodle-pu.git] / auth / mnet / jump.php
blob0dcc271c63e864551da4714f8fcb87c3c4e199c9
1 <?php
3 /**
4 * @author Martin Dougiamas
5 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
6 * @package moodle multiauth
8 * Authentication Plugin: Moodle Network Authentication
10 * Multiple host authentication support for Moodle Network.
12 * 2006-11-01 File created.
15 require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
17 if (!is_enabled_auth('mnet')) {
18 error('mnet is disabled');
21 // grab the GET params - wantsurl could be anything - take it
22 // with PARAM_RAW
23 $hostid = required_param('hostid', PARAM_INT);
24 $wantsurl = optional_param('wantsurl', '/', PARAM_RAW);
26 // start the mnet session and redirect browser to remote URL
27 $mnetauth = get_auth_plugin('mnet');
28 $url = $mnetauth->start_jump_session($hostid, $wantsurl);
30 if (empty($url)) {
31 error('DEBUG: Jump session was not started correctly or blank URL returned.'); // TODO: errors
33 redirect($url);