diff --git a/YACOSWeb/WebContent/WEB-INF/applicationContextAcegi.xml b/YACOSWeb/WebContent/WEB-INF/applicationContextAcegi.xml index e38bd76..e8846d7 100644 --- a/YACOSWeb/WebContent/WEB-INF/applicationContextAcegi.xml +++ b/YACOSWeb/WebContent/WEB-INF/applicationContextAcegi.xml @@ -81,20 +81,21 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem - - - - - - - - - - + + + + + + + + + + + CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON @@ -106,18 +107,6 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem - - - - - - - true - - - - - diff --git a/YACOSWeb/WebContent/WEB-INF/classes/messages.properties b/YACOSWeb/WebContent/WEB-INF/classes/messages.properties index 85bce49..5cb6ff0 100644 --- a/YACOSWeb/WebContent/WEB-INF/classes/messages.properties +++ b/YACOSWeb/WebContent/WEB-INF/classes/messages.properties @@ -86,7 +86,15 @@ form.register.error.firstNameEmpty=First name is required form.register.error.lastNameEmpty=Last name is required form.register.error.passwordEmpty=The password can't be empty form.register.error.alreadyExists=A user with this login already exists. Please check you haven't already registered or change your login. - +form.link.back=Back +form.label.newaccount=You want post an article and participate at one conference ? so create your account ! +form.label.message=NOTE: you have already an account ? Please connect you to the +form.label.linkPage=opening session page +form.field.account=Your account +form.field.personal=Personal details +form.field.necessary=* Required informations +message.account.validate=Account created successfully. You can now connect at this. +message.account.maj=Your account was indeed updated. ################### # FORGOT USER diff --git a/YACOSWeb/WebContent/WEB-INF/decorators/include.jsp b/YACOSWeb/WebContent/WEB-INF/decorators/include.jsp index b71daec..b2d9a43 100644 --- a/YACOSWeb/WebContent/WEB-INF/decorators/include.jsp +++ b/YACOSWeb/WebContent/WEB-INF/decorators/include.jsp @@ -2,4 +2,5 @@ <%@ 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" %> +<%@ taglib prefix="authz" uri="http://acegisecurity.org/authz" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> \ No newline at end of file diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/listConference.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/listConference.jsp index 1f3b9b5..0b4d093 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/listConference.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/listConference.jsp @@ -6,6 +6,15 @@

Conference's list

+ +

+ + + + +

+
+
@@ -41,7 +50,9 @@ ${conference.title} - In this conference you are: - ${role.type} + + ${fn:toLowerCase(role.type)} + diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/registerUser.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/registerUser.jsp index a5b4e02..04d2831 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/registerUser.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/registerUser.jsp @@ -5,33 +5,76 @@

- + +
+ +
+ +" /> +
+ - -

-
- -

-
+

+
+ +
+ + + * + + + * + + +
+
+ + * + +
+
+ + * +
+
-

-

-

+

+ +
+
+ + * + +
+
+ + * + +
+
+ + * + +
+
+ + + +
+
+ +
+"> + + +           + + + -

-

-

- - - "/> - "/>

+
- - -">Home - - diff --git a/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml b/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml index 0770673..b520d1f 100644 --- a/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml +++ b/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml @@ -76,7 +76,6 @@ - diff --git a/YACOSWeb/WebContent/images/button_back_32x32.gif b/YACOSWeb/WebContent/images/button_back_32x32.gif new file mode 100644 index 0000000..c3abb5f Binary files /dev/null and b/YACOSWeb/WebContent/images/button_back_32x32.gif differ diff --git a/YACOSWeb/WebContent/stylesheets/base.css b/YACOSWeb/WebContent/stylesheets/base.css index 52264a3..bf604d8 100644 --- a/YACOSWeb/WebContent/stylesheets/base.css +++ b/YACOSWeb/WebContent/stylesheets/base.css @@ -23,6 +23,14 @@ body { position: relative; } +a{ + color: #8d0000; + text-decoration: none; +} +a:hover{ + color: #ea984b; +} + .login_error { color: #ff0000; font-size: 10px; @@ -203,7 +211,7 @@ form > table > thead th { } #maincontent { - color: #333; + color: #847d7d; } @@ -276,6 +284,7 @@ table.content_table { /* @end */ + /* @group mainmenu */ #main #mainmenu { @@ -361,6 +370,80 @@ table.content_table { /* @end */ +/* @group account data form */ +#account_data p.legend { + font-weight:bold; + margin:10px 0px 3px 0px; +} +#account_data fieldset { + background-color: #fff8e1; + border: 1px solid #ffe7b3; + margin-right: 0px; + margin-bottom: 10px; + margin-top: 5px; + padding-left: 10px; + padding-right: 10px; +} +#account_data fieldset span.info { + float:right; + position:relative; + margin:-16px -10px 0px 0px; + font-size:11px; +} +#account_data fieldset div { + line-height:25px; + width: 700px; +} + +#account_data fieldset div div{ + line-height:25px; + width: 700px; +} + +#account_data fieldset div label { + display:block; + float:left; + width:195px; +} +#account_data fieldset div input { + font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; + color:#847d6e; + font-size:11px; + width:130px; +} + +#account_data input:focus { + background-color: #fefed7; +} + +#account_data fieldset div span { + color: #f00; +} + +a.back_link { + text-decoration: none; + padding-left: 50px; + background: url(../images/button_back_32x32.gif) no-repeat left top; + padding-top: 10px; + padding-bottom: 10px; + color: #008281; + font-weight: bold; + } + +a.back_link:hover{ + color: #003e82; + } + +div.user_new { + color: #847d6e; + font-weight: bold; + background: url(../images/user_new.png) no-repeat left top; + padding-left: 60px; + height: 40px; + padding-top: 15px; +} +/* @end */ + /* @group globalfooter */ #globalfooter { diff --git a/YACOSWeb/src/org/yacos/web/system/controller/ListConferenceController.java b/YACOSWeb/src/org/yacos/web/system/controller/ListConferenceController.java index e974e9b..6aabf47 100644 --- a/YACOSWeb/src/org/yacos/web/system/controller/ListConferenceController.java +++ b/YACOSWeb/src/org/yacos/web/system/controller/ListConferenceController.java @@ -57,6 +57,13 @@ public class ListConferenceController implements Controller{ { model.put("errorMessage", msgCode); } + + // Create User before + String msgAccount = request.getParameter("account"); + if (msgAccount != null) + { + model.put("ac", msgAccount); + } return new ModelAndView("listConference", model); diff --git a/YACOSWeb/src/org/yacos/web/system/controller/SUserRegistrationController.java b/YACOSWeb/src/org/yacos/web/system/controller/SUserRegistrationController.java index 20ffc28..95d7b5b 100644 --- a/YACOSWeb/src/org/yacos/web/system/controller/SUserRegistrationController.java +++ b/YACOSWeb/src/org/yacos/web/system/controller/SUserRegistrationController.java @@ -3,11 +3,18 @@ */ package org.yacos.web.system.controller; +import java.util.HashMap; +import java.util.Map; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import org.acegisecurity.providers.dao.DaoAuthenticationProvider; +import org.acegisecurity.providers.dao.UserCache; import org.springframework.validation.BindException; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.SimpleFormController; +import org.springframework.web.servlet.support.RequestContextUtils; import org.springframework.web.servlet.view.RedirectView; import org.yacos.core.exceptions.PKAlreadyUsedException; import org.yacos.core.exceptions.UserEMailAlreadyExistsException; @@ -36,6 +43,7 @@ public class SUserRegistrationController extends SimpleFormController { // Tries to retrieve the current user : case of user modification User user = SessionService.getInstance().getCurrentUser(); + Map model = new HashMap(); if( userCommand.getIsNew() ){ try { @@ -46,6 +54,7 @@ public class SUserRegistrationController extends SimpleFormController { userCommand.getLastName(), userCommand.getOrganization(), userCommand.getEmail()); + model.put("account", "2"); } catch (PKAlreadyUsedException e) { errors.rejectValue("login", "form.register.error.alreadyExists"); return new ModelAndView(new RedirectView(getFormView())); @@ -61,16 +70,17 @@ public class SUserRegistrationController extends SimpleFormController { if(userCommand.passwordWasModified()){ user.setPassword(User.hashPassword(userCommand.getPassword())); + + // Empty cache for the new password + DaoAuthenticationProvider authProvider = (DaoAuthenticationProvider) RequestContextUtils.getWebApplicationContext(request).getBean("daoAuthenticationProvider"); + UserCache userCache = authProvider.getUserCache(); + userCache.removeUserFromCache(user.getLogin()); } - userManager.UpdateUser(user); - - // Empty cache - //UserCache.removeUserFromCache(user.getLogin()); - + model.put("account", "1"); } - return new ModelAndView(new RedirectView(getSuccessView())); + return new ModelAndView(new RedirectView("listConference.htm"), model); } /** @@ -88,6 +98,9 @@ public class SUserRegistrationController extends SimpleFormController { if(SessionService.getInstance().isUserLogged()){ // If he is logged, we use his profile information to fill the form currentUser = (User) SessionService.getInstance().getCurrentUser(); + // fill password field + user.setPasswordForRegisteredUser(); + user.setIsNew(false); } @@ -97,6 +110,8 @@ public class SUserRegistrationController extends SimpleFormController { user.setEmail(currentUser.getEmail()); user.setOrganization(currentUser.getOrganization()); + + return user; } diff --git a/YACOSWeb/src/org/yacos/web/system/form/FormUser.java b/YACOSWeb/src/org/yacos/web/system/form/FormUser.java index 06466a1..4b81192 100644 --- a/YACOSWeb/src/org/yacos/web/system/form/FormUser.java +++ b/YACOSWeb/src/org/yacos/web/system/form/FormUser.java @@ -24,14 +24,13 @@ public class FormUser { public FormUser() { this.login = ""; this.email = ""; - // We can't use the real password of the user, so we generate // a hopefully unique placeholder value, that we will be able to check for modification at validation Random placeholderSeed = new Random(new Date().getTime()); this.passwordPlaceholderValue = "placeholder"+placeholderSeed.nextInt(); - - this.password = this.passwordPlaceholderValue; - this.passwordConfirm = this.passwordPlaceholderValue; + // For registration password="" but for editing call setPasswordForRegisteredUser method. + this.password = ""; + this.passwordConfirm = ""; this.firstName = ""; this.lastName = ""; this.organization = ""; @@ -135,4 +134,10 @@ public class FormUser { return isNew; } + public void setPasswordForRegisteredUser() { + + this.password = this.passwordPlaceholderValue; + this.passwordConfirm = this.passwordPlaceholderValue; + } + }