Form Login

This commit is contained in:
Nicolas Michard
2008-01-28 23:01:36 +00:00
parent 07d3940fbd
commit c544189c3d
5 changed files with 85 additions and 40 deletions

View File

@@ -5,6 +5,12 @@ title=Yacos
disclaimer.text=Copyrights <20> 2008. Yacos Team. All rights reserved.
disclaimer.link.about=About
###################
# LOGIN FORM
login.btn.submit=Submit
login.btn.logout=Logout
login.field.login=Login
###################
# REGISTRATION USER
register.title=User Registration

View File

@@ -23,7 +23,17 @@
<!-- User Information -->
<div id="userlogin">
<page:applyDecorator name="empty" page="/WEB-INF/jsp/login.jsp" />
<!-- For anonymous user display the login form -->
<authz:authorize ifAllGranted="ROLE_ANONYMOUS">
<page:applyDecorator name="empty" page="/WEB-INF/jsp/login.jsp" />
</authz:authorize>
<!-- For authenticated user display user information-->
<authz:authorize ifNotGranted="ROLE_ANONYMOUS">
<page:applyDecorator name="empty" page="/WEB-INF/jsp/secure/userinformation.jsp" />
</authz:authorize>
</div>
<!-- headermenu -->

View File

@@ -1,46 +1,16 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<%@ page import="org.acegisecurity.context.SecurityContextHolder" %>
<html>
<head></head>
<body>
<form action="<c:url value='j_acegi_security_check'/>" method="POST">
<table>
<tr>
<td>User:</td>
<td><input type='text' name='j_username' />
</td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' name='j_password' /></td>
</tr>
<tr>
<td><input type="checkbox" name="_acegi_security_remember_me" /></td>
<td>Se souvenir de moi</td>
</tr>
<tr>
<td><input name="submit" type="submit" /></td>
<td><input name="reset" type="reset" /></td>
</tr>
</table>
</form>
<authz:authorize ifNotGranted="ROLE_ANONYMOUS">
<a href="j_acegi_logout">Logout</a>
</authz:authorize>
<authz:authorize ifAllGranted="ROLE_AUTHOR">
<h1>Welcome: <%= SecurityContextHolder.getContext().getAuthentication().getName() %></h1>
</authz:authorize>
<form action="<c:url value='j_acegi_security_check'/>" method="POST" id="formlogin">
<a href="#" id="connexion">Connexion :</a>
<input type='text' name='j_username' value="<fmt:message key='login.field.login' />" onfocus="if (this.value == 'Login') { this.value = ''; }" onblur="if (this.value == '') { this.value = 'Login'; }" />
<input type='password' name='j_password' />
<a href="javascript:document.getElementById('formlogin').submit();" id="submit_btn"><fmt:message key="login.btn.submit" /></a>
</form>
</body>
</html>

View File

@@ -0,0 +1,15 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head></head>
<body>
Firstname Lastname <b>(<authz:authentication operation="username"></authz:authentication>)</b><br />
You currently follow <b>4</b> conferences<br />
You have the following rights : <b>Author, Chairman, PC Member</b><br />
<a href="#">Change my profile</a><br />
<a href="j_acegi_logout" id="submit_btn"><fmt:message key="login.btn.logout" /></a>
</body>
</html>