]> git.mjollnir.org Git - moodle.git/commitdiff
Allowed - and . during signup by email
authormoodler <moodler>
Fri, 25 Apr 2003 12:35:17 +0000 (12:35 +0000)
committermoodler <moodler>
Fri, 25 Apr 2003 12:35:17 +0000 (12:35 +0000)
login/signup.php

index 58ba7472c050c9b6a4d0aee0c81760f872a8969b..965fabdc4c703e8704ef01670bec87346eb5747d 100644 (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");
+            }
         }
     }