[support] displaying who you are logged in as

Martin Hooper martin.hooper at gmail.com
Sun Oct 11 04:37:58 UTC 2009


Thanks Andy - Discovered the core Who's online module which will do fine!


On Sat, Oct 10, 2009 at 9:02 PM, andy baxter
<andy at earthsong.free-online.co.uk> wrote:
> Martin Hooper wrote:
>> Is there a module that will display the logged in user?
>>
> I just added the following code into a suitable place in my page.tpl.php:
>
>               <?php if ($user->uid): ?>
>                 Welcome <?php print $user->name; ?>
>                 (<a href="<?php print base_path() ?>logout/" >Log out</a>)
>               <?php else:  ?>
>                 <a href="<?php print base_path() ?>user/" >Log in /
> register</a>
>               <?php endif; ?>
>
> This prints 'Welcome <user name>' plus a log in /out link.
>
> If that's any help?
>
> andy
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>


More information about the support mailing list