summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-07-13 15:12:34 +0200
committerGitHub <noreply@github.com>2018-07-13 15:12:34 +0200
commit0343d59c65f10dfc52cd8cda7b5ccaf0961d08fd (patch)
treebf2cf2541a5c1c30ebc9b3fde4a9f1c4032fd1cd /apps
parentf2b92c44a358cce2f646548374f1dcb7e923915b (diff)
parent858bd67eff3c0d0b109d9a2fdc6797f979db5ebd (diff)
downloadnextcloud-server-0343d59c65f10dfc52cd8cda7b5ccaf0961d08fd.tar.gz
nextcloud-server-0343d59c65f10dfc52cd8cda7b5ccaf0961d08fd.zip
Merge pull request #10227 from nextcloud/bugfix/10160/ldap-bind-loop
Only bind to ldap if configuration for the first server is set
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/lib/Connection.php2
-rw-r--r--apps/user_ldap/tests/ConnectionTest.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index 85e6ad6fd9e..c912d9f89f8 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -576,8 +576,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));