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
This commit is contained in:
Jesse McConnell 2006-09-13 17:04:17 +00:00
parent afbb9de2b4
commit f079ef8f1d
8 changed files with 65 additions and 35 deletions

View File

@ -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();

View File

@ -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

View File

@ -36,30 +36,48 @@
</appender>
</appenders>
<levels>
<level>
<hierarchy>org.codehaus.plexus.mailsender.MailSender</hierarchy>
<level>INFO</level>
</level>
<level>
<hierarchy>org.apache.jasper</hierarchy>
<level>INFO</level>
</level>
<level>
<hierarchy>com.opensymphony.xwork</hierarchy>
<level>INFO</level>
</level>
<level>
<hierarchy>com.opensymphony.webwork</hierarchy>
<level>INFO</level>
</level>
<!-- Help identify bugs during testing -->
<level>
<hierarchy>org.apache.maven</hierarchy>
<level>DEBUG</level>
</level>
<level>
<hierarchy>org.codehaus.plexus.security</hierarchy>
<level>DEBUG</level>
</level>
<!-- squelch noisy objects (for now) -->
<level>
<hierarchy>org.codehaus.plexus.mailsender.MailSender</hierarchy>
<level>INFO</level>
</level>
<level>
<hierarchy>org.quartz</hierarchy>
<level>INFO</level>
</level>
<level>
<hierarchy>org.apache.jasper</hierarchy>
<level>INFO</level>
</level>
<level>
<hierarchy>com.opensymphony.xwork</hierarchy>
<level>INFO</level>
</level>
<level>
<hierarchy>com.opensymphony.webwork</hierarchy>
<level>INFO</level>
</level>
<level>
<hierarchy>org.codehaus.plexus.PlexusContainer</hierarchy>
<level>INFO</level>
</level>
<level>
<hierarchy>JPOX</hierarchy>
<level>WARN</level>
</level>
<level>
<hierarchy>freemarker</hierarchy>
<level>WARN</level>
</level>
</levels>
</configuration>
</component>

View File

@ -259,7 +259,7 @@
<!-- plexus security actions -->
<action name="userDetails" class="userManagement" method="save">
<action name="userDetails" class="userManagement" method="display">
<result name="success">/WEB-INF/jsp/userDetails.jsp</result>
</action>

View File

@ -69,7 +69,7 @@
<ww:else>
<ww:url id="logoutUrl" action="logout" namespace="/" includeParams="none"/>
<ww:url id="manageUserUrl" action="user" namespace="/admin">
<ww:param name="principal">${sessionScope.SecuritySessionUser.principal}</ww:param>
<ww:param name="username">${sessionScope.SecuritySessionUser.username}</ww:param>
</ww:url>
Welcome, <b>${sessionScope.SecuritySessionUser.username}</b> -

View File

@ -28,9 +28,9 @@
<div id="contentArea">
<div id="searchBox">
<ww:form action="userDetails">
<ww:form action="userManagement" method="post" namespace="/admin">
<p>
<ww:textfield label="Find a user" name="user"/>
<ww:textfield label="Find a user" name="username"/>
<ww:submit value="Search"/>
</p>
</ww:form>

View File

@ -18,7 +18,7 @@
<%@ taglib prefix="pss" uri="plexusSecuritySystem" %>
<html>
<head>
<title>User Management - Find a User</title>
<title>User Management</title>
<ww:head />
</head>
@ -41,11 +41,11 @@
<tr class="a">
<th>Username</th>
<td>${sessionScope.SecuritySessionUser.username}</td>
<td>${username}</td>
</tr>
<tr class="b">
<th>Email</th>
<td>${sessionScope.SecuritySessionUser.email}</td>
<td>${email}</td>
</tr>
</table>
@ -61,7 +61,7 @@
<td>
<pss:ifAuthorized permission="remove-roles">
<ww:url id="removeAssignedRoleUrl" action="removeRoleFromUser">
<ww:param name="principal">${sessionScope.SecuritySessionUser.principal}</ww:param>
<ww:param name="principal">${username}</ww:param>
<ww:param name="roleName">${role.name}</ww:param>
</ww:url>
<ww:a href="%{removeAssignedRoleUrl}">Delete</ww:a>
@ -82,7 +82,7 @@
</td>
<td>
<ww:url id="addRoleUrl" action="assignRoleToUser">
<ww:param name="principal">${sessionScope.SecuritySessionUser.principal}</ww:param>
<ww:param name="principal">${username}</ww:param>
<ww:param name="roleName">${role.name}</ww:param>
</ww:url>
<ww:a href="%{addRoleUrl}">Add</ww:a>

View File

@ -17,7 +17,7 @@
<%@ taglib prefix="ww" uri="/webwork" %>
<html>
<head>
<title>User Management - Find a User</title>
<title>User Management - User Details</title>
<ww:head />
</head>
@ -29,7 +29,7 @@
</div>
<h2>Modify User Details</h2>
<h2>Modify User Details - ${username}</h2>
<ww:form action="userDetails" method="post">
<ww:textfield label="Full Name" name="fullName"/>