From 765765802f6a5d77244459f2f0d3e6135e2d61a7 Mon Sep 17 00:00:00 2001 From: "gleison.cruz" Date: Thu, 9 Mar 2023 16:39:10 -0300 Subject: [PATCH] fixes bug#AL-2074 --- pom.xml | 2 +- .../ventaboletos/entidad/Usuario.java | 15 +++++++++++++++ .../service/impl/UsuarioServiceImpl.java | 7 +++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c60010a53..39f0c668d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 br.com.rjconsultores ModelWeb - 1.0.37 + 1.0.38 rj-releases diff --git a/src/com/rjconsultores/ventaboletos/entidad/Usuario.java b/src/com/rjconsultores/ventaboletos/entidad/Usuario.java index 3135789a0..cf27fffb2 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Usuario.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Usuario.java @@ -131,6 +131,11 @@ public class Usuario implements Serializable, UserDetails, Auditavel { @Column(name = "INDRETORNATODASLOCALIDADES") private Boolean indRetornaTodasLocalidades; + @Column(name = "INDTROCASENHA") + private Boolean indTrocaSenha; + + + @Transient @NaoAuditar private Usuario usuarioClone; @@ -507,6 +512,14 @@ public class Usuario implements Serializable, UserDetails, Auditavel { public void setIndRetornaTodasLocalidades(Boolean indRetornaTodasLocalidades) { this.indRetornaTodasLocalidades = indRetornaTodasLocalidades; } + + public Boolean getIndTrocaSenha() { + return indTrocaSenha; + } + + public void setIndTrocaSenha(Boolean indTrocaSenha) { + this.indTrocaSenha = indTrocaSenha; + } @@ -539,6 +552,8 @@ public class Usuario implements Serializable, UserDetails, Auditavel { public String getTextoInclusaoExclusao() { return String.format("ID [%s]", getUsuarioId()); } + + } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/UsuarioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/UsuarioServiceImpl.java index d5d570bd8..2b15453f6 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/UsuarioServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/UsuarioServiceImpl.java @@ -180,6 +180,7 @@ public class UsuarioServiceImpl implements UsuarioService, UserDetailsService { entidad.setFecContrasena(Calendar.getInstance().getTime()); entidad.setUsuariomodifId(entidad.getUsuarioId()); entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setIndTrocaSenha(Boolean.FALSE); entidad.setActivo(Boolean.TRUE); if (entidad.getUsuarioId() != null) { @@ -231,6 +232,12 @@ public class UsuarioServiceImpl implements UsuarioService, UserDetailsService { throw new CredentialsExpiredException("Senha Expirada"); } } + + if (user.getIndTrocaSenha() != null) { + if (user.getIndTrocaSenha()) { + throw new CredentialsExpiredException("Senha Expirada"); + } + } return user; }