SF Bug #3139097 - Argument for PickList sorting does not work

This commit is contained in:
Deon George 2011-04-27 23:27:31 +10:00
parent d5c8d42adc
commit bf8ac5306e

View File

@ -2878,7 +2878,6 @@ function binSIDtoText($binsid) {
* or true to have the returned array sorted by DN (uses ksort) * or true to have the returned array sorted by DN (uses ksort)
* or an array of attribute names to sort by attribute values * or an array of attribute names to sort by attribute values
* @return array Array of values keyed by $key. * @return array Array of values keyed by $key.
* @todo sort is not being performed
*/ */
function return_ldap_hash($base,$filter,$key,$attrs,$sort=true) { function return_ldap_hash($base,$filter,$key,$attrs,$sort=true) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
@ -2919,6 +2918,9 @@ function return_ldap_hash($base,$filter,$key,$attrs,$sort=true) {
$results[$values[$key]][$attr] = $values[$lattr]; $results[$values[$key]][$attr] = $values[$lattr];
} }
if ($sort)
masort($results,is_array($sort) ? implode(',',$sort) : 'dn');
return $results; return $results;
} }