Merged changes from stable version

This commit is contained in:
exe-cutor 2007-07-11 08:04:12 +00:00
parent 6e30bd442d
commit f309632a05
3 changed files with 13 additions and 6 deletions

View File

@ -9,13 +9,14 @@ Changes:
- 11. 2004: Created by Markus Hagman
- 05. 2005: Modifications to login process by Martin Dougiamas
- 05. 2005: Various extensions and fixes by Lukas Haemmerle
- 06. 2005: Adaptions to new field locks and plugin config structures by Marting
- 06. 2005: Adaptions to new field locks and plugin config structures by Martin
Langhoff and Lukas Haemmerle
- 10. 2005: Added better error messages and moved text to language directories
- 02. 2006: Simplified authentication so that authorization works properly
Added instructions for IIS
- 11. 2006: User capabilities are now loaded properly as of Moodle 1.7+
- 03. 2007: Adapted authentication method to Moodle 1.8
- 07. 2007: Fixed a but that caused problems with uppercase usernames
Moodle Configuration with Dual login
-------------------------------------------------------------------------------

View File

@ -51,7 +51,7 @@ class auth_plugin_shibboleth extends auth_plugin_base {
// If we are in the shibboleth directory then we trust the server var
if (!empty($_SERVER[$this->config->user_attribute])) {
return ($_SERVER[$this->config->user_attribute] == $username);
return (strtolower($_SERVER[$this->config->user_attribute]) == strtolower($username));
} else {
// If we are not, the user has used the manual login and the login name is
// unknown, so we return false.
@ -87,7 +87,13 @@ class auth_plugin_shibboleth extends auth_plugin_base {
$search_attribs = array();
foreach ($attrmap as $key=>$value) {
$result[$key] = $this->get_first_string($_SERVER[$value]);
// Make usename lowercase
if ($key == 'username'){
$result[$key] = strtolower($this->get_first_string($_SERVER[$value]));
} else {
$result[$key] = $this->get_first_string($_SERVER[$value]);
}
}
// Provide an API to modify the information to fit the Moodle internal
@ -118,7 +124,7 @@ class auth_plugin_shibboleth extends auth_plugin_base {
$moodleattributes = array();
foreach ($fields as $field) {
if ($configarray["field_map_$field"]) {
if (isset($configarray["field_map_$field"])) {
$moodleattributes[$field] = $configarray["field_map_$field"];
}
}
@ -218,4 +224,4 @@ class auth_plugin_shibboleth extends auth_plugin_base {
}
}
?>
?>

View File

@ -26,7 +26,7 @@
/// If we can find the Shibboleth attribute, save it in session and return to main login page
if (!empty($_SERVER[$pluginconfig->user_attribute])) { // Shibboleth auto-login
$frm->username = $_SERVER[$pluginconfig->user_attribute];
$frm->username = strtolower($_SERVER[$pluginconfig->user_attribute]);
$frm->password = substr(base64_encode($_SERVER[$pluginconfig->user_attribute]),0,8);
// The random password consists of the first 8 letters of the base 64 encoded user ID
// This password is never used unless the user account is converted to manual