diff --git a/src/main/java/eu/dnetlib/openaire/usermanagement/ActivationCodeServlet.java b/src/main/java/eu/dnetlib/openaire/usermanagement/ActivationCodeServlet.java index 9e9257c..4ecdcac 100644 --- a/src/main/java/eu/dnetlib/openaire/usermanagement/ActivationCodeServlet.java +++ b/src/main/java/eu/dnetlib/openaire/usermanagement/ActivationCodeServlet.java @@ -40,8 +40,8 @@ public class ActivationCodeServlet extends HttpServlet{ response.setContentType("text/html"); PrintWriter printWriter = response.getWriter(); - String formUsername = request.getParameter("username"); - String formVerificationCode = request.getParameter("verification_code"); + String formUsername = request.getParameter("username").trim(); + String formVerificationCode = request.getParameter("verification_code").trim(); if (verificationActions.verificationEntryExists(formUsername) && verificationActions.verificationCodeIsCorrect(formUsername, formVerificationCode)) { if (!verificationActions.verificationCodeHasExpired(formUsername)) { diff --git a/src/main/java/eu/dnetlib/openaire/usermanagement/ForgotPasswordServlet.java b/src/main/java/eu/dnetlib/openaire/usermanagement/ForgotPasswordServlet.java index cf61625..65db12d 100644 --- a/src/main/java/eu/dnetlib/openaire/usermanagement/ForgotPasswordServlet.java +++ b/src/main/java/eu/dnetlib/openaire/usermanagement/ForgotPasswordServlet.java @@ -46,7 +46,7 @@ public class ForgotPasswordServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { - String formEmail = request.getParameter("email"); + String formEmail = request.getParameter("email").trim(); if (formEmail == null) { request.getSession().setAttribute("message", "Error reading email."); diff --git a/src/main/java/eu/dnetlib/openaire/usermanagement/RegisterServlet.java b/src/main/java/eu/dnetlib/openaire/usermanagement/RegisterServlet.java index bb0b3b8..e510f6b 100644 --- a/src/main/java/eu/dnetlib/openaire/usermanagement/RegisterServlet.java +++ b/src/main/java/eu/dnetlib/openaire/usermanagement/RegisterServlet.java @@ -45,12 +45,12 @@ public class RegisterServlet extends HttpServlet { response.setContentType("text/html"); PrintWriter printWriter = response.getWriter(); - String firstName = request.getParameter("first_name"); - String lastName = request.getParameter("last_name"); - String organization = request.getParameter("organization"); - String username = request.getParameter("username"); - String email =request.getParameter("email"); - String confirmEmail = request.getParameter("email_conf"); + String firstName = request.getParameter("first_name").trim(); + String lastName = request.getParameter("last_name").trim(); + String organization = request.getParameter("organization").trim(); + String username = request.getParameter("username").trim(); + String email =request.getParameter("email").trim(); + String confirmEmail = request.getParameter("email_conf").trim(); String password = request.getParameter("password"); String confirmPassword = request.getParameter("password_conf"); @@ -65,7 +65,7 @@ public class RegisterServlet extends HttpServlet { if (username.matches("^[a-zA-Z0-9][a-zA-Z0-9_-]{4,150}") && !ldapActions.usernameExists(username) && !ldapActions.emailExists(email)) { ldapActions.createZombieUser(username, email, firstName, lastName, organization, password); - logger.info("User successfully created"); + logger.info("Zombie user successfully created"); UUID verificationCode = UUID.randomUUID(); Date creationDate = new Date(); diff --git a/src/main/java/eu/dnetlib/openaire/usermanagement/RemindUsernameServlet.java b/src/main/java/eu/dnetlib/openaire/usermanagement/RemindUsernameServlet.java index 11292b9..f3c0576 100644 --- a/src/main/java/eu/dnetlib/openaire/usermanagement/RemindUsernameServlet.java +++ b/src/main/java/eu/dnetlib/openaire/usermanagement/RemindUsernameServlet.java @@ -38,7 +38,7 @@ public class RemindUsernameServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { - String formEmail = request.getParameter("email"); + String formEmail = request.getParameter("email").trim(); if (formEmail == null){ request.getSession().setAttribute("message", "Error reading email."); diff --git a/src/main/java/eu/dnetlib/openaire/usermanagement/VerificationCodeServlet.java b/src/main/java/eu/dnetlib/openaire/usermanagement/VerificationCodeServlet.java index bfe99e4..9531dd3 100644 --- a/src/main/java/eu/dnetlib/openaire/usermanagement/VerificationCodeServlet.java +++ b/src/main/java/eu/dnetlib/openaire/usermanagement/VerificationCodeServlet.java @@ -36,8 +36,8 @@ public class VerificationCodeServlet extends HttpServlet { response.setContentType("text/html"); PrintWriter printWriter = response.getWriter(); - String formUsername = request.getParameter("username"); - String formVerificationCode = request.getParameter("verification_code"); + String formUsername = request.getParameter("username").trim(); + String formVerificationCode = request.getParameter("verification_code").trim(); if (verificationActions.verificationEntryExists(formUsername) && verificationActions.verificationCodeIsCorrect(formUsername, formVerificationCode)) { if (!verificationActions.verificationCodeHasExpired(formUsername)) { diff --git a/src/main/webapp/activate.jsp b/src/main/webapp/activate.jsp index 24b466d..2c925e2 100644 --- a/src/main/webapp/activate.jsp +++ b/src/main/webapp/activate.jsp @@ -51,7 +51,7 @@
An email has been sent to your email address. The email contains your username and an activation code, please paste them in the fields below to prove that you are the owner of this email account.
+Thank you for registering! Please activate your account. An email has been sent to your email address. The email contains your username and an activation code, please paste them in the fields below to prove that you are the owner of this email account.
Please click here to login.
--%>