[Zope] Self-Registration Script.

Kevin Dangoor kid@kendermedia.com
Fri, 20 Aug 1999 17:54:16 -0400


-----Original Message-----
From: Mike Winter <mfw127@cs.usask.ca>
To: Kevin Dangoor <kid@kendermedia.com>
Cc: zope@zope.org <zope@zope.org>
Date: Friday, August 20, 1999 1:45 PM
Subject: Re: [Zope] Self-Registration Script.


>On Thu, 19 Aug 1999, Kevin Dangoor wrote:
>
>> The new Zope beta site does this :)
>>
>> Probably the thing you want to do is use "Proxy Roles". You can make a
DTML
>> method with a Proxy Role of "Manager", but have the method viewable by
>> anonymous... That DTML method will be able to do anything a Manager can
do.
>>
>> Kevin
>
>Thanks, Kevin, that is definitely the way to go.  Could anyone give me
>the syntax for the API call to add a user to the user folder?  Is it:
>
>"acl_users.addUser(user, password, domains, roles)"

From the source (User.py):

    def manage_users(self,submit=None,REQUEST=None,RESPONSE=None):
[deletia]
        if submit=='Add':
            name    =reqattr(REQUEST, 'name')
            password=reqattr(REQUEST, 'password')
            confirm =reqattr(REQUEST, 'confirm')
            roles   =reqattr(REQUEST, 'roles')
            domains =reqattr(REQUEST, 'domains')
            return
self._addUser(name,password,confirm,roles,domains,REQUEST)

Looks like you want to do something like pull name, password and confirm
from the form and then:
<dtml-call "REQUEST.set('roles', 'blah blah')">
<dtml-call "REQUEST.set('domains', 'blah blah')">
<dtml-call "acl_users.manage_users('Add', REQUEST, RESPONSE)">

Kevin