source: main/waeup.plonetheme/trunk/waeup/plonetheme/adapter.py @ 11587

Last change on this file since 11587 was 5873, checked in by Henrik Bettermann, 14 years ago

Add company to user data and show on members page.

  • Property svn:keywords set to Id
File size: 916 bytes
RevLine 
[5870]1from plone.app.users.browser.personalpreferences import UserDataPanelAdapter
[5871]2from Products.CMFCore.utils import getToolByName
[5870]3
4class EnhancedUserDataPanelAdapter(UserDataPanelAdapter):
5    """
6    """
[5871]7   
[5870]8    def get_position(self):
9        return self.context.getProperty('position', '')
10    def set_position(self, value):
[5871]11        membership = getToolByName(self.context, 'portal_membership')
12        if not membership.checkPermission('Manage portal', self.context):
13            return
[5870]14        return self.context.setMemberProperties({'position': value})
15    position = property(get_position, set_position)
16
[5873]17    def get_company(self):
18        return self.context.getProperty('company', '')
19    def set_company(self, value):
20        membership = getToolByName(self.context, 'portal_membership')
21        return self.context.setMemberProperties({'company': value})
22    company = property(get_company, set_company)
[5870]23
24
25
Note: See TracBrowser for help on using the repository browser.