[Zope] acl_users.manage_users and RESPONSE.redirect

Tim Cook twcook@iswt.com
Wed, 20 Sep 2000 17:03:33 -0500


Chris Jenson wrote:
> 
> I am using the following code (adding to acl_users folder with manage_users)
> 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.  I would like to get ahold of
> the output of manage_users to display on a redirected RESPONSE back to the
> original vendorRegistration DTML Document.  How can I do this?

Might I suggest not letting yourself get into those situations?

Check the acl_users folder for a matching id (login) and test the
password for matches before you try to commit them. You'll throw
an exception and the user will be required to press the back
button and fix it.
 
*** UNTESTED ***
<dtml-in acl_users>
  <dtml-if login==sequence-item>
     <dtml-raise ID_Error>Login Already In Use.</dtml-raise>
  </dtml-if>
</dtml-in>

<dtml-unless "pat_password==pat_password2">
  <dtml-raise PasswordError>Passwords Do Not Match.</dtml-raise>
</dtml-unless>

...
> <dtml-var standard_html_header>
> <h2><dtml-var title></h2>
> 
> <dtml-call "REQUEST.set('name', login)">
> <dtml-call "REQUEST.set('password', password)">
...


HTH,
-- Tim Cook --
Cook Information Systems | Office: (901) 884-4126 8am-5pm CDT
* Specializing in Open Source Business Systems *
FreePM Project Coordinator http://www.freepm.org
OSHCA Founding Supporter http://www.oshca.org