public function Connect() { Log::Debug('Trying to connect to LDAP'); $this->ldap = Net_LDAP2::connect($this->options->Ldap2Config()); if (PEAR::isError($this->ldap)) { $message = 'Could not connect to LDAP server. Check your settings in Ldap.config.php : ' . $this->ldap->getMessage(); Log::Error($message); throw new Exception($message); } return true; }