mirror of https://github.com/portainer/portainer
feat(authentication-settings): add default port when not set in url (#1456)
parent
406757d751
commit
d8f6b14726
|
@ -32,6 +32,7 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
|
||||||
$scope.state.connectivityCheckInProgress = true;
|
$scope.state.connectivityCheckInProgress = true;
|
||||||
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
|
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
|
addLDAPDefaultPort(settings, $scope.LDAPSettings.TLSConfig.TLS);
|
||||||
return SettingsService.checkLDAPConnectivity(settings);
|
return SettingsService.checkLDAPConnectivity(settings);
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
|
@ -60,6 +61,7 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
|
$q.when(!uploadRequired || FileUploadService.uploadLDAPTLSFiles(TLSCAFile, null, null))
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
|
addLDAPDefaultPort(settings, $scope.LDAPSettings.TLSConfig.TLS);
|
||||||
return SettingsService.update(settings);
|
return SettingsService.update(settings);
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
|
@ -74,6 +76,13 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Add default port if :port is not defined in URL
|
||||||
|
function addLDAPDefaultPort(settings, tlsEnabled) {
|
||||||
|
if (settings.LDAPSettings.URL.indexOf(':') === -1) {
|
||||||
|
settings.LDAPSettings.URL += tlsEnabled ? ':636' : ':389';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function initView() {
|
function initView() {
|
||||||
SettingsService.settings()
|
SettingsService.settings()
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
|
|
Loading…
Reference in New Issue