Commit e128aff1fa59b2e9a426939af0796a9511fc579b
1 parent
89b56f84
Exists in
master
Implementação do metodo de 'Sair'.
Showing
3 changed files
with
25 additions
and
3 deletions
Show diff stats
src/br/com/controller/QuestionarioController.java
@@ -66,8 +66,9 @@ public class QuestionarioController { | @@ -66,8 +66,9 @@ public class QuestionarioController { | ||
66 | 66 | ||
67 | if (autorizacaoGeracaoHashDao.verificarAutorizacaoGeracaoHash(path, autorizacao)) { | 67 | if (autorizacaoGeracaoHashDao.verificarAutorizacaoGeracaoHash(path, autorizacao)) { |
68 | String[] codigo = emailDestinoOrgao.split("@"); | 68 | String[] codigo = emailDestinoOrgao.split("@"); |
69 | - String codigoHash = | ||
70 | - codigo[0] | 69 | + String codigoHash = ""; |
70 | + | ||
71 | + codigoHash = codigo[0] | ||
71 | + DateUtil.dataHoraAtual().toString().replace("/", "").replace(" ", "") | 72 | + DateUtil.dataHoraAtual().toString().replace("/", "").replace(" ", "") |
72 | .replace(":", ""); | 73 | .replace(":", ""); |
73 | 74 |
src/br/com/controller/formularioOrgaoController.java
@@ -42,6 +42,12 @@ public class formularioOrgaoController { | @@ -42,6 +42,12 @@ public class formularioOrgaoController { | ||
42 | this.path = this.application.getRealPath("") + "/WEB-INF/conexao.properties"; | 42 | this.path = this.application.getRealPath("") + "/WEB-INF/conexao.properties"; |
43 | } | 43 | } |
44 | 44 | ||
45 | + @Path("/logout") | ||
46 | + public void lofout() | ||
47 | + { | ||
48 | + VRaptorRequestHolder.currentRequest().getServletContext() | ||
49 | + .setAttribute("usuarioLogado", true); | ||
50 | + } | ||
45 | 51 | ||
46 | @Path("/formularioOrgao") | 52 | @Path("/formularioOrgao") |
47 | public void formularioOrgao(String valorHash) { | 53 | public void formularioOrgao(String valorHash) { |
@@ -62,6 +68,10 @@ public class formularioOrgaoController { | @@ -62,6 +68,10 @@ public class formularioOrgaoController { | ||
62 | 68 | ||
63 | 69 | ||
64 | if (questionario.getDtInicioQuestionario() != null && !valorHash.equalsIgnoreCase("")) { | 70 | if (questionario.getDtInicioQuestionario() != null && !valorHash.equalsIgnoreCase("")) { |
71 | + | ||
72 | + VRaptorRequestHolder.currentRequest().getServletContext() | ||
73 | + .setAttribute("usuarioLogado", true); | ||
74 | + | ||
65 | 75 | ||
66 | VRaptorRequestHolder.currentRequest().getServletContext() | 76 | VRaptorRequestHolder.currentRequest().getServletContext() |
67 | .setAttribute("valorHash", valorHash); | 77 | .setAttribute("valorHash", valorHash); |
src/br/com/controller/loginController.java
@@ -2,11 +2,22 @@ package br.com.controller; | @@ -2,11 +2,22 @@ package br.com.controller; | ||
2 | 2 | ||
3 | import br.com.caelum.vraptor.Path; | 3 | import br.com.caelum.vraptor.Path; |
4 | import br.com.caelum.vraptor.Resource; | 4 | import br.com.caelum.vraptor.Resource; |
5 | +import br.com.caelum.vraptor.Result; | ||
6 | +import br.com.caelum.vraptor.ioc.spring.VRaptorRequestHolder; | ||
5 | 7 | ||
6 | @Resource | 8 | @Resource |
7 | public class loginController { | 9 | public class loginController { |
10 | + | ||
11 | + private Result result; | ||
12 | + | ||
13 | + public loginController(Result result) { | ||
14 | + this.result = result; | ||
15 | + | ||
16 | + } | ||
17 | + | ||
8 | @Path("/") | 18 | @Path("/") |
9 | public void login(){ | 19 | public void login(){ |
10 | - | 20 | + VRaptorRequestHolder.currentRequest().getServletContext() |
21 | + .setAttribute("usuarioLogado", false); | ||
11 | } | 22 | } |
12 | } | 23 | } |