Search code examples
liferayliferay-6liferay-theme

Hide Sign Out Link in Liferay 6.2 Dockbar


In Liferay 6.1, we created a hook to hide the sign out link in the dockbar. However, when I look at the code for 6.2, I see the following:

<c:if test="<%= themeDisplay.isShowSignOutIcon() %>">
    <aui:nav-item cssClass="sign-out" href="<%= themeDisplay.getURLSignOut() %>" iconCssClass="icon-off" label="sign-out" />
</c:if>

No matter how much I google, I can't find any reference to themeDisplay.isShowSignOutIcon(), aside from the API reference, which does me no good, as it is not commented at all. I did find the page that discusses the native LR theme properties and apparently determining whether to show/hide a sign out linkn is not one of the native theme properties.

Does anyone know if you can set the theme itself to show/hide the sign out link and how you would go about doing it?


Solution

  • I too analyzed ServicePreAction code, and found that all this code does is:

    • checks if the user is logged in or not
    • if yes, shows 'sign out' link, not otherwise

    You can simply create a hook to override html/portlet/dockbar/view_user_account.jspf to either remove that code snippet from this jsp to hide it for all scenarios OR modify the condition to show/hide as per your requirements.