login logic

Permalink
Hello! I have a client who wants a Beta section on his site. Visitors who aren't logged in should see the link, but when they click on it will be taken to the login page. Users who are logged in will click through to the actual beta page.

I thought of doing this all on one page, hiding the beta content using block-level permissions. But I don't think that will let me hide the login block for folks who are already logged in. Is there a better way?

Thanks!

 
frz replied on at Permalink Best Answer Reply
frz
yeah make a page for the beta content, tie it to a user group.

if you look in the options of the page list or autonav block, you'll see you can tell it to show links to pages you don't have access to. If you do, the visitor will be asked to login and if they are in a group with access, they will end up where they were heading and all will be good.
lcbrett replied on at Permalink Reply
This worked like a charm! Thanks, Frz!

(Thanks to Vijay, also--I'm sure that will come in handy as well!)
SVijay replied on at Permalink Reply
SVijay
Hi,

You can check whether a user is logged in or not by using the below given code
<?php 
 global $u;
if ($u -> isLoggedIn ()) {
echo "Logged in!";
}
 ?>


for more details go through the below given links

https://www.concrete5.org/community/forums/customizing_c5/discrimina...


http://www.concrete5.org/community/forums/customizing_c5/determine_...