From: Roland Haeder Date: Mon, 19 Oct 2015 10:53:52 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7d4e6e46cc2a7a72912a9331a1b1f605dcf9e254;p=addressbook-war.git Continued: - renamed isNotInvisible() to isInvisible() - added message on case if the user is invisible - rewrote ui:fragment-abuse to c:choose, still a bit abusive to JSF, but better than ui:fragment - added missing i18n strings Signed-off-by:Roland Häder --- diff --git a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java index 8854311a..ca8874f7 100644 --- a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java +++ b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionBean.java @@ -174,8 +174,14 @@ public class UserLoginWebSessionBean implements UserLoginWebSessionController { } @Override - public boolean isNotInvisible () { + public boolean isInvisible () { + // Check on login + if (!this.isUserLoggedIn()) { + // Not logged in! + throw new IllegalStateException("isInvisible() was called for guest."); //NOI18N + } + // Check logged-in first, then invisibility - return ((this.isUserLoggedIn()) && (!Objects.equals(this.getLoggedInUser().getUserProfileMode(), ProfileMode.INVISIBLE))); + return ((Objects.equals(this.getLoggedInUser().getUserProfileMode(), ProfileMode.INVISIBLE))); } } diff --git a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java index 680cdf2e..89ae8d2e 100644 --- a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java +++ b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebSessionController.java @@ -76,9 +76,9 @@ public interface UserLoginWebSessionController extends Serializable { boolean isGuest (); /** - * Whether the currently logged-in user is not invisible + * Whether the currently logged-in user is invisible *

- * @return Whether the currently logged-in user is not invisible + * @return Whether the currently logged-in user is invisible */ - boolean isNotInvisible (); + boolean isInvisible (); } diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index 303ee878..e5935a8f 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -263,3 +263,5 @@ USER_PROFILE_MODE_SELECTION_NOTICE2=Stellen Sie auf "Nur Mitglieder", koennen an USER_PROFILE_MODE_SELECTION_NOTICE3=Stellen Sie auf "Alle", ist Ihr Profil im gesamten Internet sichtbar, auch Bots. LOGIN_NO_PASSWORD_MESSAGE=Sie haben kein Passwort eingegeben. LOGIN_NO_USER_NAME_MESSAGE=Sie haben keinen Benutzernamen eingegeben. +USER_NOT_LOGGED_IN=Sie sind nicht angemeldet. +LOGIN_OWN_PROFILE_INVISIBLE=Ihr Profil ist auf "durchsichtig" gestellt. diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 366ec33f..1bbe0411 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -258,3 +258,5 @@ USER_PROFILE_MODE_SELECTION_NOTICE2=If you choose "Only members", other users ca USER_PROFILE_MODE_SELECTION_NOTICE3=If you choose "All" the whole Internet can view your profile, including bots. LOGIN_NO_PASSWORD_MESSAGE=You have entered no password. LOGIN_NO_USER_NAME_MESSAGE=You have entered no user name. +USER_NOT_LOGGED_IN=You are not signed in. +LOGIN_OWN_PROFILE_INVISIBLE=Your profile is set to "invisible". diff --git a/web/login/login_start_sharing_addressbook.xhtml b/web/login/login_start_sharing_addressbook.xhtml index ec61e50d..d9c930b2 100644 --- a/web/login/login_start_sharing_addressbook.xhtml +++ b/web/login/login_start_sharing_addressbook.xhtml @@ -4,7 +4,8 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" - > + + xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"> #{msg.PAGE_TITLE_LOGIN_START_SHARING_ADDRESSBOOK} @@ -21,26 +22,36 @@

- - - #{msg.USER_ID} - - - - - #{msg.USER_NAME} - - - - - - - #{msg.LOGIN_START_SHARING_TITLE} - - - - - + + + + + #{msg.USER_ID} + + + + + #{msg.USER_NAME} + + + + + + + #{msg.LOGIN_START_SHARING_TITLE} + + + + + + + + + + + + +