* LDAP/ActiveDirectory: fix sorting accounts by anything other then account-name fails

This commit is contained in:
Ralf Becker 2018-01-29 12:47:57 +01:00
parent 96bcda7433
commit bff3b0215e
2 changed files with 8 additions and 0 deletions

View File

@ -943,6 +943,10 @@ class Ads
// sort the array
$this->_callback_sort = strtoupper($param['sort']);
$this->_callback_order = empty($param['order']) ? array('account_lid') : explode(',',$param['order']);
foreach($this->_callback_order as &$col)
{
if (substr($col, 0, 8) !== 'account_') $col = 'account_'.$col;
}
$sortedAccounts = $accounts;
uasort($sortedAccounts,array($this,'_sort_callback'));
$account_search[$unl_serial]['data'] = $sortedAccounts;

View File

@ -853,6 +853,10 @@ class Ldap
// sort the array
$this->_callback_sort = strtoupper($param['sort']);
$this->_callback_order = empty($param['order']) ? array('account_lid') : explode(',',$param['order']);
foreach($this->_callback_order as &$col)
{
if (substr($col, 0, 8) !== 'account_') $col = 'account_'.$col;
}
$sortedAccounts = $accounts;
uasort($sortedAccounts,array($this,'_sort_callback'));
$this->total = isset($totalcount) ? $totalcount : count($accounts);