Show an icon in autonav menu next to "Members Only" content

Permalink 3 users found helpful
Hi there

I have already overridden the autonav controller. Essentially what I want to do is that if the user is logged in to the site, then next to the pages they COULDNT access as a guest, show a little member icon (eg a key or a user or some icon).

So i assume i need to get the autonav to check if the page isnt accessible as a guest, and if that's true then add an icon? Not sure how to do this though.

Any advice would be great. thanks!

Harvey

harveyappleton
 
anchoredbutterfly replied on at Permalink Reply
anchoredbutterfly
When you go to edit the autonav block, there is a setting there you can use:
Viewing Permissions
Display pages to users even when those users cannot access those pages.
harveyappleton replied on at Permalink Reply
harveyappleton
Thanks, but i want to show ONLY to *registered users* an icon by the pages that THEY have access to and guests DON'T.
Phallanx replied on at Permalink Reply
Phallanx
$u = new User();
if ($u->isRegistered()) {
// your stuff here
}
harveyappleton replied on at Permalink Reply
harveyappleton
Thanks but that would just put an icon next to every autonav item.

how do i do this:

$ui = UserInfo::getByUserName('johndoe');
   $tp = TaskPermission::getByHandle('page_defaults');
   if ($tp->can($ui)) {
      print 'johndoe can access';
   }

found here:http://www.concrete5.org/documentation/developers/permissions/task-...

but for a guest user who ISNT registered? so basically to check if a guest can access a page?