From 8bb4e947a02e44fa13ab7a9058d5a15806869b8f Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 7 Jan 2022 14:22:07 +0100 Subject: [PATCH] Exposed ldap got renamed to user directory --- src/js/client.js | 8 ++++---- src/views/users.html | 14 +++++++------- src/views/users.js | 34 +++++++++++++++++----------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/js/client.js b/src/js/client.js index 1c46b50de..e9f1e6e34 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -867,8 +867,8 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }); }; - Client.prototype.setExposedLdapConfig = function (config, callback) { - post('/api/v1/settings/exposed_ldap_config', config, null, function (error, data, status) { + Client.prototype.setUserDirectoryConfig = function (config, callback) { + post('/api/v1/settings/user_directory_config', config, null, function (error, data, status) { if (error) return callback(error); if (status !== 200) return callback(new ClientError(status, data)); @@ -876,8 +876,8 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }); }; - Client.prototype.getExposedLdapConfig = function (callback) { - get('/api/v1/settings/exposed_ldap_config', null, function (error, data, status) { + Client.prototype.getUserDirectoryConfig = function (callback) { + get('/api/v1/settings/user_directory_config', null, function (error, data, status) { if (error) return callback(error); if (status !== 200) return callback(new ClientError(status, data)); diff --git a/src/views/users.html b/src/views/users.html index 664ce0f6b..25f8bf6b6 100644 --- a/src/views/users.html +++ b/src/views/users.html @@ -877,18 +877,18 @@
-
+

{{ 'users.exposedLdap.ipRestriction.description' | tr }}

- -
{{ exposedLdapConfig.error.allowlist }}
+ +
{{ userDirectoryConfig.error.allowlist }}
@@ -896,10 +896,10 @@
- {{ exposedLdapConfig.error.generic }} + {{ userDirectoryConfig.error.generic }} -
diff --git a/src/views/users.js b/src/views/users.js index ac568e3c4..d3651fefe 100644 --- a/src/views/users.js +++ b/src/views/users.js @@ -689,40 +689,40 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio } }; - $scope.exposedLdapConfig = { + $scope.userDirectoryConfig = { enabled: false, allowlist: '', error: null, refresh: function () { - Client.getExposedLdapConfig(function (error, result) { + Client.getUserDirectoryConfig(function (error, result) { if (error) return console.error('Unable to get exposed ldap config.', error); - $scope.exposedLdapConfig.enabled = !!result.enabled; - $scope.exposedLdapConfig.allowlist = result.allowlist; + $scope.userDirectoryConfig.enabled = !!result.enabled; + $scope.userDirectoryConfig.allowlist = result.allowlist; }); }, submit: function () { - $scope.exposedLdapConfig.error = null; - $scope.exposedLdapConfig.busy = true; - $scope.exposedLdapConfig.success = false; + $scope.userDirectoryConfig.error = null; + $scope.userDirectoryConfig.busy = true; + $scope.userDirectoryConfig.success = false; var data = { - enabled: $scope.exposedLdapConfig.enabled, - allowlist: $scope.exposedLdapConfig.allowlist + enabled: $scope.userDirectoryConfig.enabled, + allowlist: $scope.userDirectoryConfig.allowlist }; - Client.setExposedLdapConfig(data, function (error) { - $scope.exposedLdapConfig.busy = false; + Client.setUserDirectoryConfig(data, function (error) { + $scope.userDirectoryConfig.busy = false; - if (error && error.statusCode === 400) return $scope.exposedLdapConfig.error = { allowlist: error.message }; - if (error) return $scope.exposedLdapConfig.error = { generic: error.message }; + if (error && error.statusCode === 400) return $scope.userDirectoryConfig.error = { allowlist: error.message }; + if (error) return $scope.userDirectoryConfig.error = { generic: error.message }; - $scope.exposedLdapConfigForm.$setUntouched(); - $scope.exposedLdapConfigForm.$setPristine(); + $scope.userDirectoryConfigForm.$setUntouched(); + $scope.userDirectoryConfigForm.$setPristine(); - $scope.exposedLdapConfig.success = true; + $scope.userDirectoryConfig.success = true; }); } }; @@ -965,7 +965,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio Client.onReady(refresh); Client.onReady(function () { if ($scope.user.isAtLeastAdmin) loadExternalLdapConfig(); }); Client.onReady(function () { if ($scope.user.isAtLeastAdmin) $scope.directoryConfig.refresh(); }); - Client.onReady(function () { if ($scope.user.isAtLeastAdmin) $scope.exposedLdapConfig.refresh(); }); + Client.onReady(function () { if ($scope.user.isAtLeastAdmin) $scope.userDirectoryConfig.refresh(); }); Client.onReady(refreshAllUsers); Client.onReady(function () { // Order matters for permissions used in canEdit