def get_source_user_info(self, user_id): # first, try to use the cache cached_record = ldap_cache.get(self._user_dn_from_id(user_id), None) if cached_record is not None: log.debug("loading user from cache: %r", user_id) return user_info_from_ldap_cache(user_id, cached_record, self) # not in cache, ask LDAPUserFolder zope_user = self._get_zope_user(user_id) if zope_user is None: raise LDAPUserNotFound(user_id) return user_info_from_zope_user(self, zope_user, self.default_encoding)