Personal tools
You are here: Home Documentation How-tos Hide the Not-Logged-In and Join links
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Hide the Not-Logged-In and Join links

This How-to applies to: Any version.
This How-to is intended for: Integrators, Customizers

How to hide the "not logged in" message and "Join" buttons on the personal bar.

NOTE: If you're using Plone 3 or later, the easiest way to turn off self-registration is to use the checkbox "Enable self-registration" in the Security control panel. It's off by default from Plone 3 onwards.


Assume that you or your team does all the content work on your plone site, and you never want visiting public to become involved in adding or editing the content. In that case, perhaps you'd rather that the visiting public didn't see the message "You are not logged in", and you'd rather they didn't see the link enabling them to join and fiddle with your site.

It's easy to remove the message and the link.

Removing Actions

First, we'll want to disable the "join" and "login" actions. Once the actions are disabled, they won't appear on the forms any longer.

In the ZMI, go to portal_registration, under the Actions tab. De-select the "visible" field for the "join" action.

Also, in portal_membership, under the Actions tab, de-select "visible" for "login".

Now, users won't see either the "login" or "join" messages.

Removing the Reminder

They will still see the "You are not logged in..." text.

Your first step is to locate the offending code. So in the ZMI (Zope Management Interface), searching via the 'find' tab, on the words "logged in" you will find:

/sitename/portal_skins/plone_templates/global_personalbar

Go to this template, then click the 'Customize' button. This makes a copy of the document in the 'custom' folder. You can now tweak that copy without disturbing the original, and your changed document will be used by plone instead of the original document.

Now you'll edit this file.

Down the page, find and comment out the line displaying "you are not logged in".

Comment out or delete just this line:

<li class="portalNotLoggedIn" tal:condition="isAnon" i18n:translate="you_are_not_logged_in">
            You are not logged in
</li>

As long as it's a visitor (non-logged-in, therefore an anonymous person), it displays nothing. For anybody else who has logged-in, it displayes the required and usual helpful choices.

If you don't want to edit templates, you can also remove the "You are not logged in" message using CSS. In ploneCustom.css, add this statement:

#portal-personaltools .portalNotLoggedIn {
    display: none;
}

But now, how will you log in?

When you or your team mosey over to your site, you'll no longer see the 'log in' link, but that's no problem. Just aim your browser at your site's 'login_form' page, and there you'll be.

For example, if you normally call your plone site at the address:

http://www.example.com

then just aim your browser at:

http://www.example.com/login_form

Hidden from the public, easy for you to reach.

One danger remains

It is still possible that a mean old public person might come along, and maybe they know plone and they recognize your site from the Plone logo or the copyright notice or the pretty tabs. They might have even read this fine miniHOWTO! In a case like that, they could still browse to your login_form page, and there they could 'join', 'log in', and perhaps contribute all sorts of 'colorful matter' to your website. Wouldn't that be a fine kettle of fish?

Therefore, you may wish to also disable the 'join' mechanism. Alexander Limi has written this up and it's found in these 'how to' documents as "How to make the site so Members can't add themselves":http://www.plone.org/documentation/howto/closing-site

When you've thus buttoned up your site, it should be safe from unauthorized 'improvements' by the rascally visiting public!

by Joel Burton last modified January 6, 2008 - 20:11 All content is copyright Plone Foundation and the individual contributors.

Authorship, location

Posted by Frank Bennett at July 15, 2006 - 04:16

The linked doc on closing perms for the Join button has Alan Runyan in the byline, might want to change the attribution here to keep things consistent. Also, it would be helpful to browsers (the people, not the software) to adjust the category of this document so that it appears together with that linked document, as the two are very closely related.

Just a couple of suggestions.

Plone 2.5.1

Posted by Martin Fuchs at November 2, 2006 - 23:43
Not the best way, but it works ....
in /"site"/portal_skins/custom/portlet_login change

<div metal:define-macro="portlet"
tal:omit-tag=""
tal:define="pageloc python: request.URL.split('/')[-1];
okToShowHere python: not pageloc in ('login_form', 'join_form');
auth nocall:here/acl_users/credentials_cookie_auth|nothing"
tal:condition="python: isAnon and okToShowHere">

to something like

<div metal:define-macro="portlet"
tal:omit-tag=""
tal:define="pageloc python: request.URL.split('/')[-1];
okToShowHere python: not pageloc in ('login_form', 'join_form');
donotshow python: pageloc in ('login_form', 'join_form');
auth nocall:here/acl_users/credentials_cookie_auth|nothing"
tal:condition="python: isAnon and okToShowHere and donotshow">

partial fix for 2.5.x

Posted by John DeStefano at January 29, 2007 - 15:38
schmartin's code above definitely hides the login portlet in 2.5.x when not logged in (thank you!), and code in the how-to works to hide the "Log In" link in the top-right-hand bar.

But how do we remove the "Log in to add comments" button on each page?

1) In the ZMI, navigate to /portal_skins/plone_templates/viewThreadsAtBottom, and then click Customize.
2) Delete or comment-out the code that begins:
<form tal:condition="python:isAnon and not userHasReplyPermission and isDiscussionAllowed"
3) Click Save.

Also, don't forget to disable the join mechanism as mentioned above.

Removing Join is redundant

Posted by Cliff Quinn at November 16, 2007 - 01:36
Note that removing the "Join" link in Portal_registration is redundant, because the security machinery does that if you disable anonymous joins (as mentioned in the Limi howto above) by Uncheck Acquire for Add portal member (and giving it to manage).

ALso note that this a just a checkbox in Plone 3. Yay!

removing members tab for anonymous users plone 2.5

Posted by Alex C at December 13, 2007 - 12:36
can somebody help, pls? I didn't find anywhere how to remove in Plone 2.5.3 the Members tab and Login form , for the anonymous users.

THX !!

how to remove "Log in to add comments" reminder in Plone 3?

Posted by John DeStefano at January 11, 2008 - 18:46
The ViewThreadsAtBottom template has been moved to /portal_skins/plone_deprecated/ in Plone 3. Is there now a better way to prevent "Log in to add comments" from being displayed to anonymous users, instead of editing this template?

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by