Currently, the username is not allowed to contain an underscore. The validity check when manually creating a new issue states that the username field "Can only contain alphabetical letters or numbers"; however, periods and commas are allowed. It would make sense to also allow the underscore character. Part of what necessitates this is that the uploading of users was previously not checking for the underscore character so in fact some sites have users with them and others have discovered now that the underscore is being removed in 1.9 uploads. To be consistent, we should determine whether we are going to allow them or not and if so then we will need to fix the upload so that it does not strip out the underscore character and modify the validity check when manually adding a new user so that it allows it. We should also change the warning so that it is more accurate so that it states that the username "can only contain alphabetical letters, numbers, periods, commas, and underscores". In the meantime, in the hopes of preventing confusion, I have added notes about validity checking and requirements for the username field in Moodle docs at the following locations:
When this issue is resolved, we should probably go back in and make sure the docs reflect what we have done.
Peace - Anthony