Forums / Developer / Logging user in

Logging user in

Author Message

Glenn MacGregor

Tuesday 18 May 2004 6:06:31 am

Hi All,

I am protecting certain parts of my site by checking the is_logged_in on the current_user variable. This works great, but If the user is not logged in I want to display the /user/login form right in the page I am in. So my template looks like this:

{let current_user=fetch('user', 'current_user') }
Some HTML here
{section show=$current_user.is_logged_in}
All info for logged in users here
{section-else}
Some text about logging in...
{include uri="design:login.tpl"}
{/section}
{/let}

With this I never get the login.tpl to show, I do get the "Some text about logging in..." but that is it. Do I have my uri incorrect?

Also is there a way to disable the "Sign Up" button. I don't want anyone to beable to sing up and enter my protected areas.

Thanks

Glenn

Dominik Pich

Tuesday 18 May 2004 10:03:53 am

Acctually, you would do better to let ez keep track of whether a user is logged in and has the priviliges to do that : set up roles for views and functions
Also IIRC there is an ini setting for how to display the login...

Glenn MacGregor

Tuesday 18 May 2004 11:37:17 am

I would love to let ez handle that, but I couldn't figure out how to do that. So this is the only way I say to handle it.

Any clues??