-fun apply {name, rname, gname, email, forward, uses, other} =
+fun randomPassword () =
+ let
+ val proc = Unix.execute ("/usr/bin/pwgen", ["-cCnB", "8", "1"])
+ in
+ case TextIO.inputLine (Unix.textInstreamOf proc) of
+ NONE => raise Fail "Couldn't execute pwgen"
+ | SOME line =>
+ case String.tokens Char.isSpace line of
+ [s] => s
+ | _ => raise Fail "Couldn't parse output of pwgen"
+ end
+
+val allLower = CharVector.map Char.toLower
+
+fun emailToSql so =
+ case so of
+ NONE => "NULL"
+ | SOME s => C.stringToSql (allLower s)
+
+fun apply {name, rname, gname, email, forward, uses, other, paypal, checkout} =