* Admin/API/LDAP: fixed not working pagination of accounts for 2. or further pages introduced by enabling caching again in last package

This commit is contained in:
Ralf Becker 2013-06-26 08:12:47 +00:00
parent f3a7d9df9c
commit eadc4edf2e

View File

@ -736,7 +736,7 @@ class accounts_ldap
);
if ($param['active'] && !$this->frontend->is_active($account))
{
--$totalcount;
if (isset($totalcount)) --$totalcount;
continue;
}
$account['account_fullname'] = common::display_fullname($account['account_lid'],$account['account_firstname'],$account['account_lastname'],$allVals['uidnumber'][0]);
@ -797,9 +797,14 @@ class accounts_ldap
$this->_callback_order = empty($param['order']) ? array('account_lid') : explode(',',$param['order']);
$sortedAccounts = $accounts;
uasort($sortedAccounts,array($this,'_sort_callback'));
$account_search[$unl_serial]['data'] = $sortedAccounts;
$this->total = isset($totalcount) ? $totalcount : count($accounts);
$account_search[$unl_serial]['total'] = $this->total = isset($totalcount) ? $totalcount : count($accounts);
// if totalcount is set, $sortedAccounts is NOT the full set, but already a limited set!
if (!isset($totalcount))
{
$account_search[$unl_serial]['data'] = $sortedAccounts;
$account_search[$unl_serial]['total'] = $this->total;
}
}
//echo "<p>accounts_ldap::search() found $this->total: ".microtime()."</p>\n";
// return only the wanted accounts