Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merged changes from stable version

  • Loading branch information...
commit f309632a05198cc24b1f8e771bbb40e3fd0c2ed2 1 parent 6e30bd4
exe-cutor authored
View
3  auth/shibboleth/README.txt
@@ -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
14 auth/shibboleth/auth.php
@@ -51,7 +51,7 @@ function user_login($username, $password) {
// 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 @@ function get_userinfo($username) {
$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 @@ function get_attributes() {
$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 @@ function get_first_string($string) {
}
}
-?>
+?>
View
2  auth/shibboleth/index.php
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.