Only include paying members in public directory
authoradamch <adamch>
Wed, 5 Oct 2005 14:42:16 +0000 (14:42 +0000)
committeradamch <adamch>
Wed, 5 Oct 2005 14:42:16 +0000 (14:42 +0000)
apps.mlt
static/gen.sml
tables.sql

index 4594588..3a26e41 100644 (file)
--- a/apps.mlt
+++ b/apps.mlt
@@ -88,9 +88,9 @@ elseif $"add" <> "" then
        App.add id %>
 
 First, create this UNIX user:
-<blockquote><tt>portal_adduser <% #name appl %> "<% #rname appl %>"<% if #forward appl then %><% #email appl %>"<% end %></tt></blockquote>
+<blockquote><tt>portal_adduser <% #name appl %> "<% #rname appl %>"<% if #forward appl then %> "<% #email appl %>"<% end %></tt></blockquote>
 
-<p>You should then run <tt>visudo</tt> to add <% #name appl %> to the <tt>MEMBERS</tt> group.  If you're not transmitting <% #name appl %>'s password to him by other means, run <tt>savepass <% #name appl %> &lt;password&gt;</tt> to save it in <tt>~<% #name appl %>/.pass</tt>.</p>
+<p>You should then run <tt>visudo</tt> to add <% #name appl %> to the <tt>MEMBERS</tt> group.  If you're not transmitting <% #name appl %>'s password to him by other means, run <tt>savepass <% #name appl %> &lt;password&gt;</tt> to save it in <tt>~<% #name appl %>/.pass</tt>.  If <% #name appl %> is bootstrapping with public-key ssh, don't forget to run <tt>savekey <% #name appl %> &lt;authorized_keys file location&gt;</tt>.</p>
 
 <form action="users" method="post">
 <input type="hidden" name="app" value="<% #id appl %>">
index 272e785..5795af3 100644 (file)
@@ -53,7 +53,7 @@ fun generate () =
                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"
+                                          "SELECT name, rname, usr FROM WebUserPaying 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);
@@ -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) = 
index 97a890c..7054c74 100644 (file)
@@ -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