}
@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)));
}
}
boolean isGuest ();
/**
- * Whether the currently logged-in user is not invisible
+ * Whether the currently logged-in user is invisible
* <p>
- * @return Whether the currently logged-in user is not invisible
+ * @return Whether the currently logged-in user is invisible
*/
- boolean isNotInvisible ();
+ boolean isInvisible ();
}
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.
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".
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">
<ui:composition template="/WEB-INF/templates/#{loginController.templateType}/#{loginController.templateType}_base.tpl">
<ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_START_SHARING_ADDRESSBOOK}</ui:define>
</div>
<div class="para">
- <h:dataTable id="userList" headerClass="table_header_column" var="user" value="#{addressbookController.allUsersNotSharing()}" rendered="#{loginController.isNotInvisible()}">
- <h:column>
- <f:facet name="header">#{msg.USER_ID}</f:facet>
- <h:outputText value="#{user.userId}" />
- </h:column>
-
- <h:column>
- <f:facet name="header">#{msg.USER_NAME}</f:facet>
- <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
- <ui:param name="user" value="#{user}" />
- </ui:include>
- </h:column>
-
- <h:column>
- <f:facet name="header">#{msg.LOGIN_START_SHARING_TITLE}</f:facet>
- <h:form acceptcharset="utf-8" id="startSharing" rendered="#{profileController.isProfileLinkVisible(user)}">
- <h:commandButton class="submit" id="submit" value="#{msg.LOGIN_START_SHARING_BUTTON}" action="#{shareController.startSharing(user, addressbookController.addressbook)}" title="#{msg.LOGIN_START_SHARING_BUTTON_TITLE}" />
- </h:form>
- </h:column>
- </h:dataTable>
+ <c:choose>
+ <c:when test="#{loginController.isUserLoggedIn() and not loginController.isInvisible()}">
+ <h:dataTable id="userList" headerClass="table_header_column" var="user" value="#{addressbookController.allUsersNotSharing()}">
+ <h:column>
+ <f:facet name="header">#{msg.USER_ID}</f:facet>
+ <h:outputText value="#{user.userId}" />
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">#{msg.USER_NAME}</f:facet>
+ <ui:include src="/WEB-INF/templates/generic/user_profile_link.tpl">
+ <ui:param name="user" value="#{user}" />
+ </ui:include>
+ </h:column>
+
+ <h:column>
+ <f:facet name="header">#{msg.LOGIN_START_SHARING_TITLE}</f:facet>
+ <h:form acceptcharset="utf-8" id="startSharing" rendered="#{profileController.isProfileLinkVisible(user)}">
+ <h:commandButton class="submit" id="submit" value="#{msg.LOGIN_START_SHARING_BUTTON}" action="#{shareController.startSharing(user, addressbookController.addressbook)}" title="#{msg.LOGIN_START_SHARING_BUTTON_TITLE}" />
+ </h:form>
+ </h:column>
+ </h:dataTable>
+ </c:when>
+ <c:when test="#{not loginController.isUserLoggedIn()}">
+ <h:outputText id="ownProfileInvible" class="notice" value="#{msg.USER_NOT_LOGGED_IN}" />
+ </c:when>
+ <c:otherwise>
+ <h:outputText id="ownProfileInvible" class="notice" value="#{msg.LOGIN_OWN_PROFILE_INVISIBLE}" />
+ </c:otherwise>
+ </c:choose>
</div>
<div class="table_footer">
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">
<f:metadata>
<f:viewParam id="addressbookId" name="addressbookId" value="#{addressbookController.addressbookId}" required="true" requiredMessage="#{msg.PARAMETER_ADDRESSBOOK_ID_MISSING}" converterMessage="#{msg.PARAMETER_ADDRESSBOOK_ID_INVALID}" validatorMessage="#{msg.PARAMETER_ADDRESSBOOK_ID_NOT_FOUND}">
<h:outputText id="addressbookStatus" value="#{msg[addressbookController.addressbook.addressbookStatus.messageKey]}" title="#{msg.ADDRESSBOOK_STATUS_TITLE}" />
<f:facet name="footer">
- <ui:fragment rendered="#{loginController.isUserLoggedIn()}">
- <ui:fragment rendered="#{addressbookController.isOwnAddressbook()}">
- <h:link id="startSharing" outcome="login_start_sharing_addressbook" value="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK}" title="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK_TITLE}" />
- </ui:fragment>
-
- <ui:fragment rendered="#{addressbookController.isOtherAddressbook()}">
- Bla bla
- </ui:fragment>
- </ui:fragment>
+ <c:choose>
+ <c:when test="#{loginController.isUserLoggedIn() and not loginController.isInvisible()}">
+ <c:choose>
+ <c:when test="#{addressbookController.isOwnAddressbook()}">
+ <h:link id="startSharing" outcome="login_start_sharing_addressbook" value="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK}" title="#{msg.LINK_LOGIN_START_SHARING_ADDRESSBOOK_TITLE}" />
+ </c:when>
+
+ <c:when test="#{addressbookController.isOtherAddressbook()}">
+ Bla bla
+ </c:when>
+ </c:choose>
+ </c:when>
+ <c:when test="#{not loginController.isUserLoggedIn()}">
+ <h:outputText id="ownProfileInvible" class="notice" value="#{msg.USER_NOT_LOGGED_IN}" />
+ </c:when>
+ <c:otherwise>
+ <h:outputText id="ownProfileInvible" class="notice" value="#{msg.LOGIN_OWN_PROFILE_INVISIBLE}" />
+ </c:otherwise>
+ </c:choose>
</f:facet>
</h:panelGrid>
</ui:define>