X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/efae6157ec06dbc7b7502e14f764473a234e1a3f..787a108deee8d7b54ce081d4f679c7c7aa25a9a3:/MembershipTool.py?ds=sidebyside diff --git a/MembershipTool.py b/MembershipTool.py index f68a769..0d7624e 100755 --- a/MembershipTool.py +++ b/MembershipTool.py @@ -19,8 +19,8 @@ ####################################################################################### """ Plinn portal_membership -$Id: MembershipTool.py 1547 2010-01-05 16:24:22Z pin $ -$URL: http://svn.cri.ensmp.fr/svn/Plinn/branches/CMF-2.1/MembershipTool.py $ + + """ from AccessControl import ClassSecurityInfo, getSecurityManager @@ -77,26 +77,26 @@ class MembershipTool( BaseTool ): memberareaPortalType = 'Folder' - security.declareProtected(SetOwnPassword, 'setPassword') - def setPassword(self, password, domains=None): - '''Allows the authenticated member to set his/her own password. - ''' - user_folder = self.__getPUS() - if user_folder.meta_type == 'Group User Folder' : - registration = getToolByName(self, 'portal_registration', None) - if not self.isAnonymousUser(): - member = self.getAuthenticatedMember() - if registration: - failMessage = registration.testPasswordValidity(password) - if failMessage is not None: - raise 'Bad Request', failMessage - member.setSecurityProfile(password=password, domains=domains) - member.changePassword(password) - else: - raise 'Bad Request', 'Not logged in.' - - else : - BaseTool.setPassword(self, password, domains=None) +# security.declareProtected(SetOwnPassword, 'setPassword') +# def setPassword(self, password, domains=None): +# '''Allows the authenticated member to set his/her own password. +# ''' +# user_folder = self.__getPUS() +# if user_folder.meta_type == 'Group User Folder' : +# registration = getToolByName(self, 'portal_registration', None) +# if not self.isAnonymousUser(): +# member = self.getAuthenticatedMember() +# if registration: +# failMessage = registration.testPasswordValidity(password) +# if failMessage is not None: +# raise 'Bad Request', failMessage +# member.setSecurityProfile(password=password, domains=domains) +# member.changePassword(password) +# else: +# raise 'Bad Request', 'Not logged in.' +# +# else : +# BaseTool.setPassword(self, password, domains=None) @@ -243,7 +243,7 @@ class MembershipTool( BaseTool ): return userid memberName = getattr(member, 'name', '') memberGivenName = getattr(member, 'given_name', '') - memberId = member.id + memberId = member.getId() memberFullName = formatFullName(memberName, memberGivenName, memberId, nameBefore = nameBefore) return memberFullName