From f079ef8f1dd89a5e26fea952dc4cab2855abe14b Mon Sep 17 00:00:00 2001 From: Jesse McConnell Date: Wed, 13 Sep 2006 17:04:17 +0000 Subject: [PATCH] intern work on making user.jsp support user management for other people, keeping it simple for eventual integration with a more complete plexus user management git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@443023 13f79535-47bb-0310-9956-ffa450edef68 --- .../web/action/admin/NewUserAction.java | 5 +- .../action/admin/UserManagementAction.java | 23 ++++++--- .../resources/META-INF/plexus/application.xml | 50 +++++++++++++------ archiva-webapp/src/main/resources/xwork.xml | 2 +- .../webapp/WEB-INF/jsp/decorators/default.jsp | 2 +- .../src/main/webapp/WEB-INF/jsp/findUser.jsp | 4 +- .../src/main/webapp/WEB-INF/jsp/user.jsp | 10 ++-- .../main/webapp/WEB-INF/jsp/userDetails.jsp | 4 +- 8 files changed, 65 insertions(+), 35 deletions(-) diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/NewUserAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/NewUserAction.java index 8f0e70614..0f930e4c9 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/NewUserAction.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/NewUserAction.java @@ -73,7 +73,8 @@ public class NewUserAction { return INPUT; } - + +/* // TODO: use commons-validator for these fields. if ( StringUtils.isEmpty( username ) ) @@ -97,6 +98,8 @@ public class NewUserAction { addActionError( "Passwords do not match." ); } + + */ UserManager um = securitySystem.getUserManager(); diff --git a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/UserManagementAction.java b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/UserManagementAction.java index f5faaa4f5..7e796c59d 100644 --- a/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/UserManagementAction.java +++ b/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/UserManagementAction.java @@ -79,8 +79,15 @@ public class UserManagementAction { try { - user = userManager.findUser( username ); - return SUCCESS; + if ( username == null ) + { + return INPUT; + } + else + { + user = userManager.findUser( username ); + return SUCCESS; + } } catch ( UserNotFoundException ne ) { @@ -97,11 +104,13 @@ public class UserManagementAction public String display() throws Exception { - if ( principal == null ) - { - addActionError( "a principal is required for this operation" ); - return ERROR; - } + + user = userManager.findUser( username ); + + principal = user.getPrincipal().toString(); + fullName = user.getFullName(); + email = user.getEmail(); + locked = user.isLocked(); // for displaying the potential repositories to be displayed, remove the global resource // from the list diff --git a/archiva-webapp/src/main/resources/META-INF/plexus/application.xml b/archiva-webapp/src/main/resources/META-INF/plexus/application.xml index e5cb475e6..592f8210d 100644 --- a/archiva-webapp/src/main/resources/META-INF/plexus/application.xml +++ b/archiva-webapp/src/main/resources/META-INF/plexus/application.xml @@ -36,30 +36,48 @@ - - org.codehaus.plexus.mailsender.MailSender - INFO - - - org.apache.jasper - INFO - - - com.opensymphony.xwork - INFO - - - com.opensymphony.webwork - INFO - + org.apache.maven DEBUG org.codehaus.plexus.security + DEBUG + + + + org.codehaus.plexus.mailsender.MailSender INFO + + org.quartz + INFO + + + org.apache.jasper + INFO + + + com.opensymphony.xwork + INFO + + + com.opensymphony.webwork + INFO + + + org.codehaus.plexus.PlexusContainer + INFO + + + JPOX + WARN + + + freemarker + WARN + diff --git a/archiva-webapp/src/main/resources/xwork.xml b/archiva-webapp/src/main/resources/xwork.xml index 75cc49a8d..52ba0b7b2 100644 --- a/archiva-webapp/src/main/resources/xwork.xml +++ b/archiva-webapp/src/main/resources/xwork.xml @@ -259,7 +259,7 @@ - + /WEB-INF/jsp/userDetails.jsp diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp index 3616e319b..b792d0493 100644 --- a/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp @@ -69,7 +69,7 @@ - ${sessionScope.SecuritySessionUser.principal} + ${sessionScope.SecuritySessionUser.username} Welcome, ${sessionScope.SecuritySessionUser.username} - diff --git a/archiva-webapp/src/main/webapp/WEB-INF/jsp/findUser.jsp b/archiva-webapp/src/main/webapp/WEB-INF/jsp/findUser.jsp index 716f89c8c..067693e15 100644 --- a/archiva-webapp/src/main/webapp/WEB-INF/jsp/findUser.jsp +++ b/archiva-webapp/src/main/webapp/WEB-INF/jsp/findUser.jsp @@ -28,9 +28,9 @@
-

Modify User Details

+

Modify User Details - ${username}