From 9a42d4c5067068f99465c34ef206c97bed9d2e87 Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Tue, 15 Mar 2022 07:13:39 +0200 Subject: [PATCH] fix(auth/ldap): show server url [EE-2069] (#6651) --- .../settingsAuthenticationController.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/portainer/views/settings/authentication/settingsAuthenticationController.js b/app/portainer/views/settings/authentication/settingsAuthenticationController.js index 23841e245..922be3c52 100644 --- a/app/portainer/views/settings/authentication/settingsAuthenticationController.js +++ b/app/portainer/views/settings/authentication/settingsAuthenticationController.js @@ -222,13 +222,6 @@ function SettingsAuthenticationController($q, $scope, $state, Notifications, Set $scope.authMethod = 4; } - $scope.formValues.ldap.serverType = settings.LDAPSettings.ServerType; - if (settings.LDAPSettings.ServerType === 2) { - $scope.formValues.ldap.adSettings = settings.LDAPSettings; - } else { - $scope.formValues.ldap.ldapSettings = Object.assign($scope.formValues.ldap.ldapSettings, settings.LDAPSettings); - } - if (settings.LDAPSettings.URL) { settings.LDAPSettings.URLs = [settings.LDAPSettings.URL]; } @@ -241,6 +234,13 @@ function SettingsAuthenticationController($q, $scope, $state, Notifications, Set if (!settings.LDAPSettings.ServerType) { settings.LDAPSettings.ServerType = 0; } + + $scope.formValues.ldap.serverType = settings.LDAPSettings.ServerType; + if (settings.LDAPSettings.ServerType === 2) { + $scope.formValues.ldap.adSettings = settings.LDAPSettings; + } else { + $scope.formValues.ldap.ldapSettings = Object.assign($scope.formValues.ldap.ldapSettings, settings.LDAPSettings); + } }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve application settings');