reworked login and register so flow is improved and its functional!

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@442680 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jesse McConnell 2006-09-12 19:44:24 +00:00
parent f84cd0a20e
commit 938c0ac92b
6 changed files with 114 additions and 57 deletions

View File

@ -63,6 +63,11 @@ public class NewUserAction
public String createUser()
{
if ( username == null )
{
return INPUT;
}
// TODO: use commons-validator for these fields.
if ( StringUtils.isEmpty( username ) )
@ -120,7 +125,7 @@ public class NewUserAction
if ( hasActionErrors() )
{
return ERROR;
return INPUT;
}
return SUCCESS;

View File

@ -127,7 +127,8 @@
<!-- plexus security actions -->
<action name="login" class="plexusSecurityLogin" method="login">
<result name="input">/WEB-INF/jsp/loginRegister.jsp</result>
<result name="input">/WEB-INF/jsp/login.jsp</result>
<result name="error">/WEB-INF/jsp/login.jsp</result>
<result name="success" type="redirect-action">browse</result>
</action>
@ -136,7 +137,9 @@
</action>
<action name="register" class="newUser" method="createUser">
<result name="success" type="redirect-action">login</result>
<result name="input">/WEB-INF/jsp/register.jsp</result>
<result name="success">/WEB-INF/jsp/register.jsp</result>
<result name="error">/WEB-INF/jsp/register.jsp</result>
</action>
</package>

View File

@ -60,9 +60,10 @@
<div id="breadcrumbs">
<div class="xleft">
<ww:url id="loginUrl" action="login" namespace="/" includeParams="none"/>
<ww:url id="registerUrl" action="register" namespace="/" includeParams="none"/>
<ww:if test="${sessionScope.authStatus != true}">
<ww:a href="%{loginUrl}">Login/Register</ww:a>
<ww:a href="%{loginUrl}">Login</ww:a> - <ww:a href="%{registerUrl}">Register</ww:a>
</ww:if>
<ww:else>

View File

@ -0,0 +1,79 @@
<%--
~ Copyright 2005-2006 The Apache Software Foundation.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
--%>
<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Login Page</title>
<ww:head/>
</head>
<body>
<div id="contentArea">
<div id="searchBox">
<div style="float: right">
<a href="#">Forgotten your Password?</a>
</div>
<p>
<ww:actionmessage/>
<ww:actionerror/>
</p>
<h2>Login</h2>
<ww:form action="login">
<table class="bodyTable">
<tr class="a">
<th>
Username
</th>
<td>
<ww:textfield name="username" size="30"/>
</td>
</tr>
<tr class="b">
<th>
Password
</th>
<td>
<ww:password name="password" size="20"/>
</td>
</tr>
<tr class="a">
<td></td>
<td>
<ww:submit value="Login"/>
</td>
</tr>
</table>
</ww:form>
</div>
</div>
<div class="clear">
<hr/>
</div>
</body>
</html>

View File

@ -19,7 +19,7 @@
<html>
<head>
<title>Login Page</title>
<title>Registration Page</title>
<ww:head/>
</head>
@ -27,45 +27,12 @@
<div id="contentArea">
<div id="searchBox">
<div style="float: right">
<a href="#">Forgotten your Password?</a>
</div>
<p>
<ww:actionmessage/>
<ww:actionerror/>
</p>
<h2>Login</h2>
<ww:form action="login">
<table class="bodyTable">
<tr class="a">
<th>
Username
</th>
<td>
<ww:textfield name="username" size="30"/>
</td>
</tr>
<tr class="b">
<th>
Password
</th>
<td>
<ww:password name="password" size="20"/>
</td>
</tr>
<tr class="a">
<td></td>
<td>
<ww:submit value="Login"/>
</td>
</tr>
</table>
</ww:form>
<h2>Request an Account</h2>
<h2>Register for an Account</h2>
<ww:form action="register">
<table class="bodyTable">
<tr class="b">
@ -82,7 +49,6 @@
</th>
<td>
<ww:password name="password" size="20"/>
</td>
</tr>
<tr class="b">
@ -109,12 +75,7 @@
</th>
<td>
<ww:textfield name="email" size="50 "/>
<br></br>
<span style="font-size: x-small">(Only administrators will be able to view this, and it will be used to
send you information about your project)
</span>
</td>
</tr>
<tr class="a">
<td></td>

View File

@ -85,19 +85,27 @@
<h2>Grant Roles</h2>
<p>
</p>
<pss:ifAuthorized permission="grant-roles">
<pss:ifAuthorized permission="grant-roles">
<table class="bodyTable">
<ww:iterator id="role" value="availableRoles">
<ww:url id="addRoleUrl" action="assignRoleToUser">
<ww:param name="principal">${sessionScope.SecuritySessionUser.principal}</ww:param>
<ww:param name="roleName">${role.name}</ww:param>
</ww:url>
<ww:a href="%{addRoleUrl}">${role.name}</ww:a>
<br/>
<tr class="a">
<td>
<em>${role.name}</em><br/>
</td>
<td>
<ww:url id="addRoleUrl" action="assignRoleToUser">
<ww:param name="principal">${sessionScope.SecuritySessionUser.principal}</ww:param>
<ww:param name="roleName">${role.name}</ww:param>
</ww:url>
<ww:a href="%{addRoleUrl}">add</ww:a>
</td>
</tr>
</ww:iterator>
</pss:ifAuthorized>
</table>
</pss:ifAuthorized>
<%--
<p>
This following screen needs have the various roles worked into it.