- 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
-------------------------------------------------------------------------------
// 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.
$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
$moodleattributes = array();
foreach ($fields as $field) {
- if ($configarray["field_map_$field"]) {
+ if (isset($configarray["field_map_$field"])) {
$moodleattributes[$field] = $configarray["field_map_$field"];
}
}
}
}
-?>
+?>
\ No newline at end of file
/// 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