[Zope] Get current username within pythonscript
H.de.Wit@SFK.NL
H.de.Wit@SFK.NL
Wed, 29 Jan 2003 10:24:27 +0100
>> from AccessControl import getSecurityManager
>> return getSecurityManager().getUser()
>>
>how about:
>
># Returns the name of the current authenticated user
>return(context.REQUEST.AUTHENTICATED_USER.getUserName())
REQUEST.AUTHENTICATED_USER works,
but i remember that this is not as safe as the other method.
getSecurityManager().getUser() is the preferred one.
Met vriendelijke groeten,
Hans de Wit
Stichting Farmaceutische Kengetallen
Postbus 30460
2500 GL DEN HAAG
Tel. 070-3737448
Fax 070-3737445