Allowed - and . during signup by email

This commit is contained in:
moodler
2003-04-25 12:35:17 +00:00
parent 5a9126f75a
commit 826293c75b
+6 -5
View File
@@ -76,14 +76,15 @@ function validate_form($user, &$err) {
global $CFG;
if (empty($user->username)){
$err->username = get_string("missingusername");
}else{
} else{
$user->username = trim(moodle_strtolower($user->username));
if (record_exists("user", "username", $user->username)){
$err->username = get_string("usernameexists");
}else {
$string = eregi_replace("[^([:alnum:])]", "", $user->username);
if (strcmp($user->username, $string))
$err->username = get_string("alphanumerical");
} else {
$string = eregi_replace("[^(-\.[:alnum:])]", "", $user->username);
if (strcmp($user->username, $string)) {
$err->username = get_string("alphanumerical");
}
}
}