Fix debug setting in ldap classes

pull/82/head
Aleksander Machniak 12 years ago
parent 4e12fd5c82
commit fae90da582

@ -205,8 +205,9 @@ class rcube_ldap extends rcube_addressbook
} }
// initialize ldap wrapper object // initialize ldap wrapper object
$this->ldap = new rcube_ldap_generic($this->prop, true); $this->ldap = new rcube_ldap_generic($this->prop);
$this->ldap->set_cache($this->cache); $this->ldap->set_cache($this->cache);
$this->ldap->set_debug($this->debug);
$this->_connect(); $this->_connect();
} }
@ -1459,11 +1460,14 @@ class rcube_ldap extends rcube_addressbook
* Activate/deactivate debug mode * Activate/deactivate debug mode
* *
* @param boolean $dbg True if LDAP commands should be logged * @param boolean $dbg True if LDAP commands should be logged
* @access public
*/ */
function set_debug($dbg = true) function set_debug($dbg = true)
{ {
$this->debug = $dbg; $this->debug = $dbg;
if ($this->ldap) {
$this->ldap->set_debug($dbg);
}
} }

@ -77,9 +77,8 @@ class rcube_ldap_generic
* Object constructor * Object constructor
* *
* @param array $p LDAP connection properties * @param array $p LDAP connection properties
* @param boolean $debug Enables debug mode
*/ */
function __construct($p, $debug = false) function __construct($p)
{ {
$this->config = $p; $this->config = $p;
@ -88,8 +87,6 @@ class rcube_ldap_generic
if (!is_array($p['hosts']) && !empty($p['host'])) if (!is_array($p['hosts']) && !empty($p['host']))
$this->config['hosts'] = array($p['host']); $this->config['hosts'] = array($p['host']);
$this->debug = $debug;
} }
/** /**

Loading…
Cancel
Save