<h3><b>Request new mailing list</b></h3>
-Enter here the e-mail address you would like for your list. Please keep in mind that the part of your list address before the "@" must be unique across all mailing lists we run. We may reject applications with overly general names here, especially names of current users or UNIX usernames that are likely to be chosen by future members. The "Reason" field is optional.
+<p>Enter here the e-mail address you would like for your list. Please keep in mind that the part of your list address before the "@" must be unique across all mailing lists we run. We may reject applications with overly general names here, especially names of current users or UNIX usernames that are likely to be chosen by future members. The "Reason" field is optional.</p>
+
+<p>If you want to use the Mailman web interface on your new list, and you want this to appear on a different web virtual host than hcoop.net, you should create a file <tt>.mailman</tt> in the domtool directory for this domain, before submitting a request. In that file, put the hostname of the vhost you want to use.</p>
<form action="list">
<table>
--- /dev/null
+<% val you = Init.getUserId ();
+
+@header [("title", ["Member preferences"])];
+
+if $"cmd" = "mod" then
+ if $"dir" = "on" then
+ Pref.setDirectory you
+ else
+ Pref.unsetDirectory you
+ end
+
+ %><h3><b>Preferences updated</b></h3><%
+end %>
+
+<form action="pref">
+<input type="hidden" name="cmd" value="mod">
+<table>
+<tr> <td align="right"><input type="checkbox" name="dir"<% if Pref.hasDirectory you then %> checked<% end %>></td> <td>Include me in the public member directory</td> </tr>
+<tr> <td><input type="submit" value="Save"></td> </tr>
+</table>
+
+<% @footer[] %>
\ No newline at end of file
--- /dev/null
+structure Gen :> GEN =
+struct
+
+structure C = PgClient
+
+val outputDir = "/var/www/home/html/static/"
+
+fun generate () =
+ let
+ val db = C.conn "dbname='hcoop'"
+
+ fun header (outf, title) =
+ (TextIO.output (outf, "<html><head>\n<title>");
+ TextIO.output (outf, title);
+ TextIO.output (outf, "</title></head>\n<body>\n<h2><b>");
+ TextIO.output (outf, title);
+ TextIO.output (outf, "</b></h2>\n"))
+
+ fun footer outf =
+ TextIO.output (outf, "\n</body></html>")
+
+ fun genMemberList () =
+ let
+ val outf = TextIO.openOut (outputDir ^ "members.html")
+
+ fun printOne ([name, rname, usr], (total, anon)) =
+ let
+ val name = C.stringFromSql name
+ val rname = C.stringFromSql rname
+ val isAnon = C.isNull usr
+ in
+ if not isAnon then
+ (TextIO.output (outf, "<tr> <td><a href=\"member/");
+ TextIO.output (outf, name);
+ TextIO.output (outf, ".html\">");
+ TextIO.output (outf, name);
+ TextIO.output (outf, "</a></td> <td>");
+ TextIO.output (outf, rname);
+ TextIO.output (outf, "</td> </tr>\n"))
+ else
+ ();
+ (total + 1, (if C.isNull usr then anon + 1 else anon))
+ end
+ | printOne _ = raise Fail "Bad printOne line"
+
+ val _ = header (outf, "Member list")
+ val _ = TextIO.output (outf, "<table>\n")
+ val (total, anon) = C.fold db printOne (0, 0)
+ "SELECT name, rname, usr FROM WebUser LEFT OUTER JOIN DirectoryPref ON id = usr ORDER BY name"
+ in
+ TextIO.output (outf, "</table><br><br>\n\nUnlisted members: ");
+ TextIO.output (outf, Int.toString anon);
+ TextIO.output (outf, " out of ");
+ TextIO.output (outf, Int.toString total);
+ TextIO.output (outf, " total.\n");
+ footer outf;
+ TextIO.closeOut outf
+ end
+ in
+ genMemberList ();
+ OS.Process.success
+ end
+
+fun main _ = (generate ())
+ handle ex => (print "Exception!\n";
+ OS.Process.failure)
+
+end
\ No newline at end of file