summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-08-29 20:24:03 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-08-29 20:24:03 +0000
commit6fcfe459a57a3e70bd1343c7c3af21b6d0659fe5 (patch)
tree7102c46ae2c96bc238bd48bc1483fec04aa941d3 /roundcubemail/program/include
parent17336ef87876067d4a50e7526d294b3512bce85c (diff)
- allow empty LDAP 'filter' (#1485184)
git-svn-id: https://svn.roundcube.net/trunk@2893 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_ldap.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/roundcubemail/program/include/rcube_ldap.php b/roundcubemail/program/include/rcube_ldap.php
index 762e6e371..e73508670 100644
--- a/roundcubemail/program/include/rcube_ldap.php
+++ b/roundcubemail/program/include/rcube_ldap.php
@@ -244,7 +244,7 @@ class rcube_ldap extends rcube_addressbook
$filter = $this->prop['filter'];
$this->set_search_set($filter);
}
-
+
// exec LDAP search if no result resource is stored
if ($this->conn && !$this->ldap_result)
$this->_exec_search();
@@ -381,7 +381,7 @@ class rcube_ldap extends rcube_addressbook
$res = null;
if ($this->conn && $dn)
{
- $this->ldap_result = ldap_read($this->conn, base64_decode($dn), "(objectclass=*)", array_values($this->fieldmap));
+ $this->ldap_result = ldap_read($this->conn, base64_decode($dn), '(objectclass=*)', array_values($this->fieldmap));
$entry = @ldap_first_entry($this->conn, $this->ldap_result);
if ($entry && ($rec = ldap_get_attributes($this->conn, $entry)))
@@ -554,10 +554,11 @@ class rcube_ldap extends rcube_addressbook
*/
function _exec_search()
{
- if ($this->ready && $this->filter)
+ if ($this->ready)
{
+ $filter = $this->filter ? $this->filter : '(objectclass=*)';
$function = $this->prop['scope'] == 'sub' ? 'ldap_search' : ($this->prop['scope'] == 'base' ? 'ldap_read' : 'ldap_list');
- $this->ldap_result = $function($this->conn, $this->prop['base_dn'], $this->filter, array_values($this->fieldmap), 0, 0);
+ $this->ldap_result = $function($this->conn, $this->prop['base_dn'], $filter, array_values($this->fieldmap), 0, 0);
return true;
}
else