[Zope] get current username

Jeff Peterson jpeterso@rangebroadband.com
Sun, 25 May 2003 13:34:39 -0500


dtml::

<dtml-var "REQUEST.AUTHENTICATED_USER.getUserName()">

zpt::

<span tal:replace="structure
python:request.AUTHENTICATED_USER.getUserName()"/>


script::

request = context.REQUEST
print request.AUTHENTICATED_USER.getUserName()
return printed




>>-----Original Message-----
>>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Matt
>>Ficken
>>Sent: Sunday, May 25, 2003 1:22 PM
>>To: zope@zope.org
>>Subject: [Zope] get current username
>>
>>
>>how can my product get the username of the user accessing it?
>>I read on the Zope API page that there is an AuthenticatedUser
>>class with a getUserName method that should do what I want, but
>>I don't know how to use it.
>>
>>--
>>__________________________________________________________
>>Sign-up for your own FREE Personalized E-mail at Mail.com
>>http://www.mail.com/?sr=signup
>>
>>
>>_______________________________________________
>>Zope maillist  -  Zope@zope.org
>>http://mail.zope.org/mailman/listinfo/zope
>>**   No cross posts or HTML encoding!  **
>>(Related lists -
>> http://mail.zope.org/mailman/listinfo/zope-announce
>> http://mail.zope.org/mailman/listinfo/zope-dev )