[Zope] get current username

Dieter Maurer dieter@handshake.de
Mon, 26 May 2003 20:29:28 +0200


Matt Ficken wrote at 2003-5-25 13:22 -0500:
 > how can my product get the username of the user accessing it?

Others told you how to do it in DTML, ZPT.

In Python Scripts and external Python code, there is unfortunately
a different way:

  from AccessControl import getSecurityManager
  ....
  sm= getSecurityManager() # the current security manager
  sm.getUser() # the current user
  ...


Dieter