Adding users using your own forms
Submitted by: mirage
Last Edited: 2001-07-27
Category: Python(Script)
|
Average rating is:
3.2 out of 5
|
(5 ratings) |
|
Description:
If you want to add users to the acl_users default user folder, you can do so by using a form and a _very simple_ python script. In this trivial example, the form is propably more complex than the python script itself!
|
Source (Text):
<form action="add_user" method="post">
Name: <input type="text" name="name"><br>
Password: <input type="password" name="password" ><br>
Confirm password: <input type="password" name="confirm"><br>
User roles: <br>
<select name="roles:list" size="5" multiple>
<dtml-in valid_roles>
<dtml-if expr="_vars['sequence-item'] != 'Anonymous'">
<dtml-if expr="_vars['sequence-item'] != 'Shared'">
<option value="<dtml-var sequence-item html_quote>"><dtml-var
sequence-item>
</dtml-if>
</dtml-if>
</dtml-in valid_roles>
</select>
<br>
<input type="submit" name="submit" value="Add" />
</form>
context.acl_users.manage_users('Add', context.REQUEST)
return "User added!"
Domains: <input type="text" name="domains:tokens" size="30" value="" />
|
Comments:
thanks! by ruckc - 2001-07-25 |
I have been looking for this for a long while now. |
|
Looks Great, BUT it doesnt seem to work. by lanman - 2001-07-27 |
I keep getting:
Zope Error
Zope has encountered an error while publishing this resource.
Error Type: SyntaxError
Error Value: Line 2: "_vars" is an invalid variable name because it starts with "_"
--------------------------------------------------------------------------------
Troubleshooting Suggestions
The URL may be incorrect.
The parameters passed to this resource may be incorrect.
A resource that this resource relies on may be encountering an error.
For more detailed information about the error, please refer to the HTML source for this page.
If the error persists please contact the site maintainer. Thank you for your patience.
************************
So, whats wrong with this ? |
|
|