Changeset 8756 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 19 Jun 2012, 06:48:17 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/authentication.py
r8344 r8756 22 22 from zope.component import getUtility, getUtilitiesFor 23 23 from zope.interface import Interface 24 from zope.schema import getFields 24 25 from zope.securitypolicy.interfaces import ( 25 26 IPrincipalRoleMap, IPrincipalRoleManager) … … 34 35 from waeup.kofa.interfaces import (ILocalRoleSetEvent, 35 36 IUserAccount, IAuthPluginUtility, IPasswordValidator, 36 IKofaPrincipal, IKofaPrincipalInfo )37 IKofaPrincipal, IKofaPrincipalInfo, IKofaPluggable) 37 38 38 39 def setup_authentication(pau): … … 150 151 151 152 def __init__(self, name, password, title=None, description=None, 152 email=None, phone=None, roles = []):153 email=None, phone=None, public_name=None, roles = []): 153 154 self.name = name 154 155 if title is None: … … 158 159 self.email = email 159 160 self.phone = phone 161 self.public_name = public_name 160 162 self.setPassword(password) 161 163 self.setSiteRolesForPrincipal(roles) … … 356 358 obj, local_role, user_name, granted=False)) 357 359 return 360 361 class UsersPlugin(grok.GlobalUtility): 362 """A plugin that updates users. 363 """ 364 365 grok.implements(IKofaPluggable) 366 grok.name('users') 367 368 deprecated_attributes = [] 369 370 def setup(self, site, name, logger): 371 return 372 373 def update(self, site, name, logger): 374 users = site['users'] 375 items = getFields(IUserAccount).items() 376 for user in users.values(): 377 # Add new attributes 378 for i in items: 379 if not hasattr(user,i[0]): 380 setattr(user,i[0],i[1].missing_value) 381 logger.info( 382 'UsersPlugin: %s attribute %s added.' % ( 383 user.name,i[0])) 384 # Remove deprecated attributes 385 for i in self.deprecated_attributes: 386 try: 387 delattr(user,i) 388 logger.info( 389 'UsersPlugin: %s attribute %s deleted.' % ( 390 user.name,i)) 391 except AttributeError: 392 pass 393 return -
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r8685 r8756 423 423 required = False,) 424 424 425 public_name = schema.TextLine( 426 title = _(u'Public Name'), 427 description = u'This name appears on student pages.', 428 required = False,) 429 425 430 description = schema.Text( 426 431 title = _(u'Description/Notice'), -
main/waeup.kofa/trunk/src/waeup/kofa/students/authentication.py
r8350 r8756 40 40 grok.implements(IUserAccount) 41 41 42 public_name = None 43 42 44 @property 43 45 def name(self):
Note: See TracChangeset for help on using the changeset viewer.