New member madness\!
[hcoop/zz_old/portal.git] / pref.mlt
index f4ba6fb..0f908d6 100644 (file)
--- a/pref.mlt
+++ b/pref.mlt
@@ -1,4 +1,6 @@
 <% val you = Init.getUserId ();
+val yourname = Init.getUserName ();
+val youremail = yourname ^ "@hcoop.net";
 
 @header [("title", ["Member preferences"])];
 
@@ -7,7 +9,21 @@ if $"cmd" = "mod" then
                Pref.setDirectory you
        else
                Pref.unsetDirectory you
-       end
+       end;
+
+       if not (iff $"discuss" = "on" then
+                       Pref.subscribe ("hcoop-discuss", youremail)
+                   else
+                       Pref.unsubscribe ("hcoop-discuss", youremail)) then
+               %><h3><b>Error setting <tt>hcoop-discuss</tt> status</b></h3><%
+       end;
+
+       if not (iff $"misc" = "on" then
+                       Pref.subscribe ("hcoop-misc", youremail)
+                   else
+                       Pref.unsubscribe ("hcoop-misc", youremail)) then
+               %><h3><b>Error setting <tt>hcoop-misc</tt> status</b></h3><%
+       end;
 
        %><h3><b>Preferences updated</b></h3><%
 end %>
@@ -15,7 +31,9 @@ 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 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 align="right"><input type="checkbox" name="discuss"<% if Pref.subscribed ("hcoop-discuss", youremail) then %> checked<% end %>></td> <td>Include me on the <tt>hcoop-discuss</tt> mailing list. <i>(On-topic discussion and sporadically high volume)</i></td> </tr>
+<tr> <td align="right"><input type="checkbox" name="misc"<% if Pref.subscribed ("hcoop-misc", youremail) then %> checked<% end %>></td> <td>Include me on the <tt>hcoop-misc</tt> mailing list. <i>(Off-topic)</i></td> </tr>
 <tr> <td><input type="submit" value="Save"></td> </tr>
 </table>