[Zope-CMF] login programmatically

Paul Erickson erickson@kaivo.com
Thu, 26 Apr 2001 10:21:39 -0600


I haven't done this recently, so no guarantees, but at one point I had
done this with the following python code.:


from base64 import encodestring 
.
.
.

         token='%s:%s' % (username, password)
         token=encodestring(token)
         token=quote(token)
         RESPONSE.setCookie('__ac', token, path='/')
         REQUEST['__ac']=token

         RESPONSE.redirect('Put the registration confirmation url
here...') 

Good Luck

-paul



seb bacon wrote:
> 
> I need to log the user in as part of the the registration process,
> rather than have them click a link at the end.  I can't for the life
> of me work out how to do this.  Do I have to raise an Unauthorised
> error in order to trigger the login mechanism?  Can anyone help?
> 
> cheers,
> 
> seb
> 
> --
> 
>    [] j a m k i t
> 
>         seb bacon
> T:  020 7749 7218
> F:  020 7739 8683
> M:  07968 301 336
> W: www.jamkit.com
> 
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
> 
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature requests

-- 
Paul Erickson       | erickson@kaivo.com
Kaivo, Inc.         | www.kaivo.com