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

def LDAPUserFolder::LDAPUserSatellite::LDAPUserSatellite::getGroups (   self,
  dn = '*',
  attr = None 
)

return group records i know about 

Definition at line 291 of file LDAPUserSatellite.py.

00291                                           :
        """ return group records i know about """
        group_list = []

        if self.groups_base:
            no_show = ('Anonymous', 'Authenticated', 'Shared')
            group_filter = '(|(uniquemember=%s)(member=%s))' % (dn, dn)
            luf = self.getLUF()

            res = luf._delegate.search( self.groups_base
                                      , self.groups_scope
                                      , group_filter
                                      , attrs=['dn', 'cn']
                                      )

            if res['size'] > 0:
                resultset = res['results']
                for i in range(res['size']):
                    dn = resultset[i].get('dn')
                    try:
                        cn = resultset[i].get('cn')[0]
                    except KeyError:    # NDS oddity
                        cn = explode_dn(dn, 1)[0]

                    if attr is None:
                        group_list.append((cn, dn))
                    elif attr == 'cn':
                        group_list.append(cn)
                    elif attr == 'dn':
                        group_list.append(dn)

        return group_list

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


Generated by  Doxygen 1.6.0   Back to index