% val you = Init.getUserId ();
val yourname = Init.getUserName ();
val youremail = yourname ^ "@hcoop.net";
@header [("title", ["Member preferences"])];
if $"cmd" = "mod" then
val you_all = Init.getUser ();
Init.modUser {you_all with
paypal = (case $"paypal" of "" => NONE | s => SOME s),
checkout = (case $"checkout" of "" => NONE | s => SOME s)};
if $"dir" = "on" then
Pref.setDirectory you
else
Pref.unsetDirectory you
end;
if not (iff $"discuss" = "on" then
Pref.subscribe ("hcoop-discuss", youremail)
else
Pref.unsubscribe ("hcoop-discuss", youremail)) then
%>
Error setting hcoop-discuss status
<%
end;
if not (iff $"help" = "on" then
Pref.subscribe ("hcoop-help", youremail)
else
Pref.unsubscribe ("hcoop-help", youremail)) then
%>Error setting hcoop-help status
<%
end;
if not (iff $"misc" = "on" then
Pref.subscribe ("hcoop-misc", youremail)
else
Pref.unsubscribe ("hcoop-misc", youremail)) then
%>Error setting hcoop-misc status
<%
end;
if not (iff $"sysadmin" = "on" then
Pref.subscribe ("hcoop-sysadmin", youremail)
else
Pref.unsubscribe ("hcoop-sysadmin", youremail)) then
%>Error setting hcoop-sysadmin status
<%
end;
%>Preferences updated
<%
end;
val you_all = Init.lookupUser you %>