Generation of slash-tilde waklog directives for each user
[hcoop/domtool2.git] / src / domain.sml
index f31d704..63b039c 100644 (file)
@@ -132,10 +132,9 @@ fun validDomain s =
 fun validNode s = List.exists (fn s' => s = s') nodes
 
 fun yourDomain s = !fakePrivs orelse SS.member (your_domains (), s)
-fun yourUser s = !fakePrivs orelse SS.member (your_users (), s)
-fun yourGroup s = !fakePrivs orelse SS.member (your_groups (), s)
+fun yourUser s = SS.member (your_users (), s)
+fun yourGroup s = SS.member (your_groups (), s)
 fun checkPath paths path =
-    !fakePrivs orelse
     (List.all (fn s => s <> "..") (String.fields (fn ch => ch = #"/") path)
      andalso CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"." orelse ch = #"/"
                                      orelse ch = #"-" orelse ch = #"_") path
@@ -610,7 +609,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";
@@ -980,7 +979,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}])
 
@@ -990,4 +989,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