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

def CMFLDAP::LDAPMemberDataTool::LDAPMemberDataTool::getMemberDataContents (   self  ) 

Return the number of members stored in the _members
BTree and some other useful info

Definition at line 91 of file LDAPMemberDataTool.py.

00091                                    :
        """
        Return the number of members stored in the _members
        BTree and some other useful info
        """
        membertool = getToolByName(self, 'portal_membership')
        members = self._members
        temps = self._v_temps
        user_list = membertool.listMemberIds()
        member_list = members.keys()
        member_count = len(members)
        orphan_count = 0
        member_temp_count = 0
 
        if (len(user_list) == 1):
            # Possible LDAP Error?
            res_str = user_list[0].lower()
            if res_str.find('error') != -1:
                msg = 'No or too many results returned from LDAP'

                return [ { 'member_count' : member_count
                         , 'orphan_count' : msg
                         } ]

        for member in member_list:
            if member not in user_list:
                orphan_count = orphan_count + 1
 
        if temps is not None:
            member_temp_count=len(temps.keys())

        return [ { 'member_count' : member_count
                 , 'orphan_count' : orphan_count 
                 , 'member_temp_count' : member_temp_count
                 } ]
 

    security.declareProtected(View, 'getMemberProps')
    def getMemberProps(self):


Generated by  Doxygen 1.6.0   Back to index