Hide the Not-Logged-In and Join links
This How-to applies to:
Any version.
This How-to is intended for:
Integrators, Customizers
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!
Plone 2.5.1
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
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
ALso note that this a just a checkbox in Plone 3. Yay!
removing members tab for anonymous users plone 2.5
THX !!
Authorship, location
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.