Project: moodle
Issue MDL-42993: Username with spaces no longer valid for LDAP authenticated users
Using LDAP authentication tied into AD users with spaces in their network logon (sAMAccountName) receive 'The given username contains invalid characters' message when trying to log in to Moodle for the first time. This configuration worked previously on 2.5 The difference between 2.5 and 2.6 is in lib/moodlelib.php::create_user_record($username, $password, $auth = 'manual') and it used do a database insert for the user record. It now calls the function user_create_user which includes validation. To allow the extended user name set you now need to set the following in your Moodle config.php. {code} $CFG->extendedusernamechars = true{code}
Story points: 13