maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r441617 - in /maven/shared/trunk/maven-user: maven-user-acegi/src/main/java/org/apache/maven/user/acegi/ maven-user-controller/src/main/java/org/apache/maven/user/controller/action/ maven-user-controller/src/main/resources/org/apache/maven/...
Date Fri, 08 Sep 2006 19:10:30 GMT
Author: carlos
Date: Fri Sep  8 12:10:30 2006
New Revision: 441617

URL: http://svn.apache.org/viewvc?view=rev&rev=441617
Log:
Add support for edit my account

Added:
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/myAccount.jsp   (with
props)
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/userForm.jsp   (with
props)
Modified:
    maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/AcegiUserManager.java
    maven/shared/trunk/maven-user/maven-user-controller/src/main/java/org/apache/maven/user/controller/action/EditUserAction.java
    maven/shared/trunk/maven-user/maven-user-controller/src/main/resources/org/apache/maven/user/webapp/xwork.xml
    maven/shared/trunk/maven-user/maven-user-model/src/main/java/org/apache/maven/user/model/UserManager.java
    maven/shared/trunk/maven-user/maven-user-model/src/main/java/org/apache/maven/user/model/impl/DefaultUserManager.java
    maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/edit.jsp

Modified: maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/AcegiUserManager.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/AcegiUserManager.java?view=diff&rev=441617&r1=441616&r2=441617
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/AcegiUserManager.java
(original)
+++ maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/AcegiUserManager.java
Fri Sep  8 12:10:30 2006
@@ -162,4 +162,9 @@
     {
         getUserManager().updateUserGroup( userGroup );
     }
+    
+    public User getMyUser()
+    {
+        return getUserManager().getMyUser();
+    }
 }

Modified: maven/shared/trunk/maven-user/maven-user-controller/src/main/java/org/apache/maven/user/controller/action/EditUserAction.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-controller/src/main/java/org/apache/maven/user/controller/action/EditUserAction.java?view=diff&rev=441617&r1=441616&r2=441617
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-controller/src/main/java/org/apache/maven/user/controller/action/EditUserAction.java
(original)
+++ maven/shared/trunk/maven-user/maven-user-controller/src/main/java/org/apache/maven/user/controller/action/EditUserAction.java
Fri Sep  8 12:10:30 2006
@@ -179,6 +179,17 @@
 
         return INPUT;
     }
+    
+    public String editMe()
+        throws Exception
+    {
+        addMode = false;
+        user = userManager.getMyUser();
+        username = user.getUsername();
+        email = user.getEmail();
+    
+        return INPUT;
+    }
 
     public String doGetAvailablePermissions()
         throws Exception

Modified: maven/shared/trunk/maven-user/maven-user-controller/src/main/resources/org/apache/maven/user/webapp/xwork.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-controller/src/main/resources/org/apache/maven/user/webapp/xwork.xml?view=diff&rev=441617&r1=441616&r2=441617
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-controller/src/main/resources/org/apache/maven/user/webapp/xwork.xml
(original)
+++ maven/shared/trunk/maven-user/maven-user-controller/src/main/resources/org/apache/maven/user/webapp/xwork.xml
Fri Sep  8 12:10:30 2006
@@ -17,6 +17,16 @@
     <action name="list" class="listUsers">
       <result name="success">/user/list.jsp</result>
     </action>
+    
+    <action name="myAccount" class="editUser" method="editMe">
+      <result name="input">/user/edit.jsp</result>
+      <result name="success" type="chain">list</result>
+    </action>
+    
+    <action name="saveAccount" class="editUser">
+      <result name="input">/user/edit.jsp</result>
+      <result name="success">/user/edit.jsp</result>
+    </action>
 
   </package>
 </xwork>

Modified: maven/shared/trunk/maven-user/maven-user-model/src/main/java/org/apache/maven/user/model/UserManager.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-model/src/main/java/org/apache/maven/user/model/UserManager.java?view=diff&rev=441617&r1=441616&r2=441617
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-model/src/main/java/org/apache/maven/user/model/UserManager.java
(original)
+++ maven/shared/trunk/maven-user/maven-user-model/src/main/java/org/apache/maven/user/model/UserManager.java
Fri Sep  8 12:10:30 2006
@@ -224,4 +224,11 @@
      */
     List getUsersInstancePermissions();
 
+    /**
+     * Get current user
+     * 
+     * @return null if the user doesn't exist
+     */
+    User getMyUser();
+
 }

Modified: maven/shared/trunk/maven-user/maven-user-model/src/main/java/org/apache/maven/user/model/impl/DefaultUserManager.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-model/src/main/java/org/apache/maven/user/model/impl/DefaultUserManager.java?view=diff&rev=441617&r1=441616&r2=441617
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-model/src/main/java/org/apache/maven/user/model/impl/DefaultUserManager.java
(original)
+++ maven/shared/trunk/maven-user/maven-user-model/src/main/java/org/apache/maven/user/model/impl/DefaultUserManager.java
Fri Sep  8 12:10:30 2006
@@ -337,4 +337,9 @@
         }
         return usersInstancePermissions;
     }
+
+    public User getMyUser()
+    {
+        return getUser( userHolder.getCurrentUserName() );
+    }
 }

Modified: maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/edit.jsp
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/edit.jsp?view=diff&rev=441617&r1=441616&r2=441617
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/edit.jsp (original)
+++ maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/edit.jsp Fri Sep
 8 12:10:30 2006
@@ -1,6 +1,7 @@
 <%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
 <%@ taglib uri="/webwork" prefix="ww" %>
 <%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>
+<%@ taglib uri="http://acegisecurity.org/authz" prefix="authz" %>
 <script>
   function getData() {
     var addMode_field = document.getElementById('addMode_field');
@@ -44,34 +45,10 @@
           <h3><ww:text name="user.edit.section.title"/></h3>
         </ww:else>
         <div class="axial">
-          <ww:form action="edit.action" method="post">
-            <c:if test="${!empty actionErrors}">
-              <div class="errormessage">
-              <c:forEach items="${actionErrors}" var="actionError">
-                <p><ww:text name="${actionError}"/></p>
-              </c:forEach>
-              </div>
-            </c:if>
-            <table>
-              <tbody>
-                <ww:hidden id="addMode_field" name="addMode"/>
-                <ww:hidden id="accountId_field" name="accountId"/>
-                <ww:if test="addMode == true">
-                  <ww:textfield id="username_field" label="%{getText('user.username')}"
name="username" required="true"/>
-                </ww:if>
-                <ww:else>
-                  <ww:hidden id="username_field" name="username"/>
-                  <ww:textfield id="username_field" label="%{getText('user.username')}"
name="username" required="true" disabled="true"/>
-                </ww:else>
-                <ww:password id="password_field" label="%{getText('user.password')}" name="password"
required="true"/>
-                <ww:password id="confirm_password_field" label="%{getText('user.confirm.password')}"
name="confirmPassword" required="true"/>
-                <ww:textfield id="email_field" label="%{getText('user.email')}" name="email"
required="true"/>
-              </tbody>
-            </table>
-            <div class="functnbar3">
-              <ww:submit value="%{getText('save')}"/> <!-- todo: change to submit/cancel
button -->
-            </div>
-          </ww:form>
+          <ww:include value="userForm.jsp">
+            <ww:param name="addMode" value="${addMode}"/>
+          </ww:include>
+        <authz:authorize ifAnyGranted="ROLE_admin,ROLE_manageUsers">
         <ww:if test="addMode == false">
           <div id="h3">
             <h3><ww:text name="role.section.title"/></h3>
@@ -110,6 +87,7 @@
             </ww:form>
           </div>
         </ww:if>
+        </authz:authorize>
         </div>
       </div>
     </body>

Added: maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/myAccount.jsp
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/myAccount.jsp?view=auto&rev=441617
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/myAccount.jsp (added)
+++ maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/myAccount.jsp Fri
Sep  8 12:10:30 2006
@@ -0,0 +1,28 @@
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
+<%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>
+<html>
+  <ww:i18n name="localization.MavenUser">
+    <head>
+      <ww:if test="addMode == true">
+        <title><ww:text name="user.add.page.title"/></title>
+      </ww:if>
+      <ww:else>
+        <title><ww:text name="user.edit.page.title"/></title>
+      </ww:else>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <ww:if test="addMode == true">
+          <h3><ww:text name="user.add.section.title"/></h3>
+        </ww:if>
+        <ww:else>
+          <h3><ww:text name="user.edit.section.title"/></h3>
+        </ww:else>
+        <ww:include value="userForm.jsp">
+          <ww:param name="addMode" value="${addMode}"/>
+        </ww:include>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

Propchange: maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/myAccount.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/myAccount.jsp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/userForm.jsp
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/userForm.jsp?view=auto&rev=441617
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/userForm.jsp (added)
+++ maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/userForm.jsp Fri
Sep  8 12:10:30 2006
@@ -0,0 +1,31 @@
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
+<%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="http://www.extremecomponents.org" prefix="ec" %>
+<ww:form action="saveAccount.action" method="post">
+  <c:if test="${!empty actionErrors}">
+    <div class="errormessage">
+    <c:forEach items="${actionErrors}" var="actionError">
+      <p><ww:text name="${actionError}"/></p>
+    </c:forEach>
+    </div>
+  </c:if>
+  <table>
+    <tbody>
+      <ww:hidden id="addMode_field" name="addMode"/>
+      <ww:hidden id="accountId_field" name="accountId"/>
+      <ww:if test="addMode == true">
+        <ww:textfield id="username_field" label="%{getText('user.username')}" name="username"
required="true"/>
+      </ww:if>
+      <ww:else>
+        <ww:hidden id="username_field" name="username"/>
+        <ww:label label="%{getText('user.username')}" name="username" required="true"/>
+      </ww:else>
+      <ww:password id="password_field" label="%{getText('user.password')}" name="password"
required="true"/>
+      <ww:password id="confirm_password_field" label="%{getText('user.confirm.password')}"
name="confirmPassword" required="true"/>
+      <ww:textfield id="email_field" label="%{getText('user.email')}" name="email" required="true"/>
+    </tbody>
+  </table>
+  <div class="functnbar3">
+    <ww:submit value="%{getText('save')}"/> <!-- todo: change to submit/cancel button
-->
+  </div>
+</ww:form>

Propchange: maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/userForm.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/shared/trunk/maven-user/maven-user-webapp/src/main/webapp/user/userForm.jsp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message