Commit 4f036c5a by Tuomas Riihimäki

Add logout button to template. ( was lost in previous loginbox-fix)

1 parent e383c0b0
...@@ -149,6 +149,10 @@ ...@@ -149,6 +149,10 @@
<h:outputText value="#{i18n['template.loggedInAs']}" /> <h:outputText value="#{i18n['template.loggedInAs']}" />
<br /> <br />
<b><h:outputText value="#{sessionHandler.currentUser.nick}" /></b> <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>
<ui:fragment rendered="#{!sessionHandler.loggedIn}"> <ui:fragment rendered="#{!sessionHandler.loggedIn}">
<div style="text-align: left; padding: 0.7em;"> <div style="text-align: left; padding: 0.7em;">
......
...@@ -56,10 +56,9 @@ public class AuthView extends GenericCDIView { ...@@ -56,10 +56,9 @@ public class AuthView extends GenericCDIView {
req.getSession().invalidate(); req.getSession().invalidate();
navihandler.forward("/frontpage"); navihandler.forward("/frontpage?faces-redirect=true");
} }
public String doLogout() { public String doLogout() {
HttpServletRequest req = getRequest(); HttpServletRequest req = getRequest();
if (permbean.isLoggedIn()) { if (permbean.isLoggedIn()) {
...@@ -82,7 +81,7 @@ public class AuthView extends GenericCDIView { ...@@ -82,7 +81,7 @@ public class AuthView extends GenericCDIView {
} }
public void executeLogin(String onError) { public void executeLogin(String onError) {
if(onError == null) if (onError == null)
onError = "/auth/loginError"; onError = "/auth/loginError";
doLogin(onError); doLogin(onError);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!