Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a248c335
authored
Sep 01, 2013
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logout fix
1 parent
4f3d0e0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
4 deletions
code/MoyaWeb/WebContent/resources/cditools/loginLogout.xhtml
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/AuthView.java
code/MoyaWeb/WebContent/resources/cditools/loginLogout.xhtml
View file @
a248c33
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:composite=
"http://java.sun.com/jsf/composite"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:composite=
"http://java.sun.com/jsf/composite"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:login=
"http://java.sun.com/jsf/composite/cditools/login"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:login=
"http://java.sun.com/jsf/composite/cditools/login"
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:p=
"http://primefaces.org/ui"
>
>
<composite:interface>
<composite:interface>
...
@@ -13,7 +13,12 @@
...
@@ -13,7 +13,12 @@
<composite:implementation>
<composite:implementation>
<c:choose>
<c:choose>
<c:when
test=
'#{sessionHandler.isLoggedIn() }'
>
<c:when
test=
'#{sessionHandler.isLoggedIn() }'
>
<h:link
value=
"#{i18n['login.logout']}"
outcome=
"/auth/logout"
/>
<h:form>
<p:commandLink
actionListener=
"#{authView.doLogout}"
ajax=
"false"
>
<h:outputText
value=
"#{i18n['login.logout']}"
/>
</p:commandLink>
</h:form>
</c:when>
</c:when>
<c:otherwise>
<c:otherwise>
<login:login
isOneliner=
"true"
/>
<login:login
isOneliner=
"true"
/>
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/AuthView.java
View file @
a248c33
...
@@ -54,11 +54,25 @@ public class AuthView extends GenericCDIView {
...
@@ -54,11 +54,25 @@ public class AuthView extends GenericCDIView {
}
}
}
}
req
.
getSession
().
invalidate
();
req
.
getSession
().
invalidate
();
navihandler
.
forward
(
"logoutDone"
);
}
}
public
String
doLogout
()
{
HttpServletRequest
req
=
getRequest
();
if
(
permbean
.
isLoggedIn
())
{
try
{
req
.
logout
();
}
catch
(
ServletException
e
)
{
logger
.
warn
(
"Error executing logout"
,
e
);
}
}
req
.
getSession
().
invalidate
();
return
"/index"
;
}
public
void
executeLogin
()
{
public
void
executeLogin
()
{
executeLogin
(
null
);
executeLogin
(
null
);
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment