Hi Andrew!

This is my form code:

   <title tal:content="template/title">The title</title>
   <form method="post" tal:attributes="action here/Logon/absolute_url">
     Usuario: <input type="text" name="__ac_name" />
     ContraseƱa: <input type="password" name="__ac_password" />
     <button type="submit">Logar</button>

And this is the Logon code:

from AccessControl import getSecurityManager

usuario = context.acl_users.validate(context.REQUEST)

print str(usuario)
print getSecurityManager().getUser().getUserName()

return printed

Did I understand you? (this code doesn't work ok)

Where is the mistake?

Thank you so much!!!!

2007/7/7, Andrew Milton <[EMAIL PROTECTED]>:

+-------[ Garito ]----------------------
| I try context.acl_users.authenticate(user, pass, request) but this
| change the session user, isn't it?
| Can I change the logged user in the session in any way?

I'm not sure what you mean by "in the session".

If you want to change the cookies et.al as you go, you call
acl_users.remember(username, password, request) after the call to
IF you get a user object back (i.e. authenticate was successful)

Either that or you can stuff the request with __ac_name and __ac_password
call acl_users.validate(request), however this is not the preferred method
use for changing the logged in user on the fly.

Andrew Milton

Mis Cosas
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to