Rename kolab_auth_ldap::search() method because its signature doesn't match rcube_ldap_generic::search() and fails recursive calls in VLV search mode + add return parameter for results count
This commit is contained in:
parent
b415c512f0
commit
115c4c54b7
2 changed files with 7 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue