diff --git a/curriculumsearch/src/main/java/com/roshka/controller/RRHHUserController.java b/curriculumsearch/src/main/java/com/roshka/controller/RRHHUserController.java index f81692c..9a89cf6 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/RRHHUserController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/RRHHUserController.java @@ -26,7 +26,7 @@ import java.util.concurrent.Executors; @Controller public class RRHHUserController { - private static final long REGISTER_CODE = 1234; + private static String REGISTER_CODE = "123456"; RRHHUserRepository rrhhUserRepository; @Autowired @@ -46,6 +46,15 @@ public class RRHHUserController { return "registration"; } + @PostMapping("/generarCodigoRegistro") + public RedirectView generarCodigoRegistro(Model model, RedirectAttributes redirectAttributes){ + RedirectView redirectView = new RedirectView("/home", true); + + REGISTER_CODE = RandomString.make(6); + redirectAttributes.addFlashAttribute("clave", REGISTER_CODE); + return redirectView; + } + @GetMapping("/login") public String getLogin(Model model, HttpServletRequest request) { if(request.getParameter("error")!=null){ @@ -57,8 +66,7 @@ public class RRHHUserController { @PostMapping("/process_register") public RedirectView processRegister(HttpServletRequest request, RRHHUser user, RedirectAttributes redirectAttributes) { RedirectView redirectView = new RedirectView("/register",true); - redirectAttributes.addFlashAttribute("success", "Datos actualizados"); - if(Long.parseLong(request.getParameter("registrationCode")) != REGISTER_CODE){ + if(!request.getParameter("registrationCode").equals(REGISTER_CODE)){ redirectAttributes.addFlashAttribute("error", "Codigo Incorrecto"); return redirectView; } @@ -140,6 +148,8 @@ public class RRHHUserController { }); emailExecutor.shutdown(); + model.addAttribute("success", "Se ha enviado el link de recuperación a su " + + "correo electronico. Si no lo recibió intente nuevamente."); return "forgot_password_form"; } diff --git a/curriculumsearch/src/main/webapp/jsp/forgot_password_form.jsp b/curriculumsearch/src/main/webapp/jsp/forgot_password_form.jsp index 54a2d36..58d0aba 100644 --- a/curriculumsearch/src/main/webapp/jsp/forgot_password_form.jsp +++ b/curriculumsearch/src/main/webapp/jsp/forgot_password_form.jsp @@ -9,19 +9,26 @@ - + + + + + + + Volver + -
-

Recuperación de Contraseña

+
+

Recuperacion de Password

-

Te enviaremos el link de recuperación de tu cuenta a tu email

+

Te enviaremos el link de recuperacion de tu cuenta a tu email

diff --git a/curriculumsearch/src/main/webapp/jsp/index.jsp b/curriculumsearch/src/main/webapp/jsp/index.jsp index 553ce4a..dfce6da 100644 --- a/curriculumsearch/src/main/webapp/jsp/index.jsp +++ b/curriculumsearch/src/main/webapp/jsp/index.jsp @@ -7,5 +7,14 @@ - + + + + ${clave} + + + Clave de Registro: + + + \ No newline at end of file diff --git a/curriculumsearch/src/main/webapp/jsp/layouts/base.jsp b/curriculumsearch/src/main/webapp/jsp/layouts/base.jsp index 09bcf67..cbde44f 100644 --- a/curriculumsearch/src/main/webapp/jsp/layouts/base.jsp +++ b/curriculumsearch/src/main/webapp/jsp/layouts/base.jsp @@ -72,6 +72,22 @@

+
diff --git a/curriculumsearch/src/main/webapp/jsp/registration.jsp b/curriculumsearch/src/main/webapp/jsp/registration.jsp index fc9a74f..7fa99b1 100644 --- a/curriculumsearch/src/main/webapp/jsp/registration.jsp +++ b/curriculumsearch/src/main/webapp/jsp/registration.jsp @@ -8,7 +8,7 @@ - + + + + + + + Volver +
+
+

Informacion de Registro

- Sample photo
-

Informacion de Registro

+
@@ -55,14 +63,14 @@
- - + +
- +
diff --git a/curriculumsearch/src/main/webapp/jsp/reset_password_form.jsp b/curriculumsearch/src/main/webapp/jsp/reset_password_form.jsp index 78acb1d..9e85d77 100644 --- a/curriculumsearch/src/main/webapp/jsp/reset_password_form.jsp +++ b/curriculumsearch/src/main/webapp/jsp/reset_password_form.jsp @@ -7,29 +7,37 @@ Forgot Password - - + - + + + + + + Volver +
-

Cambia tu contraseña

-
+ +
+

Cambia tu password

+
- - -
-
-

- -

-

- -

+ + +
+
+

+ +

+

+ +

+
-
- + +