diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-11-25 13:43:40 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-11-25 13:43:40 +0000 |
| commit | 8a80c1b0c69d04d2b73e2b6543dd259ecd09f370 (patch) | |
| tree | 336d02c74d232c2e221d19d02b3fd4bd915dfb15 | |
| parent | cde5f46fcab718a37fa5347c213a37f3691a28ae (diff) | |
- Add some debug and error handling around vlv_search
git-svn-id: https://svn.roundcube.net/trunk@5489 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/include/rcube_ldap.php | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/roundcubemail/program/include/rcube_ldap.php b/roundcubemail/program/include/rcube_ldap.php index e308ffd58..92db189d0 100644 --- a/roundcubemail/program/include/rcube_ldap.php +++ b/roundcubemail/program/include/rcube_ldap.php @@ -537,11 +537,11 @@ class rcube_ldap extends rcube_addressbook } /** - * Get all members of the given group - * - * @param string Group DN - * @param array Group entries (if called recursively) - * @return array Accumulated group members + * Get all members of the given group + * + * @param string Group DN + * @param array Group entries (if called recursively) + * @return array Accumulated group members */ function list_group_members($dn, $count = false, $entries = null) { @@ -742,9 +742,17 @@ class rcube_ldap extends rcube_addressbook $this->ldap_result = @$function($this->conn, $this->base_dn, $this->filter ? $this->filter : '(objectclass=*)', array_values($this->fieldmap), 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit']); + $this->result = new rcube_result_set(0); + + if (!$this->ldap_result) { + $this->_debug("S: ".ldap_error($this->conn)); + return $this->result; + } + + $this->_debug("S: ".ldap_count_entries($this->conn, $this->ldap_result)." record(s)"); + // get all entries of this page and post-filter those that really match the query $search = mb_strtolower($value); - $this->result = new rcube_result_set(0); $entries = ldap_get_entries($this->conn, $this->ldap_result); for ($i = 0; $i < $entries['count']; $i++) { |
