diff options
author | Aleksander Machniak <machniak@kolabsys.com> | 2014-12-17 17:53:37 (GMT) |
---|---|---|
committer | Aleksander Machniak <machniak@kolabsys.com> | 2014-12-17 17:53:37 (GMT) |
commit | d1f86621d0ffdbdb536fb352d9b3a74397aa04c2 (patch) | |
tree | 72116fa5d4b4717152cdaec706657a491a6cf4f2 | |
parent | b4b7bac04f3dc8dd6bdcd27c0d963380b3c99811 (diff) | |
download | kolab-wap-d1f86621d0ffdbdb536fb352d9b3a74397aa04c2.tar.gz |
Fix sorting search results using vlv indexes (#4118)
-rw-r--r-- | lib/Auth/LDAP.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php index a17263d..b80a463 100644 --- a/lib/Auth/LDAP.php +++ b/lib/Auth/LDAP.php @@ -940,15 +940,13 @@ class LDAP extends Net_LDAP3 { return $this->_read($sharedfolder_dn, $attributes); } - - public function search($base_dn, $filter = '(objectclass=*)', $scope = 'sub', $sort = NULL, $search = array()) + public function search($base_dn, $filter = '(objectclass=*)', $scope = 'sub', $attributes = null, $props = array(), $count_only = false) { if (isset($_SESSION['user']->user_bind_dn) && !empty($_SESSION['user']->user_bind_dn)) { $this->bind($_SESSION['user']->user_bind_dn, $_SESSION['user']->user_bind_pw); } - $this->_log(LOG_DEBUG, "Relaying search to parent:" . var_export(func_get_args(), true)); - return parent::search($base_dn, $filter, $scope, $sort, $search); + return parent::search($base_dn, $filter, $scope, $attributes ?: array('*'), $props, $count_only); } public function subject_base_dn($subject, $strict = false) @@ -1086,7 +1084,13 @@ class LDAP extends Net_LDAP3 { $attributes = array('*'); } - $result = $this->search_entries($base_dn, $filter, $scope, $attributes, array('search' => $search)); + // LDAP3 search parameters + $opts = array( + 'search' => $search, + 'sort' => $params['sort_by'], // for VLV + ); + + $result = $this->search_entries($base_dn, $filter, $scope, $attributes, $opts); $entries = $this->sort_and_slice($result, $params); return array( |