protected function _listGroups($user)
{
$attr = $this->_params['gid'];
try {
if (!empty($this->_params['attrisdn'])) {
$user = $this->_ldap->findUserDN($user);
}
$filter = Horde_Ldap_Filter::create($this->_params['memberuid'], 'equals', $user);
$filter = Horde_Ldap_Filter::combine('and', array($this->_filter, $filter));
$search = $this->_ldap->search($this->_params['basedn'], $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;
}