LDAP: fix potentially unavailable LDAP resource, which can prevent successful login

This commit is contained in:
Arthur Schiwon 2012-08-22 15:22:52 +02:00
parent 63c454c7b2
commit 536fbb9189
1 changed files with 3 additions and 0 deletions

View File

@ -91,6 +91,9 @@ class Connection {
public function getConnectionResource() {
if(!$this->ldapConnectionRes) {
$this->init();
} else if(!is_resource($this->ldapConnectionRes)) {
$this->ldapConnectionRes = null;
$this->establishConnection();
}
if(is_null($this->ldapConnectionRes)) {
\OCP\Util::writeLog('user_ldap', 'Connection could not be established', \OCP\Util::ERROR);