Allowed - and . during signup by email
This commit is contained in:
+6
-5
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user