I am using fourseason theme and add code for showing username and logout option at top of the page.

The problem is that after logout the option of logout still show on the frontpage of drupal.

The is as follows:-

global $user;
Logged in as: print l(ucwords($user->name),'user/'.$user->uid); |
 if ($user->uid)
{
print l("logout","logout"); 
} 

The script I added is on the page.tpl.php

Comments

prematurebaby’s picture

you can add a secondary link for logout and it disappears when you logout. The path is just logout. I just dont know how to display the username, but that doesn't bother me too much.

anou’s picture

you should try to write this :

<?php
if ($user->uid != 0)
{
print l("logout","logout");
}
?>

David THOMAS
http://www.smol.org