summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-07-03 11:50:41 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-07-03 11:50:41 (GMT)
commit0022574e4300b0648bb60eae0bd4dd3f938ff319 (patch)
tree922834aa2b6e07d739a3439c2299869ce8ae9b12
parenta76268b3b1bd5b9522301a0b957d27f52ded3dc2 (diff)
downloadkolab-wap-0022574e4300b0648bb60eae0bd4dd3f938ff319.tar.gz
Fix logging vlv sort attribute + small fixes
-rw-r--r--lib/ext/Net/LDAP3.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ext/Net/LDAP3.php b/lib/ext/Net/LDAP3.php
index 7042c07..bddfb7a 100644
--- a/lib/ext/Net/LDAP3.php
+++ b/lib/ext/Net/LDAP3.php
@@ -1490,7 +1490,7 @@ class Net_LDAP3
}
// ...or by fetching all records dn and count them
else if (!function_exists('ldap_parse_virtuallist_control')) {
- $vlv_count = $this->search($base_dn, $filter, $scope, array('dn'), $prop, true);
+ $vlv_count = $this->search($base_dn, $filter, $scope, array('dn'), $props, true);
}
$this->vlv_active = $this->_vlv_set_controls($sort, $this->list_page, $this->page_size,
@@ -1845,7 +1845,8 @@ class Net_LDAP3
// Not passing any sort attributes means you don't care
if (!empty($sort_attrs)) {
- if (in_array($sort_attrs, $vlv_indexes[$base_dn]['sort'])) {
+ $sort_attrs = (array) $sort_attrs;
+ if (count(array_intersect($sort_attrs, $vlv_indexes[$base_dn]['sort'])) == count($sort_attrs)) {
return $sort_attrs;
}
else {
@@ -2602,7 +2603,8 @@ class Net_LDAP3
'iscritical' => true
);
- $this->_debug("C: set controls sort=" . join(' ', unpack('H'.(strlen($sort_ctrl['value'])*2), $sort_ctrl['value'])) . " ($sort[0]);"
+ $this->_debug("C: set controls sort=" . join(' ', unpack('H'.(strlen($sort_ctrl['value'])*2), $sort_ctrl['value']))
+ . " (" . implode(',', (array) $sort) . ");"
. " vlv=" . join(' ', (unpack('H'.(strlen($vlv_ctrl['value'])*2), $vlv_ctrl['value']))) . " ($offset/$page_size)");
if (!ldap_set_option($this->conn, LDAP_OPT_SERVER_CONTROLS, array($sort_ctrl, $vlv_ctrl))) {