[Zope] user self registration using acl_users.manage_users

Chris Jenson CJenson@criadvantage.com
Fri, 15 Sep 2000 15:22:17 -0600


I am using the following code (adding to acl_users folder with the
manage_users page) to do user self registration after some initial
authentication using Zope authentication and a common login/passwd.  It
works fine if things are as they should be, but when things go south,
password and confirm not equal, login already exists, etc., it isn't so
great.  Looks like everything is fine, but the user isn't actually added.
How can I capture the possible errors and return to the user?  

Help would be much appreciated.  I am new to Zope and still trying to get my
head around it.

*********************************************
DTML Document-vendorRegistration
<dtml-var standard_html_header>
<h2><dtml-var title></h2>
<p>Register for Vendor Manual distribution</p>
<form action="registerAction" method="post"
enctype="multipart/form-data">
<table>
<tr>
  <td>
     Login(e-mail address): 
  </td>
  <td>
     <input type="text" name="login">
  </td>
</tr>

... capture other stuff, like password, confirm, etc.

<dtml-in expr="vendorManuals.objectValues()">
  <tr> 
    <td>
      <dtml-var title_or_id>
    </td>
    <td>
      <input type="checkbox" name="<dtml-var title_or_id>"
    </td>
  </tr>
</dtml-in>
</table>
<input type="submit" value=" Register " >
</form>
<dtml-var standard_html_footer> 
*************************************************************

DTML Method-registerAction
<dtml-var standard_html_header>
<h2><dtml-var title></h2>

<dtml-call "REQUEST.set('name', login)">
<dtml-call "REQUEST.set('password', password)">
<dtml-call "REQUEST.set('confirm', confirm)">
<dtml-call "REQUEST.set('roles', ['cwcVendor'])">
<dtml-call "REQUEST.set('submit', 'Add')">
<dtml-call "acl_users.manage_users(submit='Add', REQUEST=REQUEST )">
*******************************************************