setsa
[hcoop/domtool2.git] / src / domain.sml
index 3d8290b..4e38a98 100644 (file)
@@ -102,6 +102,14 @@ val yourDomain = yourDomainHost
 fun validUser s = size s > 0 andalso size s < 20
                  andalso CharVector.all Char.isAlphaNum s
 
+fun validEmailUser s =
+    size s > 0 andalso size s < 50
+    andalso CharVector.all (fn ch => Char.isAlphaNum ch
+                                    orelse ch = #"."
+                                    orelse ch = #"_"
+                                    orelse ch = #"-"
+                                    orelse ch = #"+") s
+
 val validGroup = validUser
 
 val _ = Env.type_one "no_spaces"