MDL-15881 - Probable bug: Not able to update SCORM. Backport 1.9.
[moodle-linuxchix.git] / auth / mnet / jump.php
bloba152672b5c9a2c38ba1f9cf4722a0991175efe96
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 require_login(SITEID,false);
19 if (!is_enabled_auth('mnet')) {
20 error('mnet is disabled');
23 // grab the GET params - wantsurl could be anything - take it
24 // with PARAM_RAW
25 $hostid = optional_param('hostid', '0', PARAM_INT);
26 $hostwwwroot = optional_param('hostwwwroot', '', PARAM_URL);
27 $wantsurl = optional_param('wantsurl', '', PARAM_RAW);
29 // If hostid hasn't been specified, try getting it using wwwroot
30 if (!$hostid) {
31 $hostid = get_field('mnet_host', 'id', 'wwwroot', $hostwwwroot);
34 // start the mnet session and redirect browser to remote URL
35 $mnetauth = get_auth_plugin('mnet');
36 $url = $mnetauth->start_jump_session($hostid, $wantsurl);
38 if (empty($url)) {
39 error('DEBUG: Jump session was not started correctly or blank URL returned.'); // TODO: errors
41 redirect($url);