diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index 9c7967ae3b..68bf8b2271 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -697,9 +697,9 @@ class accounts_ldap $order = $propertyMap[$param['order']] ? $propertyMap[$param['order']] : 'uid'; $sri = ldap_search($this->ds, $this->user_context, $filter,array('uid', $order)); $fullSet = array(); - foreach (ldap_get_entries($this->ds, $sri) as $entry) + foreach (ldap_get_entries($this->ds, $sri) as $key => $entry) { - $fullSet[$entry['uid'][0]] = $entry[$order][0]; + if ($key != 'count') $fullSet[$entry['uid'][0]] = $entry[$order][0]; } if (is_numeric($param['type'])) // return only group-members @@ -717,8 +717,8 @@ class accounts_ldap $sortFn = $param['sort'] == 'DESC' ? 'arsort' : 'asort'; $sortFn($fullSet); - $relevantAccounts = array_slice(array_keys($fullSet), $start, $offset); - + $relevantAccounts = is_numeric($start) ? array_slice(array_keys($fullSet), $start, $offset) : array_keys($fullSet); + $filter = "(" . "&(objectclass=posixaccount)" . '(|(uid='.implode(')(uid=',$relevantAccounts).'))' . $this->account_filter . ")"; $filter = str_replace(array('%user','%domain'),array('*',$GLOBALS['egw_info']['user']['domain']),$filter);