diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-02-28 10:39:23 -0500 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-02-28 10:39:23 -0500 |
commit | b5989c933f3c51887724d89e989a3e2af4207d6e (patch) | |
tree | 40677bfa8daa1357b1ca3a561b551a142cbe6c82 /apps/user_ldap/lib/access.php | |
parent | ea83acedebbcf70b19643efe82b72fb139cf8ad2 (diff) | |
parent | 93e713d3781c5d5fc6d0dbb6c6a0a8f9c2e15b97 (diff) | |
download | nextcloud-server-b5989c933f3c51887724d89e989a3e2af4207d6e.tar.gz nextcloud-server-b5989c933f3c51887724d89e989a3e2af4207d6e.zip |
Merge branch 'master' into shared-folder-etags
Conflicts:
apps/files_sharing/lib/sharedstorage.php
Diffstat (limited to 'apps/user_ldap/lib/access.php')
-rw-r--r-- | apps/user_ldap/lib/access.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 901299e7c21..05249b8f163 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -624,7 +624,8 @@ abstract class Access { * @brief executes an LDAP search * @param $filter the LDAP filter for the search * @param $base an array containing the LDAP subtree(s) that shall be searched - * @param $attr optional, when a certain attribute shall be filtered out + * @param $attr optional, array, one or more attributes that shall be + * retrieved. Results will according to the order in the array. * @returns array with the search result * * Executes an LDAP search @@ -656,6 +657,14 @@ abstract class Access { \OCP\Util::writeLog('user_ldap', 'Attempt for Paging? '.print_r($pagedSearchOK, true), \OCP\Util::ERROR); return array(); } + + // Do the server-side sorting + foreach(array_reverse($attr) as $sortAttr){ + foreach($sr as $searchResource) { + ldap_sort($link_resource, $searchResource, $sortAttr); + } + } + $findings = array(); foreach($sr as $key => $res) { $findings = array_merge($findings, ldap_get_entries($link_resource, $res )); |