roundcubemail/program/lib/Roundcube/rcube_ldap.php
function list_group_members($dn, $count = false, $entries = null)
    {
        $group_members = array();

        // fetch group object
        if (empty($entries)) {
            $attribs = array_merge(array('dn','objectClass','memberURL'), array_values($this->group_types));
            $entries = $this->ldap->read_entries($dn, '(objectClass=*)', $attribs);
            if ($entries === false) {
                return $group_members;
            }
        }

        for ($i=0; $i < $entries['count']; $i++) {
            $entry = $entries[$i];
            $attrs = array();

            foreach ((array)$entry['objectclass'] as $objectclass) {
                if (($member_attr = $this->get_group_member_attr(array($objectclass), ''))
                    && ($member_attr = strtolower($member_attr)) && !in_array($member_attr, $attrs)
                ) {
                    $members       = $this->_list_group_members($dn, $entry, $member_attr, $count);
                    $group_members = array_merge($group_members, $members);
                    $attrs[]       = $member_attr;
                }
                else if (!empty($entry['memberurl'])) {
                    $members       = $this->_list_group_memberurl($dn, $entry, $count);
                    $group_members = array_merge($group_members, $members);
                }

                if ($this->prop['sizelimit'] && count($group_members) > $this->prop['sizelimit']) {
                    break 2;
                }
            }
        }

        return array_filter($group_members);
    }
function list_group_members($dn, $count = false, $entries = null)
    {
        $group_members = array();

        // fetch group object
        if (empty($entries)) {
            $attribs = array_merge(array('dn','objectClass','memberURL'), array_values($this->group_types));
            $entries = $this->ldap->read_entries($dn, '(objectClass=*)', $attribs);
            if ($entries === false) {
                return $group_members;
            }
        }

        for ($i=0; $i < $entries['count']; $i++) {
            $entry = $entries[$i];
            $attrs = array();

            foreach ((array)$entry['objectclass'] as $objectclass) {
                if (($member_attr = $this->get_group_member_attr(array($objectclass), ''))
                    && ($member_attr = strtolower($member_attr)) && !in_array($member_attr, $attrs)
                ) {
                    $members       = $this->_list_group_members($dn, $entry, $member_attr, $count);
                    $group_members = array_merge($group_members, $members);
                    $attrs[]       = $member_attr;
                }
                else if (!empty($entry['memberurl'])) {
                    $members       = $this->_list_group_memberurl($dn, $entry, $count);
                    $group_members = array_merge($group_members, $members);
                }

                if ($this->prop['sizelimit'] && count($group_members) > $this->prop['sizelimit']) {
                    break 2;
                }
            }
        }

        return array_filter($group_members);
    }
function list_group_members ( $ dn , $ count = false , $ entries = null ) { $ group_members = array ( ) ; // fetch group object if ( empty ( $ entries ) ) { $ attribs = array_merge ( array ( 'dn' , 'objectClass' , 'memberURL' ) , array_values ( $ this -> group_types ) ) ; $ entries = $ this -> ldap -> read_entries ( $ dn , '(objectClass=*)' , $ attribs ) ; if ( $ entries === false ) { return $ group_members ; } } for ( $ i = 0 ; $ i < $ entries [ 'count' ] ; $ i ++ ) { $ entry = $ entries [ $ i ] ; $ attrs = array ( ) ; foreach ( ( array ) $ entry [ 'objectclass' ] as $ objectclass ) { if ( ( $ member_attr = $ this -> get_group_member_attr ( array ( $ objectclass ) , '' ) ) && ( $ member_attr = strtolower ( $ member_attr ) ) && ! in_array ( $ member_attr , $ attrs ) ) { $ members = $ this -> _list_group_members ( $ dn , $ entry , $ member_attr , $ count ) ; $ group_members = array_merge ( $ group_members , $ members ) ; $ attrs [ ] = $ member_attr ; } else if ( ! empty ( $ entry [ 'memberurl' ] ) ) { $ members = $ this -> _list_group_memberurl ( $ dn , $ entry , $ count ) ; $ group_members = array_merge ( $ group_members , $ members ) ; } if ( $ this -> prop [ 'sizelimit' ] && count ( $ group_members ) > $ this -> prop [ 'sizelimit' ] ) { break 2 ; } } } return array_filter ( $ group_members ) ; }
Get all members of the given group

@param string  Group DN
@param boolean Count only
@param array   Group entries (if called recursively)
@return array  Accumulated group members
Get all members of the given group