payment: note that Stripe has instituted an additional 1% fee for non-US cards
[hcoop/portal.git] / chooseDomain.sml
dissimilarity index 90%
index e2029d7..4e25fd3 100644 (file)
@@ -1,22 +1,7 @@
-structure ChooseDomain :> CHOOSE_DOMAIN = struct
-
-fun domains user =
-    let
-       val proc = Unix.execute ("/bin/sh", ["-c", "DOMTOOL_USER=hcoop /usr/local/bin/domtool-admin perms " ^ user])
-       val inf = Unix.textInstreamOf proc
-
-       fun loop () =
-           case TextIO.inputLine inf of
-               NONE => []
-             | SOME line =>
-               case String.tokens (fn ch => ch = #":") line of
-                   ["domain", domains] => String.tokens Char.isSpace domains
-                 | _ => loop ()
-    in
-       loop ()
-       before ignore (Unix.reap proc)
-    end
-
-fun yourDomain {user, domain} = List.exists (fn x => x = domain) (domains user)
-
-end
+structure ChooseDomain :> CHOOSE_DOMAIN = struct
+
+val domains = Domtool.perms "domain"
+
+fun yourDomain {user, domain} = Domtool.hasPerm "domain" user domain
+
+end