[Zope] Help needed for acl_users script

CY CY" <cyhoong@pc.jaring.my
Wed, 19 Mar 2003 00:13:11 +0800


This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C2EDAC.53992B20
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello there!

I have a Zope251 installation and learning to do some development.  I =
want to write a simple form for managing users (add, edit & delete).  =
There is error return code.

A sample of the code is sample but it does not seem to work.  I have =
search FAQ for some clues but found none.

Can anyone give me a pointer here?

Thk in advance.


DTML Doc: AddUserForm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
dtml-var standard_html_header>
<h2><dtml-var title_or_id></h2>
<form action=3D"AddUserAction" method=3D"post">
<table>
  <tr>
    <td>Enter your name: </td>
    <td><input type=3Dtext name=3Dusername value=3D"your name"></td>
  </tr>
  <tr>
    <td>Enter your password: </td>
    <td><input type=3Dpassword name=3Dpassword_1 ></td>
  </tr>
  <tr>
    <td>Confirm your name: </td>
    <td><input type=3Dpassword name=3Dpassword_2></td>
  </tr>
  <tr>
    <td>Enter your role: </td>
    <td><input type=3Dtext name=3Drole_1></td>
  </tr>
  <tr>
    <td>Enter your domain: </td>
    <td><input type=3Dtext name=3Ddomain_1></td>
  </tr>
  <tr><td>&nbsp;</td></tr>
  <tr>
    <td>&nbsp;<br></td>
    <td><input type=3Dsubmit name=3Dsubmit value=3D"Add User"></td>
  </tr>

<dtml-var standard_html_footer>

DTML Method
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
<dtml-if expr=3D"password_1 =3D=3D password_2">

  <dtml-call "REQUEST.set('name','<dtml-var username>')">
  <dtml-call "REQUEST.set('password','<dtml-var password_1>')">
  <dtml-call "REQUEST.set('confirm','<password_1>')">
  <dtml-call "REQUEST.set('roles','<dmtl-var role_1>')">
  <dtml-call "REQUEST.set('domains','<dtml-var domain_1>')">
  <dtml-call "REQUEST.set('submit','Add')">

  <dtml-call "acl_users.manage_users(submit=3D'Add', =
REQUEST=3DREQUEST)">

<dtml-else>

 <h2> Please re-enter again - your password is not confirm </h2>

</dtml-if>

<dtml-var AddUserForm>

------=_NextPart_000_0006_01C2EDAC.53992B20
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 http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello there!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have a Zope251 installation =
and&nbsp;learning to=20
do some development.&nbsp; I want to write a simple form for managing =
users=20
(add, edit &amp; delete).&nbsp; There is error return code.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A sample of the code is sample but it =
does not seem=20
to work.&nbsp; I have search FAQ for some clues but found =
none.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Can anyone give me a pointer =
here?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thk in advance.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>DTML Doc: AddUserForm</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FO=
NT></DIV>
<DIV><FONT face=3DArial size=3D2>dtml-var=20
standard_html_header&gt;<BR>&lt;h2&gt;&lt;dtml-var=20
title_or_id&gt;&lt;/h2&gt;<BR>&lt;form action=3D"AddUserAction"=20
method=3D"post"&gt;<BR>&lt;table&gt;<BR>&nbsp; =
&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;td&gt;Enter your name: &lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; =
&lt;td&gt;&lt;input=20
type=3Dtext name=3Dusername value=3D"your name"&gt;&lt;/td&gt;<BR>&nbsp; =

&lt;/tr&gt;<BR>&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td&gt;Enter =
your=20
password: &lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;input =
type=3Dpassword=20
name=3Dpassword_1 &gt;&lt;/td&gt;<BR>&nbsp; &lt;/tr&gt;<BR>&nbsp;=20
&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td&gt;Confirm your name:=20
&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;input type=3Dpassword=20
name=3Dpassword_2&gt;&lt;/td&gt;<BR>&nbsp; &lt;/tr&gt;<BR>&nbsp;=20
&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td&gt;Enter your role:=20
&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;input type=3Dtext=20
name=3Drole_1&gt;&lt;/td&gt;<BR>&nbsp; &lt;/tr&gt;<BR>&nbsp;=20
&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td&gt;Enter your domain:=20
&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;input type=3Dtext=20
name=3Ddomain_1&gt;&lt;/td&gt;<BR>&nbsp; &lt;/tr&gt;<BR>&nbsp;=20
&lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;<BR>&nbsp;=20
&lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;td&gt;&amp;nbsp;&lt;br&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;td&gt;&lt;input type=3Dsubmit name=3Dsubmit value=3D"Add=20
User"&gt;&lt;/td&gt;<BR>&nbsp; &lt;/tr&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-var =
standard_html_footer&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>DTML Method</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-if expr=3D"password_1 =3D=3D=20
password_2"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-call=20
"REQUEST.set('name','&lt;dtml-var username&gt;')"&gt;<BR>&nbsp; =
&lt;dtml-call=20
"REQUEST.set('password','&lt;dtml-var password_1&gt;')"&gt;<BR>&nbsp;=20
&lt;dtml-call =
"REQUEST.set('confirm','&lt;password_1&gt;')"&gt;<BR>&nbsp;=20
&lt;dtml-call "REQUEST.set('roles','&lt;dmtl-var =
role_1&gt;')"&gt;<BR>&nbsp;=20
&lt;dtml-call "REQUEST.set('domains','&lt;dtml-var =
domain_1&gt;')"&gt;<BR>&nbsp;=20
&lt;dtml-call "REQUEST.set('submit','Add')"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &lt;dtml-call=20
"acl_users.manage_users(submit=3D'Add', =
REQUEST=3DREQUEST)"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-else&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&lt;h2&gt; Please re-enter again =
- your=20
password is not confirm &lt;/h2&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;/dtml-if&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-var=20
AddUserForm&gt;</FONT></DIV></BODY></HTML>

------=_NextPart_000_0006_01C2EDAC.53992B20--