r9896 - apps/gobi/trunk/code/Updates

[email protected] Tue, 15 Sep 2009 00:27:46 +0200 (CEST)
Newsgroups gmane.comp.java.helma.cvs
Message-ID <20090914222746.985EE3D0E3@mia>
Author: hannes
Date: 2009-09-15 00:27:46 +0200 (Tue, 15 Sep 2009)
New Revision: 9896

Modified:
   apps/gobi/trunk/code/Updates/Updates.js
Log:
Re-add access checks and fix some more bugs

Details at http://dev.helma.org/trac/helma/changeset/9896

Modified: apps/gobi/trunk/code/Updates/Updates.js
===================================================================
--- apps/gobi/trunk/code/Updates/Updates.js	2009-09-14 22:19:22 UTC (rev 9895)
+++ apps/gobi/trunk/code/Updates/Updates.js	2009-09-14 22:27:46 UTC (rev 9896)
@@ -90,23 +90,29 @@
         if (first) {
             month = day.substring(0, 7);
             first = false;
-        }
-        if (day != lastDay) {
-            date = day.toDate("yyyy.MM.dd");
-            lastDay = day;
-            with (JavaImporter(java.text.DateFormat)) {
-                var header = Html.H3({}, DateFormat.getDateInstance(DateFormat.LONG).format(date));
-                table.resetToEven();
-                table.write(header, {colspan: 4, "class": "even"});
+            if (!req.data.day && !req.data.month) {
+                pattern = new RegExp(month);
             }
-            table.write("Time", {"class": "caption"});
-            table.write("Page", {"class": "caption"});
-            table.write("Author", {"class": "caption"});
-            table.write("Change", {"class": "caption"});
         }
         var links = group.list().reverse();
         for (var j in links) {
             var link = links[j];
+            if (!link.target || !link.target.checkAccess || !link.target.checkAccess("main")) {
+                continue;
+            }
+            if (day != lastDay) {
+                date = day.toDate("yyyy.MM.dd");
+                lastDay = day;
+                with (JavaImporter(java.text.DateFormat)) {
+                    var header = Html.H3({}, DateFormat.getDateInstance(DateFormat.LONG).format(date));
+                    table.resetToEven();
+                    table.write(header, {colspan: 4, "class": "even"});
+                }
+                table.write("Time", {"class": "caption"});
+                table.write("Page", {"class": "caption"});
+                table.write("Author", {"class": "caption"});
+                table.write("Change", {"class": "caption"});
+            }
             var time = link.type.length <= 18 ? "" : link.type.substring(18);
             if (time && time.length == 8)
                 table.write(timeFormat.format(time.toDate("HH.mm.ss")));