[CMF-checkins] CVS: Products/CMFDefault/skins/zpt_control - members_add_control.py:1.1 members_delete_control.py:1.1 members_add.py:NONE members_delete.py:NONE

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Jul 6 17:41:22 EDT 2004


Update of /cvs-repository/Products/CMFDefault/skins/zpt_control
In directory cvs.zope.org:/tmp/cvs-serv10040/CMFDefault/skins/zpt_control

Added Files:
	members_add_control.py members_delete_control.py 
Removed Files:
	members_add.py members_delete.py 
Log Message:
- renamed members_manage_form.pt and join_form.pt to *_template.pt
- renamed *_control.py to members_manage_form.py and join_form.py: these scripts are now called directly
- renamed members controllers to members_*_control.py
- modified kw handling a bit to work with the new calling order


=== Added File Products/CMFDefault/skins/zpt_control/members_add_control.py ===
##parameters=member_id, password, member_email, send_password=False, **kw
##title=Add a member
##
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.permissions import ManageUsers

mtool = getToolByName(script, 'portal_membership')
ptool = getToolByName(script, 'portal_properties')
rtool = getToolByName(script, 'portal_registration')

try:
    rtool.addMember( id=member_id, password=password,
                     properties={'username': member_id,
                                 'email': member_email} )
except ValueError, errmsg:
    return context.setStatus(False, errmsg)
else:
    if ptool.getProperty('validate_email') or send_password:
        rtool.registeredNotify(member_id)
    if mtool.checkPermission(ManageUsers, mtool):
        return context.setStatus(True, 'Member registered.')
    else:
        return context.setStatus(False, 'Success!')


=== Added File Products/CMFDefault/skins/zpt_control/members_delete_control.py ===
##parameters=ids, **kw
##title=Delete members
##
from Products.CMFCore.utils import getToolByName

mtool = getToolByName(script, 'portal_membership')

mtool.deleteMembers(ids)

return context.setStatus( True, 'Selected member%s deleted.' %
                                ( len(ids) != 1 and 's' or '' ) )

=== Removed File Products/CMFDefault/skins/zpt_control/members_add.py ===

=== Removed File Products/CMFDefault/skins/zpt_control/members_delete.py ===



More information about the CMF-checkins mailing list