[Zope] Record a new user with python script

Gilles Lenfant glenfant@bigfoot.com
Thu, 30 Aug 2001 14:12:48 +0200


Hi,

I got a "join" page where a new user creates its nick/password.
A python script controls this and records if successful in acl_users of the
current folder with "inscrit" local role.
But there seems to be a problem with the password... because I can't read
the page protected for the "inscrit" role using the newly created user.
It works again when changing the password in the ZMI.

Here's my code...

# start
form = context.REQUEST.form
context.REQUEST.set('name', form['newusername'])
context.REQUEST.set('password', form['newpassword'])
context.REQUEST.set('confirm', form['cnewpassword'])
context.REQUEST.set('roles', ['inscrit'])
context.acl_users.manage_users(submit='Add', REQUEST=context.REQUEST)
# go to page where only 'inscrit' and 'Manager/Owner' users have view
permission
return context.apres_id(context, context.REQUEST)

Any clue ? Thanks in advance !

--Gilles Lenfant