From a23ab6a9fb7b51d1035d7e932a06c49c472b62d0 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 27 Oct 2016 10:50:56 +0200 Subject: [PATCH] * Addressbook/LDAP: fix error if egroupware-epl-compat (old API) not installed --- api/src/Contacts/Ldap.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/api/src/Contacts/Ldap.php b/api/src/Contacts/Ldap.php index 8e23be69fd..342962a2d2 100644 --- a/api/src/Contacts/Ldap.php +++ b/api/src/Contacts/Ldap.php @@ -872,7 +872,22 @@ class Ldap $order[] = $o; } } - $rows = ExecMethod2('phpgwapi.arrayfunctions.arfsort',$rows,$order,$sort); + usort($rows, function($a, $b) use ($order, $sort) + { + foreach($order as $f) + { + if($sort == 'ASC') + { + $strc = strcmp($a[$f], $b[$f]); + } + else + { + $strc = strcmp($b[$f], $a[$f]); + } + if ($strc) return $strc; + } + return 0; + }); } // if requested ($start !== false) return only limited resultset if (is_array($start))