diff --git a/YACOSWeb/WebContent/WEB-INF/classes/messages.properties b/YACOSWeb/WebContent/WEB-INF/classes/messages.properties index 7e82e9f..261c902 100644 --- a/YACOSWeb/WebContent/WEB-INF/classes/messages.properties +++ b/YACOSWeb/WebContent/WEB-INF/classes/messages.properties @@ -15,6 +15,7 @@ login.label.login=Login login.label.password=Password login.label.rememberme=Remember me login.label.connexion=Connexion +login.label.inscription=New user ? Create an account here login.label.alreadyaccount:I have already an account # New user login.label.createnewuser=Create an account diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/registerUser.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/registerUser.jsp index c3e04c7..4d10b85 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/registerUser.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/registerUser.jsp @@ -8,11 +8,16 @@ -

+ +

+
+ +

+
+

- -

-

+

+





diff --git a/YACOSWeb/WebContent/login.jsp b/YACOSWeb/WebContent/login.jsp index 9b2c283..74f857b 100644 --- a/YACOSWeb/WebContent/login.jsp +++ b/YACOSWeb/WebContent/login.jsp @@ -3,9 +3,9 @@ -
- : +
+ : diff --git a/YACOSWeb/src/org/yacos/web/system/controller/SUserRegistrationController.java b/YACOSWeb/src/org/yacos/web/system/controller/SUserRegistrationController.java index e7ab640..b0493d1 100644 --- a/YACOSWeb/src/org/yacos/web/system/controller/SUserRegistrationController.java +++ b/YACOSWeb/src/org/yacos/web/system/controller/SUserRegistrationController.java @@ -6,6 +6,7 @@ package org.yacos.web.system.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.acegisecurity.providers.dao.UserCache; import org.springframework.validation.BindException; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.SimpleFormController; @@ -59,13 +60,18 @@ public class SUserRegistrationController extends SimpleFormController { user.setFirstName(userCommand.getFirstName()); user.setLastName(userCommand.getLastName()); user.setOrganization(userCommand.getOrganization()); + + if(userCommand.passwordWasModified()){ + user.setPassword(User.hashPassword(userCommand.getPassword())); + } + + userManager.UpdateUser(user); + + // Empty cache + //UserCache.removeUserFromCache(user.getLogin()); + } - if(userCommand.passwordWasModified()){ - user.setPassword(userCommand.getPassword()); - } - - return new ModelAndView(new RedirectView(getSuccessView())); } diff --git a/YACOSWeb/src/org/yacos/web/system/form/FormUser.java b/YACOSWeb/src/org/yacos/web/system/form/FormUser.java index e5ad68f..06466a1 100644 --- a/YACOSWeb/src/org/yacos/web/system/form/FormUser.java +++ b/YACOSWeb/src/org/yacos/web/system/form/FormUser.java @@ -121,7 +121,7 @@ public class FormUser { this.organization = organization; } public boolean passwordWasModified() { - return this.passwordPlaceholderValue.equals(this.getPassword()); + return ! this.passwordPlaceholderValue.equals(this.getPassword()); } public boolean passwordsMatches() { return this.password.equals(this.passwordConfirm);