summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_ldap_generic.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/lib/Roundcube/rcube_ldap_generic.php')
-rw-r--r--program/lib/Roundcube/rcube_ldap_generic.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/program/lib/Roundcube/rcube_ldap_generic.php b/program/lib/Roundcube/rcube_ldap_generic.php
index 923a12a41..252eafabe 100644
--- a/program/lib/Roundcube/rcube_ldap_generic.php
+++ b/program/lib/Roundcube/rcube_ldap_generic.php
@@ -160,7 +160,7 @@ class rcube_ldap_generic
$this->config['hosts'] = array($this->config['hosts']);
foreach ($this->config['hosts'] as $host) {
- if ($this->connect($host)) {
+ if (!empty($host) && $this->connect($host)) {
return true;
}
}
@@ -190,6 +190,9 @@ class rcube_ldap_generic
if (isset($this->config['referrals']))
ldap_set_option($lc, LDAP_OPT_REFERRALS, $this->config['referrals']);
+
+ if (isset($this->config['dereference']))
+ ldap_set_option($lc, LDAP_OPT_DEREF, $this->config['dereference']);
}
else {
$this->_debug("S: NOT OK");
@@ -240,7 +243,7 @@ class rcube_ldap_generic
$method = 'DIGEST-MD5';
}
- $this->_debug("C: SASL Bind [mech: $method, authc: $authc, authz: $authz, pass: $pass]");
+ $this->_debug("C: SASL Bind [mech: $method, authc: $authc, authz: $authz, pass: **** [" . strlen($pass) . "]");
if (ldap_sasl_bind($this->conn, NULL, $pass, $method, NULL, $authc, $authz)) {
$this->_debug("S: OK");
@@ -271,7 +274,7 @@ class rcube_ldap_generic
return false;
}
- $this->_debug("C: Bind $dn [pass: $pass]");
+ $this->_debug("C: Bind $dn, pass: **** [" . strlen($pass) . "]");
if (@ldap_bind($this->conn, $dn, $pass)) {
$this->_debug("S: OK");
@@ -886,9 +889,10 @@ class rcube_ldap_generic
}
$this->vlv_config = array();
+ $config_root_dn = $this->config['config_root_dn'];
- $ldap_result = ldap_search($this->conn, $this->config['config_root_dn'], '(objectclass=vlvsearch)', array('*'), 0, 0, 0);
- $vlv_searches = new rcube_ldap_result($this->conn, $ldap_result, $this->config['config_root_dn'], '(objectclass=vlvsearch)');
+ $ldap_result = ldap_search($this->conn, $config_root_dn, '(objectclass=vlvsearch)', array('*'), 0, 0, 0);
+ $vlv_searches = new rcube_ldap_result($this->conn, $ldap_result, $config_root_dn, '(objectclass=vlvsearch)');
if ($vlv_searches->count() < 1) {
$this->_debug("D: Empty result from search for '(objectclass=vlvsearch)' on '$config_root_dn'");