From: Adam Chlipala Date: Wed, 5 Oct 2005 14:42:16 +0000 (+0000) Subject: Only include paying members in public directory X-Git-Url: http://git.hcoop.net/hcoop/portal.git/commitdiff_plain/711b47a19a972d90b91378473c853573099a794b?ds=sidebyside Only include paying members in public directory --- diff --git a/apps.mlt b/apps.mlt index 4594588..3a26e41 100644 --- a/apps.mlt +++ b/apps.mlt @@ -88,9 +88,9 @@ elseif $"add" <> "" then App.add id %> First, create this UNIX user: -
portal_adduser <% #name appl %> "<% #rname appl %>"<% if #forward appl then %>" <% #email appl %>"<% end %>
+
portal_adduser <% #name appl %> "<% #rname appl %>"<% if #forward appl then %> "<% #email appl %>"<% end %>
-

You should then run visudo to add <% #name appl %> to the MEMBERS group. If you're not transmitting <% #name appl %>'s password to him by other means, run savepass <% #name appl %> <password> to save it in ~<% #name appl %>/.pass.

+

You should then run visudo to add <% #name appl %> to the MEMBERS group. If you're not transmitting <% #name appl %>'s password to him by other means, run savepass <% #name appl %> <password> to save it in ~<% #name appl %>/.pass. If <% #name appl %> is bootstrapping with public-key ssh, don't forget to run savekey <% #name appl %> <authorized_keys file location>.

diff --git a/static/gen.sml b/static/gen.sml index 272e785..5795af3 100644 --- a/static/gen.sml +++ b/static/gen.sml @@ -53,7 +53,7 @@ fun generate () = val _ = header (outf, "Member list") val _ = TextIO.output (outf, "\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" + "SELECT name, rname, usr FROM WebUserPaying LEFT OUTER JOIN DirectoryPref ON id = usr ORDER BY name" in TextIO.output (outf, "


\n\nUnlisted members: "); TextIO.output (outf, Int.toString anon); @@ -190,7 +190,7 @@ fun generate () = | 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" + C.app db doOne "SELECT id, name, rname, joined, usr FROM WebUserPaying LEFT OUTER JOIN DirectoryPref ON usr = id" end fun genLocations () = @@ -271,8 +271,8 @@ fun generate () = | doLink _ = raise Fail "Bad link' row" val links = C.map db doLink (String.concat ["SELECT url, title, descr, name FROM Link", - " JOIN WebUser ON WebUser.id = usr", - " JOIN DirectoryPref ON WebUser.id = DirectoryPref.usr", + " JOIN WebUserPaying ON WebUserPaying.id = usr", + " JOIN DirectoryPref ON WebUserPaying.id = DirectoryPref.usr", " ORDER BY title"]) fun appLink (url, title, descr, name) = diff --git a/tables.sql b/tables.sql index 97a890c..7054c74 100644 --- a/tables.sql +++ b/tables.sql @@ -247,6 +247,14 @@ CREATE TABLE AppVote( FOREIGN KEY (app) REFERENCES MemberApp(id) ON DELETE CASCADE, FOREIGN KEY (usr) REFERENCES WebUser(id) ON DELETE CASCADE); +CREATE VIEW WebUserPaying + AS SELECT id, name, rname, bal, joined, app + FROM WebUser + JOIN (SELECT usr FROM Membership JOIN WebGroup + ON grp = WebGroup.id + AND WebGroup.name = 'paying') + ON usr = WebUser.id; + CREATE VIEW WebUserActive AS SELECT id, name, rname, bal, joined, app FROM WebUser