[Zope] - scripting acl_users
Brian Hooper
brian@garage.co.jp
Tue, 26 Jan 1999 20:46:37 +0900
Hi again -
I am trying to script acl_users to add Zope users according to form input,
but am having a little trouble getting the DTML scripting right. Can
anyone give me some advice on the following?
I have no trouble making new users with the following:
(I am generating sequential logins and storing it in a property of the folder,
that's what last_new_login is; password_verify is just there since I name that
field differently on my form than the Zope edit users page...)
<!--#call "REQUEST.set('name', last_new_login)"-->
<!--#call "REQUEST.set('confirm', REQUEST['password_verify'])"-->
<!--#call "REQUEST.set('roles', ['SiteMember'])"-->
This adds the new user to the parent folder's (in my case, the Zope root) acl_users
<!--#call "PARENTS[1].acl_users.manage_users(submit='Add', REQUEST=REQUEST)"-->
However, when I try to use a similar method to change user data:
<!--#call "REQUEST.set('name', last_new_login)"-->
<!--#call "REQUEST.set('confirm', REQUEST['password_verify'])"-->
<!--#call "REQUEST.set('roles', ['SiteMember'])"-->
<!--#call "PARENTS[1].acl_users.manage_users(submit='Change', REQUEST=REQUEST)"-->
...I get an AttributeError in BoboPOS, as if that user doesn't exist.
Is there a better way to do this (probably!) ? Can anyone give me an example of
the right way to script acl_users changes?
Thanks!
--Brian Hooper