summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/kolab_auth/kolab_auth_ldap.php6
-rw-r--r--plugins/kolab_delegation/kolab_delegation_engine.php6
2 files changed, 7 insertions, 5 deletions
diff --git a/plugins/kolab_auth/kolab_auth_ldap.php b/plugins/kolab_auth/kolab_auth_ldap.php
index 7044ebf..40237ac 100644
--- a/plugins/kolab_auth/kolab_auth_ldap.php
+++ b/plugins/kolab_auth/kolab_auth_ldap.php
@@ -215,10 +215,11 @@ class kolab_auth_ldap extends rcube_ldap_generic
* 2 - prefix (abc*)
* @param array $required List of fields that cannot be empty
* @param int $limit Number of records
+ * @param int $count Returns the number of records found
*
* @return array List or false on error
*/
- function search($fields, $value, $mode=1, $required = array(), $limit = 0)
+ function dosearch($fields, $value, $mode=1, $required = array(), $limit = 0, &$count = 0)
{
if (empty($fields)) {
return array();
@@ -295,7 +296,8 @@ class kolab_auth_ldap extends rcube_ldap_generic
$attrs = array_values($this->fieldmap);
$list = array();
- if ($result = parent::search($base_dn, $filter, $scope, $attrs)) {
+ if ($result = $this->search($base_dn, $filter, $scope, $attrs)) {
+ $count = $result->count();
$i = 0;
foreach ($result as $entry) {
if ($limit && $limit <= $i) {
diff --git a/plugins/kolab_delegation/kolab_delegation_engine.php b/plugins/kolab_delegation/kolab_delegation_engine.php
index ad96831..3d3bd33 100644
--- a/plugins/kolab_delegation/kolab_delegation_engine.php
+++ b/plugins/kolab_delegation/kolab_delegation_engine.php
@@ -202,7 +202,7 @@ class kolab_delegation_engine
return array();
}
- $list = $ldap->search($this->ldap_login_field, $login, 1);
+ $list = $ldap->dosearch($this->ldap_login_field, $login, 1);
if (count($list) == 1) {
$dn = key($list);
@@ -288,7 +288,7 @@ class kolab_delegation_engine
return array();
}
- $list = $ldap->search($this->ldap_delegate_field, $this->ldap_dn, 1);
+ $list = $ldap->dosearch($this->ldap_delegate_field, $this->ldap_dn, 1);
foreach ($list as $dn => $delegator) {
$delegator = $this->parse_ldap_record($delegator, $dn);
@@ -424,7 +424,7 @@ class kolab_delegation_engine
$fields = array_unique(array_filter(array_merge((array)$this->ldap_name_field, (array)$this->ldap_login_field)));
$users = array();
- $result = $ldap->search($fields, $search, $mode, (array)$this->ldap_login_field, $max);
+ $result = $ldap->dosearch($fields, $search, $mode, (array)$this->ldap_login_field, $max);
foreach ($result as $record) {
// skip self