summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/lib/Connection.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index 89b58b7ebfd..82d0374c759 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -167,7 +167,7 @@ class Connection extends LDAPUtility {
*/
public function __clone() {
$this->configuration = new Configuration($this->configPrefix,
- !is_null($this->configID));
+ !is_null($this->configID));
if (count($this->bindResult) !== 0 && $this->bindResult['result'] === true) {
$this->bindResult = [];
}
@@ -407,9 +407,8 @@ class Connection extends LDAPUtility {
} else {
$uuidAttributes = Access::UUID_ATTRIBUTES;
array_unshift($uuidAttributes, 'auto');
- if (!in_array($this->configuration->$effectiveSetting,
- $uuidAttributes)
- && (!is_null($this->configID))) {
+ if (!in_array($this->configuration->$effectiveSetting, $uuidAttributes)
+ && !is_null($this->configID)) {
$this->configuration->$effectiveSetting = 'auto';
$this->configuration->saveConfiguration();
$this->logger->info(
@@ -606,12 +605,18 @@ class Connection extends LDAPUtility {
if (!$isBackupHost) {
throw $e;
}
+ $this->logger->warning(
+ 'Main LDAP not reachable, connecting to backup',
+ [
+ 'app' => 'user_ldap'
+ ]
+ );
}
//if LDAP server is not reachable, try the Backup (Replica!) Server
if ($isBackupHost || $isOverrideMainServer) {
$this->doConnect($this->configuration->ldapBackupHost,
- $this->configuration->ldapBackupPort);
+ $this->configuration->ldapBackupPort);
$this->bindResult = [];
$bindStatus = $this->bind();
$error = $this->ldap->isResource($this->ldapConnectionRes) ?
@@ -681,8 +686,8 @@ class Connection extends LDAPUtility {
}
$ldapLogin = @$this->ldap->bind($cr,
- $this->configuration->ldapAgentName,
- $this->configuration->ldapAgentPassword);
+ $this->configuration->ldapAgentName,
+ $this->configuration->ldapAgentPassword);
$this->bindResult = [
'sum' => md5($this->configuration->ldapAgentName . $this->configPrefix . $this->configuration->ldapAgentPassword),