* LDAP: setting default sorting to ascending, as in SQL backend

This commit is contained in:
Ralf Becker 2015-03-27 08:09:29 +00:00
parent 4368ccbb58
commit 57d06008fa

View File

@ -643,7 +643,7 @@ class accounts_ldap
* or integer group-id for a list of members of that group * or integer group-id for a list of members of that group
* @param $param['start'] int first account to return (returns offset or max_matches entries) or all if not set * @param $param['start'] int first account to return (returns offset or max_matches entries) or all if not set
* @param $param['order'] string column to sort after, default account_lid if unset * @param $param['order'] string column to sort after, default account_lid if unset
* @param $param['sort'] string 'ASC' or 'DESC', default 'DESC' if not set * @param $param['sort'] string 'ASC' or 'DESC', default 'ASC' if not set
* @param $param['query'] string to search for, no search if unset or empty * @param $param['query'] string to search for, no search if unset or empty
* @param $param['query_type'] string: * @param $param['query_type'] string:
* 'all' - query all fields for containing $param[query] * 'all' - query all fields for containing $param[query]
@ -657,7 +657,7 @@ class accounts_ldap
*/ */
function search($param) function search($param)
{ {
//echo "<p>accounts_ldap::search(".print_r($param,true)."): ".microtime()."</p>\n"; //error_log(__METHOD__."(".array2string($param).")");
$account_search =& accounts::$cache['account_search']; $account_search =& accounts::$cache['account_search'];
// check if the query is cached // check if the query is cached
@ -875,7 +875,7 @@ class accounts_ldap
* *
* @var string * @var string
*/ */
private $_callback_sort = 'DESC'; private $_callback_sort = 'ASC';
/** /**
* column_names to sort by * column_names to sort by
* *
@ -894,7 +894,7 @@ class accounts_ldap
{ {
foreach($this->_callback_order as $col ) foreach($this->_callback_order as $col )
{ {
if($this->_callback_sort == 'ASC') if($this->_callback_sort != 'DESC')
{ {
$cmp = strcasecmp( $a[$col], $b[$col] ); $cmp = strcasecmp( $a[$col], $b[$col] );
} }