Skip to content

Commit

Permalink
Merged username login form bug fix from stable
Browse files Browse the repository at this point in the history
  • Loading branch information
exe-cutor committed Apr 2, 2007
1 parent 2c040c2 commit a155f37
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
13 changes: 8 additions & 5 deletions auth/shibboleth/README.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -144,24 +144,27 @@ Example file:
<?PHP <?PHP


// Set the zip code and the adress // Set the zip code and the adress
if ($_SERVER[$pluginconfig->field_map_address] != '') if ($_SERVER[$this->config->field_map_address] != '')
{ {
// $address contains something like 'SWITCH$Limmatquai 138$CH-8021 Zurich' // $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 // 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); list($institution, $street, $zip_city) = split('\$', $address);
ereg(' (.+)',$zip_city, $regs); ereg(' (.+)',$zip_city, $regs);
$city = $regs[1]; $city = $regs[1];

ereg('(.+)-',$zip_city, $regs); ereg('(.+)-',$zip_city, $regs);
$country = $regs[1]; $country = $regs[1];

$result["address"] = $street; $result["address"] = $street;
$result["city"] = $city; $result["city"] = $city;
$result["country"] = $country; $result["country"] = $country;
$result["department"] = $institution; $result["department"] = $institution;
$result["description"] = "I am a Shibboleth user";

} }

?> ?>
-- --


Expand Down
13 changes: 3 additions & 10 deletions auth/shibboleth/auth.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -148,18 +148,11 @@ function can_change_password() {


function loginpage_hook() { function loginpage_hook() {
global $SESSION, $CFG; global $SESSION, $CFG;

// Prevent username from being shown on login page after logout
$CFG->nolastloggedin = true;


//TODO: fix the code
return; 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');
// }
// }
} }


/** /**
Expand Down
5 changes: 4 additions & 1 deletion auth/shibboleth/index.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
$USER->site = $CFG->wwwroot; // for added security, store the site in the $USER->site = $CFG->wwwroot; // for added security, store the site in the


update_user_login_times(); update_user_login_times();
set_moodle_cookie($USER->username);
// Don't show username on login page
set_moodle_cookie('nobody');

set_login_session_preferences(); set_login_session_preferences();


unset($SESSION->lang); unset($SESSION->lang);
Expand Down

0 comments on commit a155f37

Please sign in to comment.