[CMF-checkins] CVS: CMF/CMFDefault - MembershipTool.py:1.24
Florent Guillaume
fg@nuxeo.com
Sat, 29 Jun 2002 11:56:20 -0400
Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv30781/CMFDefault
Modified Files:
MembershipTool.py
Log Message:
Changed CMFDefault.MembershipTool to not create a member folder at
member creation time when the memberareaCreationFlag is false
(Tracker #519).
Note that any code that depended on the member folder being created
after addMember will fail, that code should call createMemberarea
directly if needed.
=== CMF/CMFDefault/MembershipTool.py 1.23 => 1.24 ===
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""CMFDefault portal_membership tool.
@@ -35,7 +35,7 @@
default_member_content = '''Default page for %s
- This is the default document created for you when
+ This is the default document created for you when
you joined this community.
To change the content just select "Edit"
@@ -54,7 +54,7 @@
, category='user'
, condition=Expression(text='not: member')
, visible=1
- )
+ )
, ActionInformation(id='preferences'
, title='Preferences'
, description='Change your user preferences'
@@ -139,21 +139,6 @@
'listed':member.listed})
return roster
- def addMember(self, id, password, roles, domains, properties=None):
- '''Adds a new member to the user folder. Security checks will have
- already been performed. Called by portal_registration.
- '''
- Products.CMFCore.MembershipTool.MembershipTool.addMember( self
- , id
- , password
- , roles
- , domains
- , properties
- )
-
- self.createMemberarea(id)
-
-
security.declareProtected(ManagePortal, 'createMemberarea')
def createMemberarea(self, member_id):
"""
@@ -166,13 +151,13 @@
f_title = "%s's Home" % member_id
members.manage_addPortalFolder( id=member_id, title=f_title )
f=getattr(members, member_id)
-
+
# Grant ownership to Member
acl_users = self.__getPUS()
user = acl_users.getUser(member_id).__of__(acl_users)
f.changeOwnership(user)
f.manage_setLocalRoles(member_id, ['Owner'])
-
+
# Create Member's home page.
# default_member_content ought to be configurable per
# instance of MembershipTool.
@@ -183,14 +168,13 @@
, "structured-text"
, (default_member_content % member_id)
)
-
+
f.index_html._setPortalTypeName( 'Document' )
# Overcome an apparent catalog bug.
f.index_html.reindexObject()
wftool = getToolByName( f, 'portal_workflow' )
wftool.notifyCreated( f.index_html )
-
def getHomeFolder(self, id=None, verifyPermission=0):
"""Returns a member's home folder object."""
@@ -208,7 +192,7 @@
return folder
except KeyError: pass
return None
-
+
def getHomeUrl(self, id=None, verifyPermission=0):
"""Returns the URL to a member's home folder."""
home = self.getHomeFolder(id, verifyPermission)