Share » Forums » General » Add a login/logout link

Add a login/logout link

Add a login/logout link

Thursday 29 July 2004 8:39:26 am - 3 replies

Modified on Thursday 29 July 2004 8:40:34 am by Franck T.

Author Message

Eivind Marienborg

Thursday 29 July 2004 8:50:34 am

Have you tried printing the £current_user.contentobject_id and $anonymous_user_id to see if they match?

Anyways, EZ has a built-in function to check for login: http://ez.no/ez_publish/documentation/reference/data_fetching/user/is_logged_in . It might work using that.

Eivind

Bruce Morrison

Thursday 29 July 2004 4:14:27 pm

Try this. I've used if before

{let thisuser=fetch('user','current_user')}
  {section show=$thisuser.is_logged_in}
<p>Welcome. You are logged in as {$thisuser.contentobject.name}</p>
<p><a href={"/user/logout"|ezurl}>Logout</a></p>
  {section-else}
  
<p><a href={"/user/login/"|ezurl}> Login</a></p>                                                                                
  
  {/section}
{/let}
</div>

Cheers
Bruce http://www.designit.com.au/

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Franck T.

Friday 30 July 2004 12:29:16 am

Yeah, it works fine.
Thanks a lot for your help.

Regards,

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu