Checking Authenticated User Name???
Greetings All, I apologize if this question has been asked before, but I searched (and searched, and searched), but couldn't find any hint of an answer. The question that I have is: What's the best way to query the logged in user's name in a python script (not external script and not with DTML)? The API docs mention something about an AuthenticatedUser class, but I can't find the object anywhere in my ./Zope/lib/python directory, and it doesn't appear to be a class in any of the zope modules that I searched through. I did notice a reference to something like this... REQUEST.AUTHENTICATED_USER.getUserName() but, this doesn't seem like it would be any more secure than just assigning REQUEST.AUTHENTICATED_USER to a variable. I'll be eternally grateful to the person who can answer this, or provide me with a good resource that can answer this. =) Sincerely, Jason Burke
On Thursday 11 April 2002 01:01, Jason Burke wrote:
I did notice a reference to something like this...
REQUEST.AUTHENTICATED_USER.getUserName()
but, this doesn't seem like it would be any more secure than just assigning REQUEST.AUTHENTICATED_USER to a variable.
Suppose someone does assign REQUEST.AUTHENTICATED_USER like 'foo' then the classmethod getUserName() will not work. Use that.
Jason Burke writes:
... What's the best way to query the logged in user's name in a python script (not external script and not with DTML)?
The API docs mention something about an AuthenticatedUser class, but I can't find the object anywhere in my ./Zope/lib/python directory, and it doesn't appear to be a class in any of the zope modules that I searched through.
I did notice a reference to something like this...
REQUEST.AUTHENTICATED_USER.getUserName()
but, this doesn't seem like it would be any more secure than just assigning REQUEST.AUTHENTICATED_USER to a variable. "getSecurityUser()" gives you the user object. "getUserName()" gives you its name.
Dieter
participants (3)
-
Dieter Maurer -
Jason Burke -
Peter Bengtsson