From a155f3784dae284aea9bd892edd21bfae2a5a92c Mon Sep 17 00:00:00 2001 From: exe-cutor Date: Mon, 2 Apr 2007 14:13:59 +0000 Subject: [PATCH] Merged username login form bug fix from stable --- auth/shibboleth/README.txt | 13 ++++++++----- auth/shibboleth/auth.php | 13 +++---------- auth/shibboleth/index.php | 5 ++++- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/auth/shibboleth/README.txt b/auth/shibboleth/README.txt index d23f0ce595..f64afa84ac 100644 --- a/auth/shibboleth/README.txt +++ b/auth/shibboleth/README.txt @@ -144,24 +144,27 @@ Example file: field_map_address] != '') + if ($_SERVER[$this->config->field_map_address] != '') { // $address contains something like 'SWITCH$Limmatquai 138$CH-8021 Zurich' - // We want to split this up to get: + // We want to split this up to get: // institution, street, zipcode, city and country - $address = $_SERVER[$pluginconfig->field_map_address]; + $address = $_SERVER[$this->config->field_map_address]; list($institution, $street, $zip_city) = split('\$', $address); ereg(' (.+)',$zip_city, $regs); $city = $regs[1]; - + ereg('(.+)-',$zip_city, $regs); $country = $regs[1]; - + $result["address"] = $street; $result["city"] = $city; $result["country"] = $country; $result["department"] = $institution; + $result["description"] = "I am a Shibboleth user"; + } + ?> -- diff --git a/auth/shibboleth/auth.php b/auth/shibboleth/auth.php index c12b7e4807..4af09ac987 100644 --- a/auth/shibboleth/auth.php +++ b/auth/shibboleth/auth.php @@ -148,18 +148,11 @@ class auth_plugin_shibboleth extends auth_plugin_base { function loginpage_hook() { global $SESSION, $CFG; + + // Prevent username from being shown on login page after logout + $CFG->nolastloggedin = true; - //TODO: fix the code return; - - // See http://moodle.org/mod/forum/discuss.php?d=39918#187611 - // if ($CFG->auth == 'shibboleth') { - // if (!empty($SESSION->shibboleth_checked) ) { // Just come from there - // unset($SESSION->shibboleth_checked); - // } else if (empty($_POST)) { // No incoming data, so redirect - // redirect($CFG->wwwroot.'/auth/shibboleth/index.php'); - // } - // } } /** diff --git a/auth/shibboleth/index.php b/auth/shibboleth/index.php index 2f329384c3..1750e00d51 100644 --- a/auth/shibboleth/index.php +++ b/auth/shibboleth/index.php @@ -41,7 +41,10 @@ $USER->site = $CFG->wwwroot; // for added security, store the site in the update_user_login_times(); - set_moodle_cookie($USER->username); + + // Don't show username on login page + set_moodle_cookie('nobody'); + set_login_session_preferences(); unset($SESSION->lang); -- 2.39.5