Logo Search packages:      
Sourcecode: zope-pas version File versions  Download package

def PluggableAuthService-1.4::PluggableAuthService::PluggableAuthService::_verifyUser (   self,
  plugins,
  user_id = None,
  login = None 
) [private]

user_id -> info_dict or None

Definition at line 749 of file PluggableAuthService.py.

00749                                                               :

        """ user_id -> info_dict or None
        """
        criteria = {}

        if user_id is not None:
            criteria[ 'id' ] = user_id
            criteria[ 'exact_match' ] = True

        if login is not None:
            criteria[ 'login' ] = login

        if criteria:
            view_name = createViewName('_verifyUser', user_id or login)
            cached_info = self.ZCacheable_get( view_name=view_name
                                             , keywords=criteria
                                             , default=None
                                             )

            if cached_info is not None:
                return cached_info


            enumerators = plugins.listPlugins( IUserEnumerationPlugin )

            for enumerator_id, enumerator in enumerators:
                try:
                    info = enumerator.enumerateUsers( **criteria )

                    if info:
                        # Put the computed value into the cache
                        self.ZCacheable_set( info[0]
                                           , view_name=view_name
                                           , keywords=criteria
                                           )
                        return info[0]

                except _SWALLOWABLE_PLUGIN_EXCEPTIONS:
                    msg = 'UserEnumerationPlugin %s error' % enumerator_id
                    logger.debug(msg, exc_info=True)

        return None

    security.declarePrivate( '_authorizeUser' )
    def _authorizeUser( self


Generated by  Doxygen 1.6.0   Back to index