RE: [Zope] adding users
I did this by customizing the join_form and register dtml methods in portal_skins, but that would be applicable only if you are using CMF. Otherwise, look at your acl_users folder, and the code that it is using when the Add button is clicked. If you want to do this without an html form, then look at the python source to see the method you need to call, in this case "manage_users". I find this method in User.py --> def manage_users(self,submit=None,REQUEST=None,RESPONSE=None) I believe that you can use something like <dtml-call expr="acl_users.manage_users(...)"> The params for the method can be found in the form fields in the Add User form. Josh -----Original Message----- From: Eckhoff, Damon [mailto:damon@missouri.edu] Sent: Thursday, January 31, 2002 8:59 AM To: zope@zope.org Subject: [Zope] adding users Hi all: Could someone point me to some good documentation on creating/editing/managing users programmatically? I've been searching... but I must be searching for the wrong thing... Thanks, Damon. _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Thu, Jan 31, 2002 at 10:20:25AM -0800, Joshua Lanza wrote:
I believe that you can use something like
<dtml-call expr="acl_users.manage_users(...)">
The params for the method can be found in the form fields in the Add User form.
That's probably what I used, or else I copied someone else's code that did similarly. Here's sample code from one of my sites: adduser ======= (excerpts) <form action="do_adduser" method=post> <input type=text name=userlogin> <input type=password name=userpass> <input type=password name=passconfirmation> do_adduser ========== <dtml-call "REQUEST.set('name', userlogin)"> <dtml-call "REQUEST.set('password', userpass)"> <dtml-call "REQUEST.set('confirm', passconfirmation)"> <dtml-call "REQUEST.set('roles', ['Member'])"> <dtml-call "acl_users.manage_users('Add',REQUEST,RESPONSE)"> the form that called the dtml method containing this code had input fields for 'userlogin', 'userpass', and 'passconfirmation'. You could of course just change those fields to be 'name', 'password', and 'confirm' and cut out my first three lines. Line 4 sets a list of roles that the new account should have. Line 5 actually creates the user. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
participants (2)
-
Joshua Lanza -
Mike Renfro