Ignore:
Timestamp:
21 Sep 2012, 08:19:35 (12 years ago)
Author:
uli
Message:

Rollback r9209. Looks like multiple merges from trunk confuse svn when merging back into trunk.

Location:
main/waeup.kofa/branches/uli-zc-async
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-zc-async

  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/authentication.py

    r9209 r9211  
    2121from zope.event import notify
    2222from zope.component import getUtility, getUtilitiesFor
    23 from zope.component.interfaces import IFactory
    2423from zope.interface import Interface
    2524from zope.schema import getFields
     
    3635from waeup.kofa.interfaces import (ILocalRoleSetEvent,
    3736    IUserAccount, IAuthPluginUtility, IPasswordValidator,
    38     IKofaPrincipal, IKofaPrincipalInfo, IKofaPluggable,
    39     IBatchProcessor)
    40 from waeup.kofa.utils.batching import BatchProcessor
     37    IKofaPrincipal, IKofaPrincipalInfo, IKofaPluggable)
    4138
    4239def setup_authentication(pau):
     
    366363                obj, local_role, user_name, granted=False))
    367364    return
    368 
    369 class UserAccountFactory(grok.GlobalUtility):
    370     """A factory for user accounts.
    371 
    372     This factory is only needed for imports.
    373     """
    374     grok.implements(IFactory)
    375     grok.name(u'waeup.UserAccount')
    376     title = u"Create a user.",
    377     description = u"This factory instantiates new user account instances."
    378 
    379     def __call__(self, *args, **kw):
    380         return Account(name=None, password='')
    381 
    382     def getInterfaces(self):
    383         return implementedBy(Account)
    384 
    385 class UserProcessor(BatchProcessor):
    386     """A batch processor for IUserAccount objects.
    387     """
    388     grok.implements(IBatchProcessor)
    389     grok.provides(IBatchProcessor)
    390     grok.context(Interface)
    391     util_name = 'userprocessor'
    392     grok.name(util_name)
    393 
    394     name = u'User Processor'
    395     iface = IUserAccount
    396 
    397     location_fields = ['name',]
    398     factory_name = 'waeup.UserAccount'
    399 
    400     mode = None
    401 
    402     def parentsExist(self, row, site):
    403         return 'users' in site.keys()
    404 
    405     def entryExists(self, row, site):
    406         return row['name'] in site['users'].keys()
    407 
    408     def getParent(self, row, site):
    409         return site['users']
    410 
    411     def getEntry(self, row, site):
    412         if not self.entryExists(row, site):
    413             return None
    414         parent = self.getParent(row, site)
    415         return parent.get(row['name'])
    416 
    417     def addEntry(self, obj, row, site):
    418         parent = self.getParent(row, site)
    419         parent.addAccount(obj)
    420         return
    421 
    422365
    423366class UsersPlugin(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.