Browse Source
Merge pull request #35230 from nextcloud/fix/user_ldap-log-backup-switch
Log switching to LDAP backup host because main one is not available
pull/35345/head
Côme Chilliet
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
12 additions and
7 deletions
-
apps/user_ldap/lib/Connection.php
|
|
|
@ -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,6 +605,12 @@ 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
|
|
|
|
|