MDL-16919 we have to really use the username cleaning only when manually adding new accounts, any sync with external system needs the exact match without any cleaning!

This commit is contained in:
Petr Skoda
2010-06-06 14:06:30 +00:00
parent 621b4d0873
commit 6b8ad965dc
12 changed files with 21 additions and 61 deletions
+3 -4
View File
@@ -114,7 +114,7 @@ class user_editadvanced_form extends moodleform {
profile_definition_after_data($mform, $userid);
}
function validation($usernew, $files) {
function validation($usernew, $files) {
global $CFG, $DB;
$usernew = (object)$usernew;
@@ -141,9 +141,8 @@ class user_editadvanced_form extends moodleform {
//check allowed characters
if ($usernew->username !== moodle_strtolower($usernew->username)) {
$err['username'] = get_string('usernamelowercase');
} else {
$string = clean_param($usernew->username, PARAM_USERNAME);
if ($usernew->username !== $string) {
} else {
if ($usernew->username !== clean_param($usernew->username, PARAM_USERNAME)) {
$err['username'] = get_string('invalidusername');
}
}