diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-07-13 17:52:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 17:52:49 +0200 |
commit | 761daeab1ed1de1979290b2d98d666172d46f68c (patch) | |
tree | f2b791b8340deb72143d69066e7e8f31dfef97d6 | |
parent | 30dea9906ac805f1ece26c68061e1d10ac0159fb (diff) | |
parent | 9f9f1d8cb073bf8ad7edd0853244e91493834c09 (diff) | |
download | nextcloud-server-761daeab1ed1de1979290b2d98d666172d46f68c.tar.gz nextcloud-server-761daeab1ed1de1979290b2d98d666172d46f68c.zip |
Merge pull request #10233 from nextcloud/backport/10227/ldap-bind-loop
[stable13] Only bind to ldap if configuration for the first server is set
-rw-r--r-- | apps/user_ldap/lib/Connection.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/tests/ConnectionTest.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php index 039e46aeefd..8bbe0345859 100644 --- a/apps/user_ldap/lib/Connection.php +++ b/apps/user_ldap/lib/Connection.php @@ -564,8 +564,8 @@ class Connection extends LDAPUtility { if (!$isOverrideMainServer) { $this->doConnect($this->configuration->ldapHost, $this->configuration->ldapPort); + return $this->bind(); } - return $this->bind(); } catch (ServerNotAvailableException $e) { if(!$isBackupHost) { throw $e; diff --git a/apps/user_ldap/tests/ConnectionTest.php b/apps/user_ldap/tests/ConnectionTest.php index c6c1fe11922..7a5da72fcdb 100644 --- a/apps/user_ldap/tests/ConnectionTest.php +++ b/apps/user_ldap/tests/ConnectionTest.php @@ -110,7 +110,7 @@ class ConnectionTest extends \Test\TestCase { ->method('setOption') ->will($this->returnValue(true)); - $this->ldap->expects($this->exactly(2)) + $this->ldap->expects($this->exactly(3)) ->method('connect') ->will($this->returnValue('ldapResource')); @@ -119,7 +119,7 @@ class ConnectionTest extends \Test\TestCase { ->will($this->returnValue(0)); // Not called often enough? Then, the fallback to the backup server is broken. - $this->connection->expects($this->exactly(3)) + $this->connection->expects($this->exactly(4)) ->method('getFromCache') ->with('overrideMainServer') ->will($this->onConsecutiveCalls(false, false, true, true)); |