[Zope] Adding users

Randall Kern randy@teamkern.net
Wed, 6 Dec 2000 21:43:00 -0800


This is a multi-part message in MIME format.

------=_NextPart_000_043E_01C05FCD.815E01D0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Something like this should work:

<dtml-with acl_users>
    <dtml-call expr=3D"manage_users(submit =3D 'Add')">
</dtml-with>

It will look in the REQUEST for the following fields:
    name
    password
    confirm (this must match password)
    roles
    domains

So either set these from an HTML form, or use <dtml-call =
expr=3D"REQUEST.set('name', 'Joe')">.  For examples of the form =
technique, look at zope/lib/python/AccessControl/addUser.dtml

-Randy
  ----- Original Message -----=20
  From: Mike Kelland=20
  To: zope@zope.org=20
  Sent: Wednesday, December 06, 2000 8:47 PM
  Subject: [Zope] Adding users


  Is it possible to have a form in a zope page that allows you to add a =
new user to the acl_users folder?  I can get the data I need, I just =
need to know, if I have the user name and password as dtml variables, =
and the user adding the other user has all the appropriate permissions, =
is there a way in dtml to use this information to add a user (with a =
defined role).
  =20
  Thanks very much for this and prior help!
  =20
  Mike Kelland
  mike@studiomatic.com=20

------=_NextPart_000_043E_01C05FCD.815E01D0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Something like this should =
work:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-with =
acl_users&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &lt;dtml-call=20
expr=3D"manage_users(submit =3D 'Add')"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;/dtml-with&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>It will look in the REQUEST for the =
following=20
fields:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; name</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
password</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; confirm (this must =
match=20
password)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; roles</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; domains</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>So either set these from an HTML form, =
or use=20
&lt;dtml-call expr=3D"REQUEST.set('name', 'Joe')"&gt;.&nbsp; For =
examples of the=20
form technique, look at =
zope/lib/python/AccessControl/addUser.dtml</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-Randy</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A href=3D"mailto:mike@studiomatic.com" =
title=3Dmike@studiomatic.com>Mike=20
  Kelland</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
href=3D"mailto:zope@zope.org"=20
  title=3Dzope@zope.org>zope@zope.org</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Wednesday, December 06, =
2000 8:47=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Zope] Adding =
users</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Is it possible to have a form in a =
zope page that=20
  allows you to add a new user to the acl_users folder?&nbsp; I can get =
the data=20
  I need, I just need to know, if I have the user name and password as =
dtml=20
  variables, and the user adding the other user has all the appropriate=20
  permissions, is there a way in dtml to use this information to add a =
user=20
  (with a defined role).</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Thanks very much for this and prior=20
  help!</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Mike Kelland</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><A=20
  href=3D"mailto:mike@studiomatic.com">mike@studiomatic.com</A>=20
</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_043E_01C05FCD.815E01D0--