Changes to support IMAP on hopper all compile but are not tested yet
[hcoop/domtool2.git] / src / domain.sml
index 488d7a8..cdc3580 100644 (file)
@@ -27,6 +27,7 @@ structure SS = DataStructures.StringSet
 
 val ssl_context = ref (NONE : OpenSSL.context option)
 fun set_context ctx = ssl_context := SOME ctx
+fun get_context () = valOf (!ssl_context)
 
 val nodes = map #1 Config.nodeIps
 val nodeMap = foldl (fn ((node, ip), mp) => SM.insert (mp, node, ip))
@@ -235,6 +236,10 @@ val _ = Env.type_one "node"
        Env.string
        validNode
 
+val _ = Env.type_one "mime_type"
+       Env.string
+       (CharVector.exists (fn ch => ch = #"/"))
+
 val _ = Env.registerFunction ("your_ip_to_ip",
                              fn [e] => SOME e
                               | _ => NONE)
@@ -609,7 +614,7 @@ val _ = Env.containerV_one "domain"
 
                                   fun saveSoa (kind, soa : soa) node =
                                       let
-                                          val {write, writeDom, close} = domainsFile {node = node, name = "soa"}
+                                          val {write, writeDom, close} = domainsFile {node = node, name = "soa.conf"}
                                       in
                                           write kind;
                                           write "\n";
@@ -979,7 +984,7 @@ fun considerAll ds {node, domain} =
            ""
     end
 
-val () = registerDescriber (considerAll [Filename {filename = "soa",
+val () = registerDescriber (considerAll [Filename {filename = "soa.conf",
                                                   heading = "DNS SOA:",
                                                   showEmpty = false}])
 
@@ -989,4 +994,15 @@ val () = Env.registerAction ("domainHost",
                                           (EString (host ^ "." ^ currentDomain ()), dl))
                              | (_, args) => Env.badArgs ("domainHost", args))
 
+val ouc = ref (fn () => ())
+
+fun registerOnUsersChange f =
+    let
+       val f' = !ouc
+    in
+       ouc := (fn () => (f' (); f ()))
+    end
+
+fun onUsersChange () = !ouc ()
+
 end