auth MDL-19788 Added PAGE->set_url calls and removed $Id tags

This commit is contained in:
samhemelryk
2009-10-15 02:34:31 +00:00
parent da42e89074
commit 79151615c5
6 changed files with 33 additions and 14 deletions
+2
View File
@@ -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");
+2
View File
@@ -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');
+12 -6
View File
@@ -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));
+10 -5
View File
@@ -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');
+5 -2
View File
@@ -1,8 +1,11 @@
<?php // $Id$
// Designed to be redirected from moodle/login/index.php
<?php
// Designed to be redirected from moodle/login/index.php
require('../../config.php');
$PAGE->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
+2 -1
View File
@@ -1,4 +1,4 @@
<?php // $Id$
<?php
require_once("../../config.php");
require_once($CFG->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);