[Zope] Obtaining user name in python

Andreas Jung lists at zopyx.com
Fri Nov 28 02:53:17 EST 2008


from AccessControl import getSecurityManager

user = getSecurityManager().getUser().getUserName()

-aj

On 28.11.2008 8:40 Uhr, Garry Saddington wrote:
> I can do this in DTML:
> <dtml-var "_.SecurityGetUser().getUserName()">
>
> but I want to do it from a Python script, where the use of the underscore is
> not allowed. Can anyone point me in the correct direction?
> Regards
> Garry
> _______________________________________________
> Zope maillist  -  Zope at 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 )


-- 
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: info at zopyx.com - Phone +49 - 7071 - 793376
Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20081128/6d19cf23/attachment.vcf 


More information about the Zope mailing list