]> git.mjollnir.org Git - moodle.git/commitdiff
Merged changes from stable version
authorexe-cutor <exe-cutor>
Wed, 11 Jul 2007 08:04:12 +0000 (08:04 +0000)
committerexe-cutor <exe-cutor>
Wed, 11 Jul 2007 08:04:12 +0000 (08:04 +0000)
auth/shibboleth/README.txt
auth/shibboleth/auth.php
auth/shibboleth/index.php

index a353c482eafc864c06c794c84ba843658d5f5e22..dc076030429a06852ffd122c2f348b6b16a42a4b 100644 (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
 -------------------------------------------------------------------------------
index f239fa5735a95c0b5d8a611f740ab64a09de04bc..2647f92c8f5cf8492b21bd06b0b1fae4427eb4db 100644 (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 {
     }
 }
 
-?>
+?>
\ No newline at end of file
index 9bda6c35d80cf7b6b455277c054a058af654d617..347e6a822cac8b0c12bd211a43b57d72505e5334 100644 (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