]> git.mxchange.org Git - addressbook-war.git/commitdiff
added missing language i18n strings + show logout form only to logged-in users ...
authorRoland Häder <roland@mxchange.org>
Fri, 10 Jun 2016 13:01:57 +0000 (15:01 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 28 Jul 2016 19:31:37 +0000 (21:31 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/addressbook/beans/login/AddressbookUserLoginWebSessionController.java
web/user/login_logout.xhtml [new file with mode: 0644]

index 1e74b83620c6fcafd75759d0da7f4f12d8bc9f12..91cc87a5020bff54d0bf68567432684abc67c9f6 100644 (file)
@@ -40,12 +40,27 @@ public interface AddressbookUserLoginWebSessionController extends Serializable {
         */
        void setTemplateType (final String templateType);
 
+       /**
+        * Logout for administrator area. If a logged-in user instance exists, it is
+        * being logged-out, too.
+        * <p>
+        * @return Outcome (should be redirected)
+        */
+       String doAdminLogout ();
+
        /**
         * Logins the user, if the account is found, confirmed and unlocked.
         * <p>
         * @return Redirect target
         */
-       String doLogin ();
+       String doUserLogin ();
+
+       /**
+        * Logout for current user by invalidating the current session.
+        * <p>
+        * @return Outcome (should be redirected)
+        */
+       String doUserLogout ();
 
        /**
         * Getter for logged-in user instance
@@ -103,4 +118,5 @@ public interface AddressbookUserLoginWebSessionController extends Serializable {
         * @return If current password matches
         */
        boolean ifCurrentPasswordMatches ();
+
 }
diff --git a/web/user/login_logout.xhtml b/web/user/login_logout.xhtml
new file mode 100644 (file)
index 0000000..8d8c61f
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
+       lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       >
+
+       <ui:composition template="/WEB-INF/templates/login/user/user_base.tpl">
+               <ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_USER_LOGOUT}</ui:define>
+
+               <ui:define name="content_header">
+                       #{msg.CONTENT_TITLE_LOGIN_USER_LOGOUT}
+               </ui:define>
+
+               <ui:define name="content">
+                       <h:form id="user_logout" rendered="#{userLoginController.isUserLoggedIn()}">
+                               <div class="table">
+                                       <div class="table_header">
+                                               <h:outputText value="#{msg.LOGIN_USER_LOGOUT_TITLE}" />
+                                       </div>
+
+                                       <div class="para">
+                                               <h:outputText value="#{msg.LOGIN_USER_LOGOUT_NOTICE}" />
+                                       </div>
+
+                                       <div class="table_footer">
+                                               <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                               <h:commandButton styleClass="submit" type="submit" action="#{userLoginController.doUserLogout()}" value="#{msg.BUTTON_USER_LOGOUT}" />
+                                       </div>
+                               </div>
+                       </h:form>
+
+                       <ui:fragment rendered="#{not userLoginController.isUserLoggedIn()}">
+                               <ui:include src="/WEB-INF/templates/user/user_not_logged_in.tpl" />
+                       </ui:fragment>
+               </ui:define>
+       </ui:composition>
+</html>