[Zope] Obtaining the User's Name from a Python Script in Zope

Paavo Parkkinen pparkkin@verso.st.jyu.fi
Mon, 21 Jul 2003 20:09:24 +0300


On ma, 21.07.2003 at 11:02 -0600, Tom Nichols wrote:

> I have used the getUserName() function in page templates and passed tha=
t
> name as a parameter to python scripts in Zope.  But, now I need to
> independently verify the authenticated user from a script, not relying
> on anything passed in from a page.  Is it possible to do so, and if so,
> how?  The basic need is to obtain the logged in user's name from a
> script directly from Zope from within a python script. =20

print container.REQUEST.AUTHENTICATED_USER.getUserName()
return printed

--=20
paavo.

 "joskus voi t=E4=E4 meno k=E4yd=E4 ahdistavaksi
  kun on t=E4=E4ll=E4 muodostunut tavaksi
  muuttaa jokaisen el=E4m=E4n arvo rahaksi"