From: samhemelryk Date: Thu, 15 Oct 2009 02:34:31 +0000 (+0000) Subject: auth MDL-19788 Added PAGE->set_url calls and removed $Id tags X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=79151615c5fc4d16a7d44308bf2be8a1da69c1a8;p=moodle.git auth MDL-19788 Added PAGE->set_url calls and removed $Id tags --- diff --git a/auth/ldap/ntlmsso_attempt.php b/auth/ldap/ntlmsso_attempt.php index 94298a1b00..3b1aaaaf1d 100644 --- a/auth/ldap/ntlmsso_attempt.php +++ b/auth/ldap/ntlmsso_attempt.php @@ -5,6 +5,8 @@ require_once(dirname(dirname(dirname(__FILE__)))."/config.php"); //HTTPS is potentially required in this page httpsrequired(); +$PAGE->set_url(new moodle_url($CFG->wwwroot.'/auth/ldap/ntlmsso_attempt.php')); + /// Define variables used in page if (!$site = get_site()) { print_error("siteisnotdefined"); diff --git a/auth/ldap/ntlmsso_finish.php b/auth/ldap/ntlmsso_finish.php index 4ee0642859..0356df34e7 100644 --- a/auth/ldap/ntlmsso_finish.php +++ b/auth/ldap/ntlmsso_finish.php @@ -5,6 +5,8 @@ require_once(dirname(dirname(dirname(__FILE__)))."/config.php"); //HTTPS is potentially required in this page httpsrequired(); +$PAGE->set_url(new moodle_url($CFG->wwwroot.'/auth/ldap/ntlmsso_finish.php')); + /// Define variables used in page if (!$site = get_site()) { print_error("siteisnotdefined", 'debug'); diff --git a/auth/mnet/jump.php b/auth/mnet/jump.php index f7796a5ea5..6a4f23cb83 100644 --- a/auth/mnet/jump.php +++ b/auth/mnet/jump.php @@ -14,18 +14,24 @@ require_once dirname(dirname(dirname(__FILE__))) . '/config.php'; -require_login(SITEID,false); - -if (!is_enabled_auth('mnet')) { - print_error('mnetdisable'); -} - // grab the GET params - wantsurl could be anything - take it // with PARAM_RAW $hostid = optional_param('hostid', '0', PARAM_INT); $hostwwwroot = optional_param('hostwwwroot', '', PARAM_URL); $wantsurl = optional_param('wantsurl', '', PARAM_RAW); +$url = new moodle_url($CFG->wwwroot.'/auth/mnet/jump.php'); +if ($hostid !== '0') $url->param('hostid', $hostid); +if ($hostwwwroot !== '') $url->param('hostwwwroot', $hostwwwroot); +if ($wantsurl !== '') $url->param('wantsurl', $wantsurl); +$PAGE->set_url($url); + +require_login(SITEID,false); + +if (!is_enabled_auth('mnet')) { + print_error('mnetdisable'); +} + // If hostid hasn't been specified, try getting it using wwwroot if (!$hostid) { $hostid = $DB->get_field('mnet_host', 'id', array('wwwroot' => $hostwwwroot)); diff --git a/auth/mnet/land.php b/auth/mnet/land.php index 4dec821c89..bb95440a21 100644 --- a/auth/mnet/land.php +++ b/auth/mnet/land.php @@ -15,6 +15,16 @@ require_once dirname(dirname(dirname(__FILE__))) . '/config.php'; require_once $CFG->dirroot . '/mnet/xmlrpc/client.php'; +// grab the GET params +$token = required_param('token', PARAM_BASE64); +$remotewwwroot = required_param('idp', PARAM_URL); +$wantsurl = required_param('wantsurl', PARAM_LOCALURL); +$wantsremoteurl = optional_param('remoteurl', false, PARAM_BOOL); + +$url = new moodle_url($CFG->wwwroot.'/auth/mnet/jump.php', array('token'=>$token, 'idp'=>$remotewwwroot, 'wantsurl'=>$wantsurl)); +if ($wantsremoteurl !== false) $url->param('remoteurl', $wantsremoteurl); +$PAGE->set_url($url); + if (!$site = get_site()) { print_error('mnet_session_prohibited', 'mnet', '', ''); } @@ -22,11 +32,6 @@ if (!$site = get_site()) { if (!is_enabled_auth('mnet')) { print_error('mnetdisable'); } -// grab the GET params -$token = required_param('token', PARAM_BASE64); -$remotewwwroot = required_param('idp', PARAM_URL); -$wantsurl = required_param('wantsurl', PARAM_LOCALURL); -$wantsremoteurl = optional_param('remoteurl', false, PARAM_BOOL); // confirm the MNET session $mnetauth = get_auth_plugin('mnet'); diff --git a/auth/shibboleth/index.php b/auth/shibboleth/index.php index 562a28ff8c..0744ed925e 100644 --- a/auth/shibboleth/index.php +++ b/auth/shibboleth/index.php @@ -1,8 +1,11 @@ -set_url(new moodle_url($CFG->wwwroot.'/auth/shibboleth/index.php')); + if (isloggedin() && $USER->username != 'guest') { // Nothing to do if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) { $urltogo = $SESSION->wantsurl; /// Because it's an address in this site diff --git a/auth/shibboleth/login.php b/auth/shibboleth/login.php index 03f23746b6..dd57528e26 100644 --- a/auth/shibboleth/login.php +++ b/auth/shibboleth/login.php @@ -1,4 +1,4 @@ -dirroot."/auth/shibboleth/auth.php"); @@ -79,6 +79,7 @@ httpsrequired(); $loginsite = get_string("loginsite"); + $PAGE->set_url(new moodle_url($CFG->wwwroot.'/auth/shibboleth/login.php')); $PAGE->navbar->add($loginsite); $PAGE->set_title("$site->fullname: $loginsite"); $PAGE->set_heading($site->fullname);