From e237eec8468e99b65a9160a0a3f07529b92725e3 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 02 Dec 2011 04:58:03 -0500
Subject: [PATCH] - Applied fixes from trunk up to r5526
---
program/include/rcube_ldap.php | 24 ++++++++++--------------
1 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index 0334751..3ec0e5f 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -655,14 +655,11 @@
$attrib = $count ? array('dn') : array_values($this->fieldmap);
if ($result = @$func($this->conn, $m[1], $filter,
- $attrib, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit']))
- {
+ $attrib, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit'])
+ ) {
$this->_debug("S: ".ldap_count_entries($this->conn, $result)." record(s) for ".$m[1]);
- if ($err = ldap_errno($this->conn))
- $this->_debug("S: Error: " .ldap_err2str($err));
}
- else
- {
+ else {
$this->_debug("S: ".ldap_error($this->conn));
return $group_members;
}
@@ -1227,15 +1224,14 @@
// only fetch dn for count (should keep the payload low)
$attrs = $count ? array('dn') : array_values($this->fieldmap);
if ($this->ldap_result = @$function($this->conn, $this->base_dn, $filter,
- $attrs, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit']))
- {
- $this->_debug("S: ".ldap_count_entries($this->conn, $this->ldap_result)." record(s)");
- if ($err = ldap_errno($this->conn))
- $this->_debug("S: Error: " .ldap_err2str($err));
- return $count ? ldap_count_entries($this->conn, $this->ldap_result) : true;
+ $attrs, 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit'])
+ ) {
+ $entries_count = ldap_count_entries($this->conn, $this->ldap_result);
+ $this->_debug("S: $count_entries record(s)");
+
+ return $count ? $count_entries : true;
}
- else
- {
+ else {
$this->_debug("S: ".ldap_error($this->conn));
}
}
--
Gitblit v1.9.1