Last change
on this file since 17397 was
953,
checked in by Henrik Bettermann, 18 years ago
|
member directory acl permission, schema and layouts changed
not yet optimized
|
File size:
1.2 KB
|
Rev | Line | |
---|
[953] | 1 | ##parameters=dirname=None, id=None, ids=[], REQUEST=None |
---|
| 2 | # $Id: member_delete.py 21607 2005-05-17 08:36:35Z atchertchian $ |
---|
| 3 | """ |
---|
| 4 | This script can be both called with request parameters or with form parameters |
---|
| 5 | """ |
---|
| 6 | |
---|
| 7 | from zLOG import LOG, DEBUG |
---|
| 8 | logKey = 'member_delete' |
---|
| 9 | |
---|
| 10 | if REQUEST is not None: |
---|
| 11 | psm = 'psm_entry_deleted' |
---|
| 12 | if REQUEST.form.has_key('dirname'): |
---|
| 13 | dirname = REQUEST.form.get('dirname') |
---|
| 14 | #LOG(logKey, DEBUG, "dirname = %s" % dirname) |
---|
| 15 | |
---|
| 16 | if REQUEST.form.get('ids'): |
---|
| 17 | ids = REQUEST.form.get('ids') |
---|
| 18 | #LOG(logKey, DEBUG, "ids = %s" % str(ids)) |
---|
| 19 | |
---|
| 20 | dir = context.portal_directories[dirname] |
---|
| 21 | |
---|
| 22 | if id: |
---|
| 23 | try: |
---|
| 24 | dir.deleteEntry(id) |
---|
| 25 | except ValueError, e: |
---|
| 26 | msg = str(e) |
---|
| 27 | if REQUEST is not None and \ |
---|
| 28 | msg.find("Operation not allowed on non-leaf") > 0: |
---|
| 29 | psm = 'psm_entry_delete_not_allowed_on_non_leaf' |
---|
| 30 | else: |
---|
| 31 | raise |
---|
| 32 | |
---|
| 33 | if ids: |
---|
| 34 | for id in ids: |
---|
| 35 | dir.deleteEntry(id) |
---|
| 36 | |
---|
| 37 | if REQUEST is not None: |
---|
| 38 | portal_url = context.portal_url() |
---|
| 39 | REQUEST.RESPONSE.redirect('%s/search_members_form?dirname=%s' |
---|
| 40 | '&portal_status_message=%s' % |
---|
| 41 | (portal_url, dirname, psm)) |
---|
Note: See
TracBrowser for help on using the repository browser.