roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r265546 - in /incubator/roller/branches/roller_2.0: ./ nbproject/ src/org/roller/pojos/ src/org/roller/presentation/tags/menu/ src/org/roller/presentation/website/actions/ tools/buildtime/tomcat-4.1.24/ tools/buildtime/tomcat-5.0.28/ web/WE...
Date Wed, 31 Aug 2005 18:46:50 GMT
Author: snoopdave
Date: Wed Aug 31 11:46:21 2005
New Revision: 265546

URL: http://svn.apache.org/viewcvs?rev=265546&view=rev
Log:
Global admins can now edit any weblog

Added:
    incubator/roller/branches/roller_2.0/tools/buildtime/tomcat-5.0.28/
    incubator/roller/branches/roller_2.0/tools/buildtime/tomcat-5.0.28/jsp-api.jar   (with
props)
    incubator/roller/branches/roller_2.0/tools/buildtime/tomcat-5.0.28/servlet-api.jar   (with
props)
Removed:
    incubator/roller/branches/roller_2.0/tools/buildtime/tomcat-4.1.24/
Modified:
    incubator/roller/branches/roller_2.0/build.sh
    incubator/roller/branches/roller_2.0/nbproject/project.xml
    incubator/roller/branches/roller_2.0/properties.xmlf
    incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteData.java
    incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserAdminAction.java
    incubator/roller/branches/roller_2.0/web/WEB-INF/classes/ApplicationResources.properties
    incubator/roller/branches/roller_2.0/web/website/UserAdmin.jsp

Modified: incubator/roller/branches/roller_2.0/build.sh
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/build.sh?rev=265546&r1=265545&r2=265546&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/build.sh (original)
+++ incubator/roller/branches/roller_2.0/build.sh Wed Aug 31 11:46:21 2005
@@ -13,4 +13,4 @@
 rocp=${rocp}:./tools/buildtime/ant-1.6.2/jakarta-oro-2.0.8.jar
 rocp=${rocp}:./tools/buildtime/junit-3.8.1.jar
 
-${JAVA_HOME}/bin/java -Djava.home=${JAVA_HOME} -classpath ${rocp} org.apache.tools.ant.Main
$1 $2 $3 $4 $5
+${JAVA_HOME}/bin/java -Xmx300m -Djava.home=${JAVA_HOME} -classpath ${rocp} org.apache.tools.ant.Main
$1 $2 $3 $4 $5

Modified: incubator/roller/branches/roller_2.0/nbproject/project.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/nbproject/project.xml?rev=265546&r1=265545&r2=265546&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/nbproject/project.xml (original)
+++ incubator/roller/branches/roller_2.0/nbproject/project.xml Wed Aug 31 11:46:21 2005
@@ -145,7 +145,7 @@
                 <package-root>sandbox/standalone/src</package-root>
                 <package-root>tests</package-root>
                 <package-root>contrib/plugins/src</package-root>
-                <classpath mode="compile">tools/hibernate-2.1/lib/jdom.jar:tools/buildtime/junit-3.8.1.jar:tools/lib/activation.jar:tools/lib/commons-betwixt-1.0-beta-1.jar:tools/lib/commons-codec-1.1.jar:tools/lib/commons-httpclient-2.0.2.jar:tools/lib/concurrent-1.3.2.jar:tools/lib/ekitapplet.jar:tools/lib/jazzy-core.jar:tools/lib/log4j-1.2.4.jar:tools/lib/lucene-1.4.3.jar:tools/lib/mail.jar:tools/lib/mm.mysql-2.0.14-bin.jar:tools/lib/rome-0.6.jar:tools/lib/rome-fetcher-0.6.jar:tools/lib/taglibs-string.jar:tools/lib/velocity-1.4.jar:tools/lib/velocity-dep-1.4.jar:tools/lib/velocity-tools-1.1.jar:tools/lib/xmlrpc-1.2-b1.jar:tools/struts-1.2.4/lib/antlr.jar:tools/struts-1.2.4/lib/commons-beanutils.jar:tools/struts-1.2.4/lib/commons-collections.jar:tools/struts-1.2.4/lib/commons-digester.jar:tools/struts-1.2.4/lib/commons-fileupload.jar:tools/struts-1.2.4/lib/commons-lang-2.0.jar:tools/struts-1.2.4/lib/commons-logging.jar:tools/struts-1.2.4/lib/commons-validator.jar:tools/struts-1.2.4/lib/jakarta-oro.jar:tools/struts-1.2.4/lib/struts-el.jar:tools/struts-1.2.4/lib/struts.jar:tools/hibernate-2.1/hibernate2.jar:tools/hibernate-2.1/lib/c3p0-0.8.4.5.jar:tools/hibernate-2.1/lib/cglib-full-2.0.1.jar:tools/hibernate-2.1/lib/dom4j-1.4.jar:tools/hibernate-2.1/lib/ehcache-0.7.jar:tools/hibernate-2.1/lib/jta.jar:tools/hibernate-2.1/lib/odmg-3.0.jar:tools/hibernate-2.1/lib/proxool-0.8.3.jar:tools/hibernate-2.1/lib/xalan-2.4.0.jar:tools/buildtime/tomcat-4.1.24/servlet-api.jar:tools/buildtime/tomcat-4.1.24/jasper-runtime.jar:tools/buildtime/mockrunner-0.35/lib/mockrunner-servlet.jar:tools/buildtime/mockrunner-0.35/lib/mockrunner-struts.jar:tools/buildtime/mockrunner-0.35/lib/mockrunner.jar:tools/buildtime/mockrunner-0.35/lib/nekohtml.jar:tools/standard-1.0.3/lib/jaxen-full.jar:tools/standard-1.0.3/lib/jstl.jar:tools/standard-1.0.3/lib/standard.jar</classpath>
+                <classpath mode="compile">tools/hibernate-2.1/lib/jdom.jar:tools/buildtime/junit-3.8.1.jar:tools/lib/activation.jar:tools/lib/commons-betwixt-1.0-beta-1.jar:tools/lib/commons-codec-1.1.jar:tools/lib/commons-httpclient-2.0.2.jar:tools/lib/concurrent-1.3.2.jar:tools/lib/ekitapplet.jar:tools/lib/jazzy-core.jar:tools/lib/log4j-1.2.4.jar:tools/lib/lucene-1.4.3.jar:tools/lib/mail.jar:tools/lib/mm.mysql-2.0.14-bin.jar:tools/lib/rome-0.6.jar:tools/lib/rome-fetcher-0.6.jar:tools/lib/taglibs-string.jar:tools/lib/velocity-1.4.jar:tools/lib/velocity-dep-1.4.jar:tools/lib/velocity-tools-1.1.jar:tools/lib/xmlrpc-1.2-b1.jar:tools/struts-1.2.4/lib/antlr.jar:tools/struts-1.2.4/lib/commons-beanutils.jar:tools/struts-1.2.4/lib/commons-collections.jar:tools/struts-1.2.4/lib/commons-digester.jar:tools/struts-1.2.4/lib/commons-fileupload.jar:tools/struts-1.2.4/lib/commons-lang-2.0.jar:tools/struts-1.2.4/lib/commons-logging.jar:tools/struts-1.2.4/lib/commons-validator.jar:tools/struts-1.2.4/lib/jakarta-oro.jar:tools/struts-1.2.4/lib/struts-el.jar:tools/struts-1.2.4/lib/struts.jar:tools/hibernate-2.1/hibernate2.jar:tools/hibernate-2.1/lib/c3p0-0.8.4.5.jar:tools/hibernate-2.1/lib/cglib-full-2.0.1.jar:tools/hibernate-2.1/lib/dom4j-1.4.jar:tools/hibernate-2.1/lib/ehcache-0.7.jar:tools/hibernate-2.1/lib/jta.jar:tools/hibernate-2.1/lib/odmg-3.0.jar:tools/hibernate-2.1/lib/proxool-0.8.3.jar:tools/hibernate-2.1/lib/xalan-2.4.0.jar:tools/buildtime/mockrunner-0.35/lib/mockrunner-servlet.jar:tools/buildtime/mockrunner-0.35/lib/mockrunner-struts.jar:tools/buildtime/mockrunner-0.35/lib/mockrunner.jar:tools/buildtime/mockrunner-0.35/lib/nekohtml.jar:tools/standard-1.0.3/lib/jaxen-full.jar:tools/standard-1.0.3/lib/jstl.jar:tools/standard-1.0.3/lib/standard.jar:tools/buildtime/tomcat-5.0.28/servlet-api.jar:tools/buildtime/tomcat-5.0.28/jsp-api.jar</classpath>
                 <source-level>1.4</source-level>
             </compilation-unit>
         </java-data>

Modified: incubator/roller/branches/roller_2.0/properties.xmlf
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/properties.xmlf?rev=265546&r1=265545&r2=265546&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/properties.xmlf (original)
+++ incubator/roller/branches/roller_2.0/properties.xmlf Wed Aug 31 11:46:21 2005
@@ -17,7 +17,7 @@
 <property name="tools.hibernate"     value="${ro.tools}/hibernate-2.1" />
 <property name="tools.jstl"          value="${ro.tools}/standard-1.0.3" />
 <property name="tools.xdoclet"    value="${ro.tools}/buildtime/xdoclet-1.2" />
-<property name="tools.tomcat"     value="${ro.tools}/buildtime/tomcat-4.1.24" />
+<property name="tools.tomcat"     value="${ro.tools}/buildtime/tomcat-5.0.28" />
 
 <!--
 If you would like Ant to copy all the jar files that Resin needs
@@ -74,6 +74,7 @@
 
 <fileset id="servlet.jars" dir="${tools.tomcat}">
     <include name="servlet-api.jar"/>
+    <include name="jsp-api.jar"/>
 </fileset>
 
 <fileset id="mail.jars" dir="${ro.tools}/lib">
@@ -161,11 +162,10 @@
           <include name="*.jar"/>
        </fileset>
     </path>
+    <fileset refid="servlet.jars"/>
     <path location="${ro.tools}/buildtime/ant-1.6.2/ant.jar"/>
     <path location="${ro.tools}/buildtime/strutstest-2.0.0.jar"/>
     <path location="${ro.tools}/buildtime/hsqldb.jar"/>
-    <path location="${ro.tools}/buildtime/tomcat-4.1.24/servlet-api.jar"/> 
-    <path location="${ro.tools}/buildtime/tomcat-4.1.24/jasper-runtime.jar"/> 
     <path location="${ro.tools}/lib/mm.mysql-2.0.14-bin.jar"/>
 </path>
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteData.java?rev=265546&r1=265545&r2=265546&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteData.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteData.java Wed Aug 31
11:46:21 2005
@@ -961,6 +961,7 @@
      */
     public boolean hasUserPermissions(UserData user, short mask)
     {
+        // look for user in website's permissions
         PermissionsData userPerms = null;
         Iterator iter = getPermissions().iterator();
         while (iter.hasNext())
@@ -972,6 +973,7 @@
                 break;
             }
         }
+        // if we found one, does it satisfy the mask?
         if (userPerms != null && !userPerms.isPending())
         {
             if (userPerms != null && (userPerms.getPermissionMask() & mask) ==
mask) 
@@ -979,6 +981,8 @@
                 return true;
             }
         }
+        // otherwise, check to see if user is a global admin
+        if (user != null && user.hasRole("admin")) return true;
         return false;
     }
     

Modified: incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java?rev=265546&r1=265545&r2=265546&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java Wed Aug 31
11:46:21 2005
@@ -19,7 +19,7 @@
             return true;
         }
         if (getWebsite().hasUserPermissions(
-           roller.getUser(), (short)(PermissionsData.AUTHOR)))
+                roller.getUser(), PermissionsData.AUTHOR))
         {
             return true;
         }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java?rev=265546&r1=265545&r2=265546&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java
Wed Aug 31 11:46:21 2005
@@ -114,9 +114,11 @@
                 return false;
             }
         }
-        RollerSession rollerSession = RollerSession.getRollerSession(req);
+        RollerSession rses = RollerSession.getRollerSession(req);
         RollerRequest rreq = RollerRequest.getRollerRequest(req);
         boolean ret = true;
+        
+        if (rses != null && rses.isGlobalAdminUser()) return true;
    
         // next, make sure that users role permits it
         if (mRoles != null && mRoles.size() > 0)
@@ -126,10 +128,7 @@
             while (roles.hasNext())
             {
                 String role = (String)roles.next();
-                if (    req.isUserInRole(role) || role.equals("any")
-                     || (role.equals("admin") 
-                             && rollerSession != null 
-                             && rollerSession.isGlobalAdminUser()))  
+                if (req.isUserInRole(role) || role.equals("any"))  
                 {
                     ret = true;
                     break;
@@ -141,7 +140,7 @@
         if (ret && mPerms != null && mPerms.size() > 0)
         {
             UserData user = null;
-            if (rollerSession != null) user = rollerSession.getAuthenticatedUser();
+            if (rses != null) user = rses.getAuthenticatedUser();
             
             WebsiteData website = rreq.getWebsite();
             BasePageModel pageModel = (BasePageModel)req.getAttribute("model");
@@ -153,8 +152,8 @@
             PermissionsData permsData = null;
             if (user != null && website != null) 
             {
-                permsData =
-                    RollerFactory.getRoller().getUserManager().getPermissions(website, user);
+                permsData = RollerFactory.getRoller()
+                               .getUserManager().getPermissions(website, user);
             }
             ret = false;
             Iterator perms = mPerms.iterator();

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserAdminAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserAdminAction.java?rev=265546&r1=265545&r2=265546&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserAdminAction.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserAdminAction.java
Wed Aug 31 11:46:21 2005
@@ -3,6 +3,7 @@
 
 import java.io.IOException;
 import java.text.MessageFormat;
+import java.util.ArrayList;
 import java.util.List;
 
 import javax.servlet.ServletException;
@@ -18,6 +19,7 @@
 import org.apache.struts.action.ActionMessages;
 import org.roller.RollerException;
 import org.roller.model.IndexManager;
+import org.roller.model.Roller;
 import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.pojos.UserData;
@@ -59,17 +61,16 @@
         ActionMessages msgs = new ActionMessages();
         try
         {
+            UserData user = null;
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
             RollerSession rollerSession = RollerSession.getRollerSession(request);
             if (rollerSession.isGlobalAdminUser() )
             {
                 UserAdminForm userForm = (UserAdminForm)actionForm;
-                request.setAttribute("model", 
-                  new UserAdminPageModel(request, response, mapping, userForm));
                 UserManager mgr = RollerFactory.getRoller().getUserManager();           
    
                 if (userForm != null && userForm.getUserName() != null)
                 {
-                    UserData user = mgr.getUser(userForm.getUserName(), null);          
         
+                    user = mgr.getUser(userForm.getUserName(), null);                   

                     if (user != null)
                     {
                         userForm.copyFrom(user, request.getLocale());                   
    
@@ -84,6 +85,8 @@
                         userForm.setUserName("");
                     }
                 }
+                request.setAttribute("model", new UserAdminPageModel(
+                        request, response, mapping, userForm, user));
             }
             else
             {
@@ -291,14 +294,23 @@
     public class UserAdminPageModel extends BasePageModel 
     {
         private UserAdminForm userAdminForm = null;
+        private List permissions = new ArrayList();
+        
         public UserAdminPageModel(
             HttpServletRequest request,
             HttpServletResponse response,
             ActionMapping mapping,
-            UserAdminForm form)
+            UserAdminForm form,
+            UserData user) throws RollerException
         {
             super("dummy", request, response, mapping);
             userAdminForm = form;
+            
+            if (user != null)
+            {
+                Roller roller = RollerFactory.getRoller();
+                permissions = roller.getUserManager().getAllPermissions(user);
+            }
         }
         public String getTitle() 
         {
@@ -309,6 +321,14 @@
             return MessageFormat.format(
                     bundle.getString("userAdmin.title.editUser"), 
                     new String[] { userAdminForm.getUserName() } );
+        }
+        public List getPermissions()
+        {
+            return permissions;
+        }
+        public void setPermissions(List permissions)
+        {
+            this.permissions = permissions;
         }
     }
 }

Added: incubator/roller/branches/roller_2.0/tools/buildtime/tomcat-5.0.28/jsp-api.jar
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tools/buildtime/tomcat-5.0.28/jsp-api.jar?rev=265546&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/roller/branches/roller_2.0/tools/buildtime/tomcat-5.0.28/jsp-api.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/roller/branches/roller_2.0/tools/buildtime/tomcat-5.0.28/servlet-api.jar
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tools/buildtime/tomcat-5.0.28/servlet-api.jar?rev=265546&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/roller/branches/roller_2.0/tools/buildtime/tomcat-5.0.28/servlet-api.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/ApplicationResources.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/ApplicationResources.properties?rev=265546&r1=265545&r2=265546&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/ApplicationResources.properties
(original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/ApplicationResources.properties
Wed Aug 31 11:46:21 2005
@@ -1050,7 +1050,14 @@
 userAdmin.saved=User settings have been saved
 userAdmin.title=User Administration
 userAdmin.userAdmin=Administrator
-userAdmin.warning=NOTE: This operation cannot be undone !!
+userAdmin.warning=NOTE: This operation cannot be undone!!
+
+userAdmin.userWeblogs=Users Weblogs
+userAdmin.userMemberOf=User is a member of the following weblog(s)
+userAdmin.userHasNoWeblogs=User is a member of no weblogs.
+userAdmin.newEntry=New Entry
+userAdmin.editEntries=Edit Entries
+userAdmin.manage=Manage
 
 userAdmin.tip.fullName=User's full name (with no HTML).
 userAdmin.tip.userName=A short one word username for the user account.\

Modified: incubator/roller/branches/roller_2.0/web/website/UserAdmin.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/website/UserAdmin.jsp?rev=265546&r1=265545&r2=265546&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/website/UserAdmin.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/website/UserAdmin.jsp Wed Aug 31 11:46:21 2005
@@ -140,6 +140,62 @@
 
     </table>
     <br />
+    
+    <h3><fmt:message key="userAdmin.userWeblogs" /></h3>
+        
+    <c:choose>
+        <c:when test="${!empty model.permissions}"> 
+   
+            <p><fmt:message key="userAdmin.userMemberOf" /></p>  
+            <table class="rollertable" style="width: 80%">
+            <c:forEach var="perms" items="${model.permissions}">
+               <tr>
+                   <td width="%30">
+                       <a href='<c:out value="${model.baseURL}" />/page/<c:out
value="${perms.website.handle}" />'>
+                           <c:out value="${perms.website.name}" /> [<c:out value="${perms.website.handle}"
/>] 
+                       </a>
+                   </td>
+                   <td width="%15">
+                       <c:url value="/editor/weblog.do" var="newEntry">
+                           <c:param name="method" value="create" />
+                           <c:param name="weblog" value="${perms.website.handle}" />
+                       </c:url>
+                       <img src='<c:url value="/images/New16.gif"/>' />
+                       <a href='<c:out value="${newEntry}" />'>
+                           <fmt:message key="userAdmin.newEntry" /></a>
+                   </td>
+                   <td width="%15">
+                       <c:url value="/editor/weblogQuery.do" var="editEntries">
+                           <c:param name="method" value="query" />
+                           <c:param name="weblog" value="${perms.website.handle}" />
+                       </c:url>
+                       <img src='<c:url value="/images/Edit16.png"/>' />
+                       <a href='<c:out value="${editEntries}" />'>
+                           <fmt:message key="userAdmin.editEntries" /></a> 
+                   </td>
+                   <td width="%15">
+                       <c:url value="/editor/website.do" var="manageWeblog">
+                           <c:param name="method" value="edit" />
+                           <c:param name="weblog" value="${perms.website.handle}" />
+                       </c:url>
+                       <img src='<c:url value="/images/Edit16.png"/>' />
+                       <a href='<c:out value="${manageWeblog}" />'>
+                           <fmt:message key="userAdmin.manage" /></a>
+                   </td>
+               </tr>
+            </c:forEach>    
+            </table>
+            
+        </c:when>
+        
+        <c:otherwise>
+            <fmt:message key="userAdmin.userHasNoWeblogs" />
+        </c:otherwise>
+        
+    </c:choose>
+    
+    <br />
+    <br />
 
     <div class="control">
        <input type="submit" value='<fmt:message key="userAdmin.save" />'/></input>



Mime
View raw message