Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.9, 2.0
-
Fix Version/s: STABLE backlog
-
Component/s: Administration
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
Description
Around lines 123-142 of the /user/editadvanced_form.php file, there are a series of validation checks for the username. I think these should be moved to a function called something like valid_username that returns either true or the error (where the validation failed). In this way, we could easily enforce the validation of usernames when they come in via a CSV file (/admin/uploaduser.php). Currently we verify that the username contains no whitespace, is lowercase, and is alphanumeric allowing also dashes
, slashes (/ and ), periods (.) and parentheses (). I'm not sure how much of this is intentional. We may want to improve and limit it more closely to alphanums. I can see application for the dashes and periods but wonder about slashes and parentheses.
I think this is a matter of consistency. I came across a user who was putting underscores in the usernames via CSV files and this is not allowed when manually adding a user. In general, I would like to see that we are performing the same validation on CSV data as we do for manually added data. Peace - Anthony
Issue Links
| This issue will help resolve: | ||||
| MDL-16919 | Administration: Allow username to contain an underscore |
|
|
|
Agree, we should perform the same validations, both in manual and upload user creation.
Assigning to Mathieu... thanks for the report! Ciao