Show memberpage when signed in only

Permalink
Hi all!

I have hidden the members page from navigation.
But I would like the members page to be visible for people that are signed in.

How can I do this?
I tried to understand the autonav php files but i give up!

 
mesuva replied on at Permalink Reply
mesuva
Edit the permissions of the page - uncheck 'Guest' and check 'Registered Users'. The autonav will pick this up and only show the page on the nav to users that are logged in.

(and undo your hiding of the page)
Erik74 replied on at Permalink Reply
I tried that, the problem then was that the member link is still visible in the menu when you are signed out.

I don't want it at all unless you are signed in.
Now you see it but can´t access it.
mesuva replied on at Permalink Reply
mesuva
Maybe in your autonav block, you've checked 'Display pages to users even when those users cannot access those pages' ?

This needs to be unchecked.
mkly replied on at Permalink Reply
mkly
This might be a caching issue. Try clearing the cache.
Erik74 replied on at Permalink Reply 2 Attachments
Everything is cleared in cache settings(I have it in: Off - Good for development).
Cache cleared manually in C5 and also in browser.

Looked at the page in another browser and members was still there....

To be clear. Its the LINK in the main menu we are talking about, not the page itself.
cul8rv8 replied on at Permalink Reply
I am having this same issue. I only want the page visible to registered users, and the link in the nav to also only be visible to registered users. I have several pages that are working correctly, but I can't get the members page off the nav menu for guests, even though all my other private pages are off there.
Erik74 replied on at Permalink Reply
I gave up on it.
If you find a sollution please post it.

I guess we could do a new autonav template and then change autonav when people are logged in.
mesuva replied on at Permalink Reply
mesuva
The members page is treated differently in the autonav controller.

I had a look at the displayPage function of controller.php for the autonav and it appears that it doesn't check permissions for the page.

You should be able to copy /concrete/blocks/autonav/controller.php to /blocks/autonav/controller.php and edit the displayPage function, replacing it with this:

protected function displayPage($tc) {
         $tcp = new Permissions($tc);
         if ($tc->isSystemPage() && (!$this->displaySystemPages)) {
            if ($tc->getCollectionPath() == '/members' && Config::get('ENABLE_USER_PROFILES') && $tcp->canRead()) {
               return true;
            }
            return false;
         }
         $tcv = $tc->getVersionObject();
         if ((!is_object($tcv)) || (!$tcv->isApproved() && !$this->displayUnapproved)) { 
            return false;
         }
         if ($this->displayUnavailablePages == false) {
            if (!$tcp->canRead() && ($tc->getCollectionPointerExternalLink() == null)) {
               return false;


I'm assuming you're using 5.5.x here. It's probably very similar in 5.4.x though.
mesuva replied on at Permalink Reply
mesuva
Just following this up, did my suggestion work?

If so, I think I'd probably submit this as a bug fix.