Hi Andrew!<br><br>This is my form code:<br><br><html><br> <head><br> <title tal:content="template/title">The title</title><br> </head><br> <body><br> <form method="post" tal:attributes="action here/Logon/absolute_url">
<br> Usuario: <input type="text" name="__ac_name" /><br> Contraseņa: <input type="password" name="__ac_password" /><br> <button type="submit">Logar</button>
<br> </form><br> </body><br></html><br><br>And this is the Logon code:<br><br>from AccessControl import getSecurityManager<br><br>usuario = context.acl_users.validate(context.REQUEST)<br><br>print str(usuario)
<br>print getSecurityManager().getUser().getUserName()<br><br>return printed<br><br>Did I understand you? (this code doesn't work ok)<br><br>Where is the mistake?<br><br>Thank you so much!!!!<br><br><div><span class="gmail_quote">
2007/7/7, Andrew Milton <<a href="mailto:akm@theinternet.com.au">akm@theinternet.com.au</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
+-------[ Garito ]----------------------<br>| I try context.acl_users.authenticate(user, pass, request) but this doesn't<br>| change the session user, isn't it?<br>|<br>| Can I change the logged user in the session in any way?
<br><br>I'm not sure what you mean by "in the session".<br><br>If you want to change the cookies <a href="http://et.al">et.al</a> as you go, you call<br>acl_users.remember(username, password, request) after the call to authenticate
<br>IF you get a user object back (i.e. authenticate was successful)<br><br>Either that or you can stuff the request with __ac_name and __ac_password and<br>call acl_users.validate(request), however this is not the preferred method to
<br>use for changing the logged in user on the fly.<br><br>--<br>Andrew Milton<br><a href="mailto:akm@theinternet.com.au">akm@theinternet.com.au</a><br></blockquote></div><br><br clear="all"><br>-- <br>Mis Cosas<br><a href="http://blogs.sistes.net/Garito">
http://blogs.sistes.net/Garito</a>