Join script should rule out retired usernames
[bpt/portal.git] / static / gen.sml
index 2d595c4..3ca57e8 100644 (file)
@@ -10,7 +10,7 @@ end
 
 structure NM = BinaryMapFn(IntKey)
 
-val outputDir = "/var/www/dyn/"
+val outputDir = "/home/hcoop/public_html/dyn/"
 
 fun generate () =
     let
@@ -236,7 +236,7 @@ fun generate () =
                                addToParents (#loc lives, count)
                            end
                    in
-                       C.fold db folder NM.empty "SELECT loc, usr FROM Lives"
+                       C.fold db folder NM.empty "SELECT loc, usr FROM Lives JOIN WebUserActive ON id = usr"
                    end
 
                val res = countResidents ()
@@ -316,10 +316,18 @@ fun main _ = (generate ())
     handle
     C.Sql s => (print "SQL exception: \n";
                print s;
+               print "\n";
                OS.Process.failure)
   | Fail s => (print "Fail: ";
               print s;
+              print "\n";
               OS.Process.failure)
+  | IO.Io {name, function, ...} => (print "IO exception ";
+                                   print function;
+                                   print ": ";
+                                   print name;
+                                   print "\n";
+                                   OS.Process.failure)
   | ex => (print "Exception!\n";
                  List.app (fn s => print (s ^ "\n")) (SMLofNJ.exnHistory ex);
                  OS.Process.failure)