Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4f036c5a
authored
May 08, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logout button to template. ( was lost in previous loginbox-fix)
1 parent
e383c0b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
16 deletions
code/MoyaWeb/WebContent/resources/templates/template1/template.xhtml
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/AuthView.java
code/MoyaWeb/WebContent/resources/templates/template1/template.xhtml
View file @
4f036c5
...
...
@@ -149,6 +149,10 @@
<h:outputText
value=
"#{i18n['template.loggedInAs']}"
/>
<br
/>
<b><h:outputText
value=
"#{sessionHandler.currentUser.nick}"
/></b>
<br
/>
<h:link
outcome=
"/auth/logout"
>
<h:outputText
value=
"#{i18n['login.logout']}"
/>
</h:link>
</ui:fragment>
<ui:fragment
rendered=
"#{!sessionHandler.loggedIn}"
>
<div
style=
"text-align: left; padding: 0.7em;"
>
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/AuthView.java
View file @
4f036c5
...
...
@@ -33,7 +33,7 @@ public class AuthView extends GenericCDIView {
@Inject
private
NavigationHandler
navihandler
;
@EJB
private
transient
BootstrapBeanLocal
bootStrapBean
;
...
...
@@ -53,13 +53,12 @@ public class AuthView extends GenericCDIView {
logger
.
warn
(
"Error executing logout"
,
e
);
}
}
req
.
getSession
().
invalidate
();
navihandler
.
forward
(
"/frontpage"
);
navihandler
.
forward
(
"/frontpage
?faces-redirect=true
"
);
}
public
String
doLogout
()
{
HttpServletRequest
req
=
getRequest
();
if
(
permbean
.
isLoggedIn
())
{
...
...
@@ -69,28 +68,28 @@ public class AuthView extends GenericCDIView {
logger
.
warn
(
"Error executing logout"
,
e
);
}
}
req
.
getSession
().
invalidate
();
navihandler
.
forward
(
"/frontpage"
);
return
"/frontpage"
;
}
public
void
executeLogin
()
{
executeLogin
(
null
);
}
public
void
executeLogin
(
String
onError
)
{
if
(
onError
==
null
)
if
(
onError
==
null
)
onError
=
"/auth/loginError"
;
doLogin
(
onError
);
}
private
void
doLogin
(
String
onError
)
{
bootStrapBean
.
saneDefaults
();
if
(
login
==
null
||
password
==
null
||
login
.
isEmpty
()
||
password
.
isEmpty
())
{
return
;
}
...
...
@@ -127,15 +126,15 @@ public class AuthView extends GenericCDIView {
}
}
return
;
}
public
void
executeAdduserViewLogin
()
{
navihandler
.
saveNavigation
(
"/admin/adduser/update"
);
doLogin
(
"/admin/adduser/login"
);
}
public
String
executeLoginAction
()
{
executeLogin
();
return
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