Added logout to the header

Displaying options based on if the user is authenticated or not.
This commit is contained in:
Josh Sherman 2013-12-16 22:19:32 -05:00
parent 34c41764b5
commit 3e769286d2
2 changed files with 10 additions and 3 deletions

View file

@ -2,7 +2,6 @@
class login extends AnonymousModule class login extends AnonymousModule
{ {
} }
?> ?>

View file

@ -48,10 +48,18 @@
'/' => 'Home', '/' => 'Home',
'/about' => 'About', '/about' => 'About',
'/contact' => 'Contact', '/contact' => 'Contact',
'/login' => 'Sign in',
'/join' => 'Sign up',
); );
if (User::isAuthenticated())
{
$links['/logout'] = 'Logout';
}
else
{
$links['/login'] = 'Sign in';
$links['/join'] = 'Sign up';
}
foreach ($links as $uri => $label) foreach ($links as $uri => $label)
{ {
$active = ''; $active = '';