diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-05-25 11:02:51 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-05-25 11:02:51 +0200 |
commit | bfa715768a22430273db956a14ed1a3cb964c743 (patch) | |
tree | 98bf8a68c6c70d1492f849bf243559b016627d76 /apps/user_ldap | |
parent | 698862519de6b364da6c20a97d8c546204e80f3d (diff) | |
download | nextcloud-server-bfa715768a22430273db956a14ed1a3cb964c743.tar.gz nextcloud-server-bfa715768a22430273db956a14ed1a3cb964c743.zip |
LDAP: fix handling when LDAP Host is offline
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/connection.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index ba4de135341..8a61775a6f2 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -601,14 +601,13 @@ class Connection { $error = null; } - $error = null; //if LDAP server is not reachable, try the Backup (Replica!) Server - if((!$bindStatus && ($error === -1)) + if((!$bindStatus && ($error !== 0)) || $this->config['ldapOverrideMainServer'] || $this->getFromCache('overrideMainServer')) { $this->doConnect($this->config['ldapBackupHost'], $this->config['ldapBackupPort']); $bindStatus = $this->bind(); - if($bindStatus && $error === -1) { + if(!$bindStatus && $error === -1) { //when bind to backup server succeeded and failed to main server, //skip contacting him until next cache refresh $this->writeToCache('overrideMainServer', true); |