diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index 2d35ac5894..de1b7cb434 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -621,6 +621,7 @@ class accounts_backend { $query = ldap::quote(strtolower($param['query'])); + $accounts = array(); if($param['type'] != 'groups') { $filter = "(&(objectclass=posixaccount)"; @@ -727,20 +728,13 @@ class accounts_backend } //echo "
accounts_backend::search() found $this->total: ".microtime()."
\n"; // return only the wanted accounts - if (is_array($sortedAccounts)) + reset($sortedAccounts); + if(is_numeric($start) && is_numeric($offset)) { - reset($sortedAccounts); - if(is_numeric($start) && is_numeric($offset)) - { - $account_search[$serial]['total'] = $this->total; - return $account_search[$serial]['data'] = array_slice($sortedAccounts, $start, $offset); - } - else - { - return $sortedAccounts; - } + $account_search[$serial]['total'] = $this->total; + return $account_search[$serial]['data'] = array_slice($sortedAccounts, $start, $offset); } - return False; + return $sortedAccounts; } /**