Hi Andy,<br><br>I used your script to display the user that is logged in a block<br>but some how is displays other user.<br><br>When I go to the <a href="http://drupla/user">http://drupla/user</a> link it shows the correct user but the scripts that added as a block shows a different user:<br>
<?php global $user; <br> <?php if ($user->uid): ?><br>
Welcome <b><?php print $user->name; ?></b><br>
<?php else: ?><br>
<div class="im"> <a href="<?php print base_path() ?>user/" >Log in /<br>
register</a><br>
</div> <?php endif; ?><br><br>I can tell you that I am using automatically log in with webserver_auth<br><br>The correct user is logged in but the small script show the wrong user<br>do you have any idea?<br>
<br>I try different ways to display the correct user in the Welcome Block but it does not display the correct user in the block<br><br>Thanks,<br><br>Néstor :-)<br>
<br><br><br><br><div class="gmail_quote">On Sat, Oct 10, 2009 at 12:02 PM, andy baxter <span dir="ltr"><<a href="mailto:andy@earthsong.free-online.co.uk">andy@earthsong.free-online.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Martin Hooper wrote:<br>
> Is there a module that will display the logged in user?<br>
><br>
</div>I just added the following code into a suitable place in my page.tpl.php:<br>
<br>
<?php if ($user->uid): ?><br>
Welcome <?php print $user->name; ?><br>
(<a href="<?php print base_path() ?>logout/" >Log out</a>)<br>
<?php else: ?><br>
<div class="im"> <a href="<?php print base_path() ?>user/" >Log in /<br>
register</a><br>
</div> <?php endif; ?><br>
<br>
This prints 'Welcome <user name>' plus a log in /out link.<br>
<br>
If that's any help?<br>
<font color="#888888"><br>
andy<br>
</font><div><div></div><div class="h5">--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div></blockquote></div><br>