Merge pull request #10233 from nextcloud/backport/10227/ldap-bind-loop
[stable13] Only bind to ldap if configuration for the first server is set
This commit is contained in:
commit
761daeab1e
|
@ -564,8 +564,8 @@ class Connection extends LDAPUtility {
|
||||||
if (!$isOverrideMainServer) {
|
if (!$isOverrideMainServer) {
|
||||||
$this->doConnect($this->configuration->ldapHost,
|
$this->doConnect($this->configuration->ldapHost,
|
||||||
$this->configuration->ldapPort);
|
$this->configuration->ldapPort);
|
||||||
}
|
|
||||||
return $this->bind();
|
return $this->bind();
|
||||||
|
}
|
||||||
} catch (ServerNotAvailableException $e) {
|
} catch (ServerNotAvailableException $e) {
|
||||||
if(!$isBackupHost) {
|
if(!$isBackupHost) {
|
||||||
throw $e;
|
throw $e;
|
||||||
|
|
|
@ -110,7 +110,7 @@ class ConnectionTest extends \Test\TestCase {
|
||||||
->method('setOption')
|
->method('setOption')
|
||||||
->will($this->returnValue(true));
|
->will($this->returnValue(true));
|
||||||
|
|
||||||
$this->ldap->expects($this->exactly(2))
|
$this->ldap->expects($this->exactly(3))
|
||||||
->method('connect')
|
->method('connect')
|
||||||
->will($this->returnValue('ldapResource'));
|
->will($this->returnValue('ldapResource'));
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ class ConnectionTest extends \Test\TestCase {
|
||||||
->will($this->returnValue(0));
|
->will($this->returnValue(0));
|
||||||
|
|
||||||
// Not called often enough? Then, the fallback to the backup server is broken.
|
// 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')
|
->method('getFromCache')
|
||||||
->with('overrideMainServer')
|
->with('overrideMainServer')
|
||||||
->will($this->onConsecutiveCalls(false, false, true, true));
|
->will($this->onConsecutiveCalls(false, false, true, true));
|
||||||
|
|
Loading…
Reference in New Issue