lib/Auth
Aleksander Machniak
machniak at kolabsys.com
Wed Dec 17 18:54:22 CET 2014
lib/Auth/LDAP.php | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
New commits:
commit d1f86621d0ffdbdb536fb352d9b3a74397aa04c2
Author: Aleksander Machniak <machniak at kolabsys.com>
Date: Wed Dec 17 12:53:37 2014 -0500
Fix sorting search results using vlv indexes (#4118)
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(
More information about the commits
mailing list