<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
</dependency>
+ <!-- Plexus Security Dependencies -->
+ <dependency>
+ <groupId>org.codehaus.plexus.security</groupId>
+ <artifactId>plexus-security-system</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus.security</groupId>
+ <artifactId>plexus-security-ui-web</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus.security</groupId>
+ <artifactId>plexus-security-authorization-rbac-ui-web</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus.security</groupId>
+ <artifactId>plexus-security-authentication-provider-memory</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus.security</groupId>
+ <artifactId>plexus-security-user-management-provider-memory</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus.security</groupId>
+ <artifactId>plexus-security-authorization-rbac-store-memory</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus.security</groupId>
+ <artifactId>plexus-security-authorization-api</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus.security</groupId>
+ <artifactId>plexus-security-authorization-rbac-authorizer</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<build>
<plugins>
</levels>
</configuration>
</component>
+
+
+ <!-- plexus security components -->
+ <component>
+ <role>org.codehaus.plexus.security.system.SecuritySystem</role>
+ <implementation>org.codehaus.plexus.security.system.DefaultSecuritySystem</implementation>
+ <role-hint>default</role-hint>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.security.authentication.Authenticator</role>
+ <role-hint>memory</role-hint>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.security.authorization.Authorizer</role>
+ <role-hint>rbac</role-hint>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.security.user.UserManager</role>
+ <role-hint>memory</role-hint>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.codehaus.plexus.security.authorization.Authorizer</role>
+ <role-hint>rbac</role-hint>
+ <implementation>org.codehaus.plexus.security.authorization.rbac.RbacAuthorizer</implementation>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.security.authorization.rbac.store.RbacStore</role>
+ <role-hint>memory</role-hint>
+ </requirement>
+ </requirements>
+ </component>
+
+
</components>
<!-- Override default configuration of components -->
</result>
<result name="notFound" type="httpheader">404</result>
</action>
+
+ <!-- plexus security actions -->
+ <action name="login" class="session" method="login">
+ <result name="input">/WEB-INF/jsp/login.jsp</result>
+ <result name="success" type="redirect-action">browse</result>
+ </action>
+
+ <action name="logout" class="session" method="logout">
+ <result>/WEB-INF/jsp/logout.jsp</result>
+ </action>
+
+ <action name="register" class="registerUser" method="createUser">
+ <result name="input">/WEB-INF/jsp/register.jsp</result>
+ <result name="success" type="redirect-action">login</result>
+ </action>
</package>
<!-- Configuration for the admin package. -->
<div id="breadcrumbs">
<div class="xleft">
- <%-- TODO: login --%>
+ <ww:url id="loginUrl" action="login" namespace="/"/>
+ <ww:url id="logoutUrl" action="logout" namespace="/"/>
+ <ww:url id="registerUrl" action="register" namespace="/"/>
+ <ww:if test="${sessionScope.authStatus != true}">
+ <ww:a href="%{loginUrl}">Login</ww:a> or <ww:a href="%{registerUrl}">Register</ww:a>
+ </ww:if>
+ <ww:else>
+ Welcome, <b>${sessionScope.user.username}</b> - <ww:a href="%{logoutUrl}">Logout</ww:a>
+ </ww:else>
</div>
<div class="xright">
--- /dev/null
+<%--
+ ~ 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>
+
+<h1>Login</h1>
+
+<div id="contentArea">
+ <div id="nameColumn">
+ <ww:form action="login">
+ <table>
+ <tr>
+ <td>Username:</td>
+ <td><ww:textfield name="username"/></td>
+ </tr>
+ <tr>
+ <td>Password:</td>
+ <td><ww:password name="password"/></td>
+ </tr>
+ <tr>
+ <td><ww:submit name="Login"/></td>
+ <td></td>
+ </tr>
+ </table>
+ </ww:form>
+ <p>
+ <ww:url id="registerUrl" action="register" namespace="/"/>
+
+ New user? - <ww:a href="%{registerUrl}">Register!</ww:a>
+ </p>
+ </div>
+</div>
+
+</body>
+</html>
--- /dev/null
+<%--
+ ~ 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>Logout Page</title>
+ <ww:head/>
+</head>
+
+<body>
+
+<h1>Logout</h1>
+
+<div id="contentArea">
+ <div id="nameColumn">
+ You have been successfully logged out!
+ </div>
+</div>
+
+</body>
+</html>
--- /dev/null
+<%--
+ ~ 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>Registration Page</title>
+ <ww:head/>
+</head>
+
+<body>
+
+<h1>Registration</h1>
+
+<div id="contentArea">
+ <div id="nameColumn">
+ <ww:form action="register">
+ <table>
+ <tr>
+ <td>Username:</td>
+ <td><ww:textfield name="username"/></td>
+ </tr>
+ <tr>
+ <td>Password:</td>
+ <td><ww:password name="password"/></td>
+ </tr>
+ <tr>
+ <td>Full Name:</td>
+ <td><ww:textfield name="fullName"/></td>
+ </tr>
+ <tr>
+ <td>Email Address:</td>
+ <td><ww:textfield name="email"/></td>
+ </tr>
+ <tr>
+ <td><ww:submit name="Register"/></td>
+ <td></td>
+ </tr>
+ </table>
+ </ww:form>
+ </div>
+</div>
+
+</body>
+</html>