Error 404

Bug resolu ds le Core : getConferences(User user)
User Information
Menu submission quand pas auteur
This commit is contained in:
Nicolas Michard
2008-02-12 21:29:44 +00:00
parent dba79ba84d
commit aaee771083
10 changed files with 92 additions and 61 deletions

View File

@@ -9,6 +9,7 @@ disclaimer.link.about=About
###################
# LOGIN FORM
login.title=Login and/or create a new user
login.btn.connexion=Connexion
login.btn.logout=Logout
login.field.login=Login
@@ -28,6 +29,7 @@ login.message.error=Your login attempt was not successful, try again.
###################
# USER INFORMATION HEADER
user.information.editaccount=Edit my account
user.information.followconference={0,choice, 0#You doesn t have any conference | 1#You currently follow {0} conference | 1<You currently follow {0} conferences}
###################
# USER MENU
@@ -55,10 +57,14 @@ menu.author.article.modify=Manage my articles
menu.anonymous.title=Menu
menu.anonymous.article.submission=Article's submission
CHAIRMAN=Chairman
PCMEMBER=PC Member
REFEREE=Referee
AUTHOR=Author
###################
# ROLE
role.chairman=Chairman
role.pcmember=PC Member
role.referee=Referee
role.author=Author
role.none=You don't have any roles for this conference
###################
# REGISTRATION USER
@@ -86,6 +92,10 @@ form.register.error.alreadyExists=A user with this login already exists. Please
message.error.noconferenceforthisid=This conference doesn't exist. Pease try again
message.error.noconferenceid=No conference selectionned
message.error.conferenceerror=Error. Try again.
message.error.page404.title=Page not found
message.error.page404.content=Sorry, the page where you looking for, doesn't found.
message.error.page403.title=Acces denied
message.error.page403.content=Sorry, you have not access at this page.
submission.title=Article's submission

View File

@@ -1,5 +1,5 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="authz" uri="http://acegisecurity.org/authz" %>

View File

@@ -12,7 +12,7 @@
<c:if test="${currentConferenceId != null}">
<!-- AUTHOR MENU : CHAIRMAN -->
<!-- MENU : CHAIRMAN -->
<authz:authorize ifAllGranted="ROLE_CHAIRMAN">
<div id="mainmenubloc">
<h4><fmt:message key="menu.chairman.title" /></h4>
@@ -26,7 +26,7 @@
</div>
</authz:authorize>
<!-- AUTHOR MENU : ROLE_PCMEMBER -->
<!-- MENU : ROLE_PCMEMBER -->
<authz:authorize ifAllGranted="ROLE_PCMEMBER">
<div id="mainmenubloc">
<h4><fmt:message key="menu.pcmember.title" /></h4>
@@ -41,7 +41,7 @@
</div>
</authz:authorize>
<!-- AUTHOR MENU : ROLE_REFEREE -->
<!-- MENU : ROLE_REFEREE -->
<authz:authorize ifAllGranted="ROLE_REFEREE">
<div id="mainmenubloc">
<h4><fmt:message key="menu.referee.title" /></h4>
@@ -53,7 +53,7 @@
</div>
</authz:authorize>
<!-- AUTHOR MENU : ROLE_AUTHOR -->
<!-- MENU : ROLE_AUTHOR -->
<authz:authorize ifAllGranted="ROLE_AUTHOR">
<div id="mainmenubloc">
<h4><fmt:message key="menu.author.title" /></h4>
@@ -65,8 +65,8 @@
</div>
</authz:authorize>
<!-- AUTHOR MENU : ROLE_ANONYMOUS -->
<authz:authorize ifAllGranted="ROLE_ANONYMOUS">
<!-- MENU : ROLE_ANONYMOUS -->
<authz:authorize ifNotGranted="ROLE_AUTHOR">
<div id="mainmenubloc">
<h4><fmt:message key="menu.anonymous.title" /></h4>
<ul>

View File

@@ -1,10 +0,0 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head></head>
<body>
File doesn't exist.
</body>
</html>

View File

@@ -1,10 +1,36 @@
<%@ include file="/WEB-INF/decorators/include.jsp"%>
<html>
<head></head>
<head>
<style type="text/css">
h1 a{
color: #FF4747;
text-decoration: none;
}
h1 a:hover{
color: #FF0000;
}
</style>
</head>
<body>
Error : page not found
<center>
<br/><br/><br/>
<img src="./images/404.jpg" alt="404" /><br/>
<h1> <a href="main.htm">
4o4 Error - Page not found
</a></h1>
</center>
</body>
</html>

View File

@@ -3,7 +3,7 @@
<html>
<head></head>
<body>
<h4 class="title">NON NAME</h4>
<h4 class="title"><fmt:message key="login.title" /></h4>
<c:if test="${not empty param.login_error}">
<div class="login_error">
@@ -26,7 +26,7 @@
<input type="checkbox" name="_acegi_security_remember_me"/>&nbsp;&nbsp;<fmt:message key='login.label.rememberme' /><br />
<br /><br />
<a href="javascript:document.getElementById('formlogin').submit();" id="submit_btn"><fmt:message key="login.label.connexion" /></a>
<a href="javascript:document.getElementById('formlogin').submit();" id="submit_btn"><fmt:message key="login.btn.connexion" /></a>
</form>
</td></tr>

View File

@@ -4,10 +4,16 @@
<html>
<head></head>
<body>
<br />
<b>${ currentUser.firstName } ${ currentUser.lastName }</b><br />
<a href="listConference.htm" >
<fmt:message key="user.information.followconference" >
<fmt:param value="${nbUserConferences}" />
</fmt:message>
</a>
${ currentUser.firstName } ${ currentUser.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 />
<br />
<a href="registerUser.htm"><fmt:message key="user.information.editaccount" /></a><br />
<a href="j_acegi_logout" id="submit_btn"><fmt:message key="login.btn.logout" /></a>

View File

@@ -64,7 +64,7 @@
</filter-mapping>
<!-- SiteMesh Integration declaration Start -->
<!-- SiteMesh Integration declaration Start -->
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>
@@ -74,7 +74,7 @@
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- SiteMesh Integration declaration End -->
@@ -104,10 +104,6 @@
<!-- SessionService Integration declaration End -->
<!-- no access error -->
<error-page>
<error-code>403</error-code>
<location>/WEB-INF/jsp/errors/403error.jsp</location>
</error-page>
<!-- page not found error -->
<error-page>

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -1,5 +1,7 @@
package org.yacos.web.system.session;
import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
@@ -16,6 +18,7 @@ import org.yacos.core.conferences.Conference;
import org.yacos.core.conferences.IConferenceManager;
import org.yacos.core.users.IUserManager;
import org.yacos.core.users.User;
import org.yacos.core.users.Role;
/**
* Provides Session related Services
@@ -33,6 +36,7 @@ public class SessionService {
private User currentUser;
private Conference currentConference;
private int nbUserConferences;
private SessionService(){
}
@@ -59,9 +63,12 @@ public class SessionService {
// Put the current conference in the request context to make it accessible in JSPs
// This avoid to put the whole object in the session
request.setAttribute("currentConference", getCurrentConference());
// Put the current conference in the request context to make it accessible in JSPs
// Put the current user in the request context to make it accessible in JSPs
// This avoid to put the whole object in the session
request.setAttribute("currentUser", getCurrentUser());
// Put the current roles for this user
//request.setAttribute("nbUserConferences",getNbUserConferences());
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -69,6 +76,21 @@ public class SessionService {
}
}
public int getNbUserConferences() {
if(nbUserConferences == -1)
{
setNbUserConferences();
}
return nbUserConferences;
}
public void setNbUserConferences() {
int nb = conferenceManager.getConferences(getCurrentUser()).size();
this.nbUserConferences = nb;
request.setAttribute("nbUserConferences", getNbUserConferences());
}
public void setConferenceManager(IConferenceManager conferenceManager) {
this.conferenceManager = conferenceManager;
}
@@ -155,32 +177,12 @@ public class SessionService {
if( currentConference == null && id != null ){
currentConference = conferenceManager.getConference(id);
}
if (isUserLogged()){setNbUserConferences();};
return currentConference;
}
/**
* Sets the current user by providing the user object
* @param request The current HTTP request object, necessary for session operations
* @param currentUser The new current user to set
*/
@Deprecated
public void setCurrentUser(User currentUser) {
this.currentUser = currentUser;
this.setCurrentUserLogin(currentUser.getLogin());
}
/**
* Sets the current user login
* @param request The current HTTP request object, necessary for session operations
* @param login The new current user login
*/
@Deprecated
public void setCurrentUserLogin(String login) {
WebUtils.setSessionAttribute(request, "currentUserLogin", login);
currentUser = userManager.getUser(login);
request.setAttribute("currentUser", currentUser);
}
/**
* Gets the current user login from the session
* Additionally, puts the current User object in the request context
@@ -269,5 +271,6 @@ public class SessionService {
SecurityContextHolder.getContext().setAuthentication(authProvider.authenticate(currentAuthentication));
}
}
}