diff --git a/api/src/Accounts/Ads.php b/api/src/Accounts/Ads.php index e36c6f950f..cedd3fc2c7 100644 --- a/api/src/Accounts/Ads.php +++ b/api/src/Accounts/Ads.php @@ -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; diff --git a/api/src/Accounts/Ldap.php b/api/src/Accounts/Ldap.php index e80c672408..3d18867707 100644 --- a/api/src/Accounts/Ldap.php +++ b/api/src/Accounts/Ldap.php @@ -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);