Use HTML5 field validation in join form
[hcoop/portal.git] / mailman / portalsub.sml
index f781964..925840b 100644 (file)
@@ -29,7 +29,8 @@ fun validEmail s =
 fun main () =
     case CommandLine.arguments () of
        [list, cmd, addr] =>
-       if list <> "hcoop-discuss" andalso list <> "hcoop-misc" then
+       if list <> "hcoop-discuss" andalso list <> "hcoop-help" andalso list <> "hcoop-misc"
+          andalso list <> "hcoop-announce" andalso list <> "hcoop-sysadmin" then
            (print "Bad mailing list name\n";
             OS.Process.failure)
        else if not (validEmail addr) then
@@ -47,7 +48,10 @@ fun main () =
                  else
                      OS.Process.system (String.concat ["echo ", addr, " | /usr/sbin/add_members -r - ", list])
                | "rm" =>
-                 if isMember (list, addr) then
+                 if list = "hcoop-announce" then
+                     (print "You can't remove anyone from hcoop-announce.\n";
+                      OS.Process.failure)
+                 else if isMember (list, addr) then
                      OS.Process.system (String.concat ["/usr/sbin/remove_members ", list, " ", addr])
                  else
                      OS.Process.success
@@ -56,4 +60,4 @@ fun main () =
       | _ => (print "Bad command-line arguments\n";
              OS.Process.failure)
 
-val _ = OS.Process.exit (main ())
\ No newline at end of file
+val _ = OS.Process.exit (main ())