[Zope] newbie question about creat User by DTML
Rik Hoekstra
rik.hoekstra@inghist.nl
Tue, 09 May 2000 15:37:12 +0200
aztec Tsai wrote:
>
> > > Hello
> > > I got problem of trying add a user by DTML in a Folder that builded
> with
> > > DTML call "manage_addFolder()". Is tere any doc about this ??(I didn't
> saw
> > > it on How-to's of zope site)?
> >
> > You can't add users to normal Folders, only to UserFolders. For
> > documentation see the Guides on the Zope site and the Zope quick
> > references (ZQR) at the zdp site (http://zdp.zope.org)
> >
>
> thanks your answer first...
>
> What I need is create a Folder (called "newguy_dir") , then add a user
> ("newguy") on that folder by dtml+zope-build-in-method/object..... .So I use
> manage_addFolder(newguy_dir,title,1,1) to creater newguy_dir Folder with
> index_html / UserFolder object in it.......then I try to add user on
> "newguy_dir" .
> So I got problme on add user on "newguy_dir" , what method/object
> should I use ? manage_user() ??(I got problme of calling it..) , or the
> construction of mine are wrong ??
>
Hm, I believe I wasn't quite clear. You can't use these methods in the
folder for this. You need to add a so-called UserFolder. Add it by using
the following dtml-command:
manage_addUserFolder()
then by
<dtml-call "REQUEST.set('name', '<newname>')">
<dtml-call "REQUEST.set('password', '<pwrd>')">
<dtml-call "REQUEST.set('confirm', '<pwrd>')">
<dtml-call "REQUEST.set('roles', ['<desiredRole>', ...])">
<dtml-call "REQUEST.set('domains', ['<desiredDomain>', ...])">
<dtml-call "REQUEST.set('submit', 'Add')">
<dtml-call "acl_users.manage_users(submit='Add', REQUEST=REQUEST )">
you add a user.
Rik