<% end %>
-<% if showNormal then %>
+<% if showNormal then
+ ref total = 0.0 %>
<h3><b>New balance</b></h3>
<form action="balances">
<h3><b>Manage current balances</b></h3>
<table>
-<% foreach balance in Balance.listBalances () do %>
+<% foreach balance in Balance.listBalances () do
+ total := Util.add (total, #amount balance) %>
<tr> <td><% Web.html (#name balance) %></td> <td><% #amount balance %></td> <td><a href="balances?mod=<% #id balance %>">[Modify]</a> <a href="balances?del=<% #id balance %>">[Delete]</a></td> </tr>
<% end %>
</table>
+<br><b>Total</b>: $<% total %>
+
<% end %>
<% @footer [] %>
val usr = #usr mem
val grp = #grp mem
in
- if userInGroupNum (usr, grp) then
- ()
- else
- ignore (C.dml (getDb ()) ($`INSERT INTO Membership (grp, usr)
- VALUES (^(C.intToSql grp), ^(C.intToSql usr))`))
+ case C.oneOrNoRows (getDb ()) ($`SELECT * FROM Membership WHERE grp = ^(C.intToSql grp) AND usr = ^(C.intToSql usr)`) of
+ NONE => ignore (C.dml (getDb ()) ($`INSERT INTO Membership (grp, usr)
+ VALUES (^(C.intToSql grp), ^(C.intToSql usr))`))
+ | SOME _ => ()
end
fun addToGroups (usr, grps) =
<title><% Web.html title %></title>
</head><body>
-<% if Group.inGroupNum 0 then %>
-<p><b>Admin</b>: <a href="users">Members</a> | <a href="groups">Groups</a> | <a href="balances">Balances</a></p>
-<% end %>
-
<h2><b><% Web.html title %></b></h2>
ref showNormal = true;
if $"cmd" = "list" then
+ val admin = Group.inGroupName "money";
showNormal := false %>
<h3><b>Transactions</b></h3>
<% foreach trn in Money.listTransactions () do %>
<tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td><% #amount trn %></td> <td><% #stamp trn %></td>
<% switch Money.listChargesWithNames (#id trn) of
- [(name, cha)] => %><td><a href="user?id=<% #usr cha %>"><% name %></a></td> </tr><%
- | _ => %><td><i>multi</i></td> </tr><%
+ [(name, cha)] => %><td><a href="user?id=<% #usr cha %>"><% name %></a></td><%
+ | _ => %><td><i>multi</i></td><%
+end;
+if admin then
+ %><td><a href="money?modHosting=<% #id trn %>">[Hosting]</a> <a href="money?modPay=<% #id trn %>">[Payment]</a> <a href="money?modEven=<% #id trn %>">[Other]</a></td>
+ <td><a href="money?del=<% #id trn %>">[Delete]</a></td><%
end
+%></tr><%
end %>
</table>
val bal = Balance.lookupBalance (#bal you);
@header [] %>
+<% if Group.inGroupNum 0 then %>
+<b><h3>Admin</h3></b>
+<a href="users">Members</a><br>
+<a href="groups">Groups</a><br>
+<a href="balances">Balances</a><br>
+<a href="kind">Contact kinds</a><br>
+<% end %>
+
+<b><h3>Your account</h3></b>
+
+<a href="pref">Preferences</a><br>
+<a href="money">Financial</a><br>
+<a href="contact">Contact information</a><br>
+<a href="location">Your geographic locations</a><br>
+<a href="link">Public URL directory</a><br>
+
+<b><h3>Support requests</h3></b>
+
+<a href="domain">Request control of a domain with domtool</a><br>
+<a href="apt">Request Debian apt packages</a><br>
+<a href="list">Request a Mailman mailing list</a><br>
+<a href="support">Other support request</a><br>
+
<h3><b><a href="money">Your recent account activity</a></b></h3>
<table>
<br>
<% end %>
+<h3><b>Public pages</b></h3>
+
+<a href="http://hcoop.net/dyn/members.html">Member directory</a><br>
+<a href="http://hcoop.net/dyn/locs.html">Member location summary</a><br>
+<a href="http://hcoop.net/dyn/sites.html">URL directory</a><br>
+
+<h3><b>Miscellaneous</b></h3>
+
+<a href="apps">Review pending membership applications</a><br>
+<a href="dir">Contact information directory</a><br>
+<a href="poll">Polls</a><br>
+
<% @footer [] %>
\ No newline at end of file
structure NM = BinaryMapFn(IntKey)
-val outputDir = "/var/www/home/html/static/"
+val outputDir = "/var/www/home/html/dyn/"
fun generate () =
let
end
| doOne _ = raise Fail "Bad member row"
in
+ ignore (OS.Process.system ("/bin/rm " ^ outputDir ^ "member/*.html"));
C.app db doOne "SELECT id, name, rname, joined, usr FROM WebUser LEFT OUTER JOIN DirectoryPref ON usr = id"
end
<tr> <td align="right"><input type="checkbox" name="subscribe" checked></td> <td>Subscribe to hcoop-announce</td> </tr>
<tr> <td align="right"><b>Groups</b>:</td> <td><select name="grp" size="5" multiple>
<% foreach group in Group.listGroups () do %>
- <option value="<% #id group %>"><% Web.html (#name group) %></option>
+ <option value="<% #id group %>"<% if #name group = "paying" then %> selected<% end %>><% Web.html (#name group) %></option>
<% end %>
</select></td></tr>
<tr> <td><input type="submit" name="cmd" value="Create"></td> </tr>
val id : 'a -> 'a
val makeSet : ('a -> string) -> 'a list -> string
val neg : real -> real
+ val add : real * real -> real
val validHost : string -> bool
val validDomain : string -> bool
| usr::rest => foldl (fn (usr, s) => s ^ ", " ^ f usr) ("(" ^ f usr) rest ^ ")"
fun neg (r : real) = ~r
+fun add (r1 : real, r2) = r1 + r2
fun isIdent ch = Char.isLower ch orelse Char.isDigit ch