Logo Search packages:      
Sourcecode: zope-ldapuserfolder version File versions

def LDAPUserFolder::LDAPUserFolder::LDAPUserFolder::getUserDetails (   self,
  encoded_dn,
  format = None,
  attrs = [] 
)

Return all attributes for a given DN 

Definition at line 630 of file LDAPUserFolder.py.

00630                                                                :
        """ Return all attributes for a given DN """
        dn = urllib.unquote(encoded_dn)

        res = self._delegate.search( base=dn
                                   , scope=self.users_scope
                                   , attrs=attrs
                                   )

        if res['exception']:
            if format == None:
                result = ((res['exception'], res),)
            elif format == 'dictionary':
                result = { 'cn': '###Error: %s' % res['exception'] }
        elif res['size'] > 0:
            value_dict = res['results'][0]

            if format == None:
                result = value_dict.items()
                result.sort()
            elif format == 'dictionary':
                result = value_dict
        else:
            if format == None:
                result = ()
            elif format == 'dictionary':
                result = {}

        return result


    security.declareProtected(manage_users, 'getGroupDetails')
    def getGroupDetails(self, encoded_cn):


Generated by  Doxygen 1.6.0   Back to index