Horde_Group_Ldap::_listAll PHP Method

_listAll() protected method

Returns a list of all groups a user may see, with IDs as keys and names as values.
protected _listAll ( ) : array
return array All existing groups.
    protected function _listAll()
    {
        $attr = $this->_params['gid'];
        try {
            $search = $this->_ldap->search($this->_params['basedn'], $this->_filter, array($attr));
        } catch (Horde_Ldap_Exception $e) {
            throw new Horde_Group_Exception($e);
        }
        $entries = array();
        foreach ($search->sortedAsArray(array($attr)) as $entry) {
            $entries[$entry['dn']] = $entry[$attr][0];
        }
        return $entries;
    }