User profiles enabled, how do they sign out?

Permalink
Hey, I am setting up a website for a client and I set up member profiles but when I sign in as one of the dummy accounts I dont see any options to sign out. I searched the forum but I couldn't find anything.

Your help is much appreciated. Thanks

 
LucasAnderson replied on at Permalink Reply
LucasAnderson
I think you would just need to create a link that directs to:http://www.yoursite.com/login/-/logout...
Brainakazariua replied on at Permalink Reply
Brainakazariua
There is no good option for it.
The best way at the moment is to add a link on a page (home or login/logout) which links to site.com/index.php/login/-/logout
make it a block with permissions set so only registered users can view it, that way people only see it when they are logged in.
merge replied on at Permalink Reply
Thanks for the quick replies! I appreciate both of your answers and so quick too!

I just ran into another problem. I hard coded the login page and the register page and when I set the permissions so that registered users cant see the page the link stays because it is hard coded.

Maybe their is a way to add them into the autonav? When I searched for it, I eventually ran into the solution of hard coding them in.
garynobles replied on at Permalink Reply
also you can use the login block, once logged in it has a logout button
merge replied on at Permalink Reply
Thanks garynobles! I think I may have to go with this option.
Brainakazariua replied on at Permalink Reply
Brainakazariua
Since when? Did they update it since I use the login block and all it has it login, after loging in it still has only login
merge replied on at Permalink Reply
I tried the login block and it appears to still be version 1, but I did see some fixes for it around the forum. I haven't tried them though but hard coding the links in works fine.

I just need to learn how to only show the links when signed in and when signed out. I would really appreciate if someone can help me. I just started learning php and understand if elseif and else but I dont exactly know what I should be writing. lol

If someone chimes in that would be awesome but if not when I figure it out I will update.

Thanks
merge replied on at Permalink Best Answer Reply
Here's the code that fixed my situation.

$u = new User();
?>
<?php
if ($u->checkLogin()){ ?>
<li><a href="<?php {echo View::url('/login/logout');} ?>" title="Log Out">Log Out</a></li>
<?php
}else{
?>
<li><a href="<?php echo View::url('/login');?>" title="Login to the site">Login</a></li>
<li><a href="<?php echo View::url('/register');?>" title="Register">Register</a></li>
<?php
}
?>

Enjoy!!
michaelbard replied on at Permalink Reply
This way is simple, easy and absolutely works as stated below by a few other helpful users.

I simply created a content block with a link called "Logout" and linked it tohttp://www.mysite.com/index.php/login/-/logout...

Done