[Zope] Displaying username

Dylan Reinhardt zope@dylanreinhardt.com
Mon, 27 Jan 2003 08:19:00 -0800


At 07:59 AM 1/27/2003, fritz wrote:
>Am Montag, 27. Januar 2003 16:26 erhalten:
> > May sound like an easy question, but how do I display a logged in users
> > username in a dtml document, what I am planning to do is use that username
> > to search our staff directory and pull back their first and last name
> >
> > Thanks
> >
> > James
>
><dtml-unless "AUTHENTICATED_USER.has_role('Anonymous')">
>          Hi, <dtml-var AUTHENTICATED_USER>
></dtml-unless>

Note that use of AUTHENTICATED_USER is deprecated.

If you're just using it to print out a username, that's probably no big 
deal, but it would be a bad idea to use AUTHENTICATED_USER for any *real* 
security operations.

See: http://www.zopelabs.com/cookbook/992447999

Dylan