[Zope] Logon process

Andrew Milton akm at theinternet.com.au
Sat Jul 7 16:08:04 EDT 2007


+-------[ Garito ]----------------------
| Hi Andrew!
| 
| This is my form code:
| 
| <html>
|   <head>
|     <title tal:content="template/title">The title</title>
|   </head>
|   <body>
|     <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>
|     </form>
|   </body>
| </html>
| 
| 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?

First, check your Zope log.. there is quite a bit of debugging that XUF pumps
out, in case something went astray. It's at the DEBUG level, so you may have
to tweak your zope.conf settings to see it.

You should get something like;

exUserFolder identify returned <someuser>, <somepassword>

Secondly, I wouldn't call validate...

I would call .authenticate followed by .remember if you wish to change the
user.

-- 
Andrew Milton
akm at theinternet.com.au


More information about the Zope mailing list