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>
&lt;?php global $user; <br>              &lt;?php if ($user-&gt;uid): ?&gt;<br>
                 Welcome &lt;b&gt;&lt;?php print $user-&gt;name; ?&gt;&lt;/b&gt;<br>
               &lt;?php else:  ?&gt;<br>
<div class="im">                 &lt;a href=&quot;&lt;?php print base_path() ?&gt;user/&quot; &gt;Log in /<br>
register&lt;/a&gt;<br>
</div>               &lt;?php endif; ?&gt;<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">&lt;<a href="mailto:andy@earthsong.free-online.co.uk">andy@earthsong.free-online.co.uk</a>&gt;</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>
&gt; Is there a module that will display the logged in user?<br>
&gt;<br>
</div>I just added the following code into a suitable place in my page.tpl.php:<br>
<br>
               &lt;?php if ($user-&gt;uid): ?&gt;<br>
                 Welcome &lt;?php print $user-&gt;name; ?&gt;<br>
                 (&lt;a href=&quot;&lt;?php print base_path() ?&gt;logout/&quot; &gt;Log out&lt;/a&gt;)<br>
               &lt;?php else:  ?&gt;<br>
<div class="im">                 &lt;a href=&quot;&lt;?php print base_path() ?&gt;user/&quot; &gt;Log in /<br>
register&lt;/a&gt;<br>
</div>               &lt;?php endif; ?&gt;<br>
<br>
This prints &#39;Welcome &lt;user name&gt;&#39; plus a log in /out link.<br>
<br>
If that&#39;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>