MDL-24666 sync_users.php can throw db exception on sites upgraded from 1.x
[moodle.git] / auth / ldap / auth.php
index 1fd3909..447b6a6 100644 (file)
@@ -1385,7 +1385,7 @@ class auth_plugin_ldap extends auth_plugin_base {
                 }
             }
         }
-        $moodleattributes['username'] = $this->config->user_attribute;
+        $moodleattributes['username'] = moodle_strtolower(trim($this->config->user_attribute));
         return $moodleattributes;
     }