You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2006/03/02 04:17:43 UTC

svn commit: r382260 - in /incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi: AtomServlet.java RollerAtomHandler.java

Author: snoopdave
Date: Wed Mar  1 19:17:41 2006
New Revision: 382260

URL: http://svn.apache.org/viewcvs?rev=382260&view=rev
Log:
Fix for timezone and start/end of day logic

Modified:
    incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/AtomServlet.java
    incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java

Modified: incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/AtomServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/AtomServlet.java?rev=382260&r1=382259&r2=382260&view=diff
==============================================================================
--- incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/AtomServlet.java (original)
+++ incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/AtomServlet.java Wed Mar  1 19:17:41 2006
@@ -133,6 +133,7 @@
                 mLogger.error(e);
             }
         } else {
+            res.setHeader("WWW-Authenticate", "Roller realm");
             res.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
         }
     }
@@ -196,6 +197,7 @@
                 mLogger.error(e);
             }
         } else {
+            res.setHeader("WWW-Authenticate", "Roller realm");
             res.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
         }
     }
@@ -246,6 +248,7 @@
                 mLogger.error(e);
             }
         } else {
+            res.setHeader("WWW-Authenticate", "Roller realm");
             res.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
         }
     }
@@ -276,6 +279,7 @@
                 mLogger.error(e);
             }
         } else {
+            res.setHeader("WWW-Authenticate", "Roller realm");
             res.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
         }
     }

Modified: incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java?rev=382260&r1=382259&r2=382260&view=diff
==============================================================================
--- incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java (original)
+++ incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java Wed Mar  1 19:17:41 2006
@@ -139,7 +139,7 @@
                     PermissionsData perm = (PermissionsData)iter.next();
                     String handle = perm.getWebsite().getHandle();
                     AtomService.Workspace workspace = new AtomService.Workspace();
-                    workspace.setTitle("Weblog: " + handle);
+                    workspace.setTitle(Utilities.removeHTML(perm.getWebsite().getName()));
                     service.addWorkspace(workspace);
                     
                     AtomService.Collection entryCol = new AtomService.Collection();
@@ -210,6 +210,7 @@
                     start,             // offset (for range paging)
                     max + 1);          // maxEntries
             Feed feed = new Feed();
+            feed.setTitle("Entries for blog[" + handle + "]");
             List atomEntries = new ArrayList();
             int count = 0;
             for (Iterator iter = entries.iterator(); iter.hasNext() && count < mMaxEntries; count++) {
@@ -561,13 +562,14 @@
     }
     
     /**
-     * Return true if user is allowed to edit a website.
+     * Return true if user is allowed to create/edit entries and resources in weblog.
      */
     private boolean canEdit(WebsiteData website) {
         try {
-            return website.canSave();
+            UserData user = mRoller.getUser();
+            return website.hasUserPermissions(user, PermissionsData.AUTHOR);
         } catch (Exception e) {
-            mLogger.error("ERROR: checking website.canSave()");
+            mLogger.error("ERROR: checking website.hasUserPermissions()");
         }
         return false;
     }