Fixing problems various in membership application and addition
[bpt/portal.git] / app / app.sml
index 96d9f47..bbc12fa 100644 (file)
@@ -2,7 +2,7 @@ structure App :> APP =
 struct
 
 val baseUrl = "https://join.hcoop.net/join/"
-val portalUrl = "https://members2.hcoop.net/portal/"
+val portalUrl = "https://members.hcoop.net/portal/"
 
 open Sql
 
@@ -159,10 +159,11 @@ fun validHost s =
 fun validDomain s =
     size s > 0 andalso size s < 100 andalso List.all validHost (String.fields (fn ch => ch = #".") s)
 
-fun validUser s =
-    size s > 0 andalso size s < 50 andalso List.all
-                                              (fn ch => isIdent ch orelse ch = #"." orelse ch = #"_" orelse ch = #"-" orelse ch = #"+")
-                                              (String.explode s)
+fun validUsername name =
+    size name <= 12
+    andalso size name > 0
+    andalso Char.isLower (String.sub (name, 0))
+    andalso CharVector.all Char.isAlphaNum name
 
 fun validEmailUser s =
     size s > 0 andalso size s < 50 andalso List.all