Exposed ldap got renamed to user directory
This commit is contained in:
+4
-4
@@ -867,8 +867,8 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Client.prototype.setExposedLdapConfig = function (config, callback) {
|
Client.prototype.setUserDirectoryConfig = function (config, callback) {
|
||||||
post('/api/v1/settings/exposed_ldap_config', config, null, function (error, data, status) {
|
post('/api/v1/settings/user_directory_config', config, null, function (error, data, status) {
|
||||||
if (error) return callback(error);
|
if (error) return callback(error);
|
||||||
if (status !== 200) return callback(new ClientError(status, data));
|
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) {
|
Client.prototype.getUserDirectoryConfig = function (callback) {
|
||||||
get('/api/v1/settings/exposed_ldap_config', null, function (error, data, status) {
|
get('/api/v1/settings/user_directory_config', null, function (error, data, status) {
|
||||||
if (error) return callback(error);
|
if (error) return callback(error);
|
||||||
if (status !== 200) return callback(new ClientError(status, data));
|
if (status !== 200) return callback(new ClientError(status, data));
|
||||||
|
|
||||||
|
|||||||
@@ -877,18 +877,18 @@
|
|||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<form name="exposedLdapConfigForm" role="form" novalidate ng-submit="exposedLdapConfig.submit()" autocomplete="off">
|
<form name="userDirectoryConfigForm" role="form" novalidate ng-submit="userDirectoryConfig.submit()" autocomplete="off">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" ng-model="exposedLdapConfig.enabled" ng-disabled="exposedLdapConfig.busy"> {{ 'users.exposedLdap.enabled' | tr }} <sup><a ng-href="https://docs.cloudron.io/user-management/#exposed-ldap" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup>
|
<input type="checkbox" ng-model="userDirectoryConfig.enabled" ng-disabled="userDirectoryConfig.busy"> {{ 'users.exposedLdap.enabled' | tr }} <sup><a ng-href="https://docs.cloudron.io/user-management/#exposed-ldap" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label">{{ 'users.exposedLdap.ipRestriction.label' | tr }}</label>
|
<label class="control-label">{{ 'users.exposedLdap.ipRestriction.label' | tr }}</label>
|
||||||
<p class="small">{{ 'users.exposedLdap.ipRestriction.description' | tr }}</p>
|
<p class="small">{{ 'users.exposedLdap.ipRestriction.description' | tr }}</p>
|
||||||
<textarea ng-model="exposedLdapConfig.allowlist" ng-disabled="!exposedLdapConfig.enabled || exposedLdapConfig.busy" placeholder="{{ 'users.exposedLdap.ipRestriction.placeholder' | tr }}" name="allowlist" class="form-control" ng-class="{ 'has-error': !exposedLdapConfigForm.allowlist.$dirty && exposedLdapConfig.error.allowlist }" rows="4"></textarea>
|
<textarea ng-model="userDirectoryConfig.allowlist" ng-disabled="!userDirectoryConfig.enabled || userDirectoryConfig.busy" placeholder="{{ 'users.exposedLdap.ipRestriction.placeholder' | tr }}" name="allowlist" class="form-control" ng-class="{ 'has-error': !userDirectoryConfigForm.allowlist.$dirty && userDirectoryConfig.error.allowlist }" rows="4"></textarea>
|
||||||
<div class="has-error" ng-show="exposedLdapConfig.error.allowlist">{{ exposedLdapConfig.error.allowlist }}</div>
|
<div class="has-error" ng-show="userDirectoryConfig.error.allowlist">{{ userDirectoryConfig.error.allowlist }}</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
@@ -896,10 +896,10 @@
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<span class="has-error" ng-show="exposedLdapConfig.error.generic">{{ exposedLdapConfig.error.generic }}</span>
|
<span class="has-error" ng-show="userDirectoryConfig.error.generic">{{ userDirectoryConfig.error.generic }}</span>
|
||||||
|
|
||||||
<button class="btn btn-outline btn-primary pull-right" ng-click="exposedLdapConfig.submit()" ng-disabled="!exposedLdapConfigForm.$dirty || exposedLdapConfig.busy">
|
<button class="btn btn-outline btn-primary pull-right" ng-click="userDirectoryConfig.submit()" ng-disabled="!userDirectoryConfigForm.$dirty || userDirectoryConfig.busy">
|
||||||
<i class="fa fa-circle-notch fa-spin" ng-show="exposedLdapConfig.busy"></i> {{ 'users.settings.saveAction' | tr }}
|
<i class="fa fa-circle-notch fa-spin" ng-show="userDirectoryConfig.busy"></i> {{ 'users.settings.saveAction' | tr }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+17
-17
@@ -689,40 +689,40 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.exposedLdapConfig = {
|
$scope.userDirectoryConfig = {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
allowlist: '',
|
allowlist: '',
|
||||||
error: null,
|
error: null,
|
||||||
|
|
||||||
refresh: function () {
|
refresh: function () {
|
||||||
Client.getExposedLdapConfig(function (error, result) {
|
Client.getUserDirectoryConfig(function (error, result) {
|
||||||
if (error) return console.error('Unable to get exposed ldap config.', error);
|
if (error) return console.error('Unable to get exposed ldap config.', error);
|
||||||
|
|
||||||
$scope.exposedLdapConfig.enabled = !!result.enabled;
|
$scope.userDirectoryConfig.enabled = !!result.enabled;
|
||||||
$scope.exposedLdapConfig.allowlist = result.allowlist;
|
$scope.userDirectoryConfig.allowlist = result.allowlist;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
submit: function () {
|
submit: function () {
|
||||||
$scope.exposedLdapConfig.error = null;
|
$scope.userDirectoryConfig.error = null;
|
||||||
$scope.exposedLdapConfig.busy = true;
|
$scope.userDirectoryConfig.busy = true;
|
||||||
$scope.exposedLdapConfig.success = false;
|
$scope.userDirectoryConfig.success = false;
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
enabled: $scope.exposedLdapConfig.enabled,
|
enabled: $scope.userDirectoryConfig.enabled,
|
||||||
allowlist: $scope.exposedLdapConfig.allowlist
|
allowlist: $scope.userDirectoryConfig.allowlist
|
||||||
};
|
};
|
||||||
|
|
||||||
Client.setExposedLdapConfig(data, function (error) {
|
Client.setUserDirectoryConfig(data, function (error) {
|
||||||
$scope.exposedLdapConfig.busy = false;
|
$scope.userDirectoryConfig.busy = false;
|
||||||
|
|
||||||
if (error && error.statusCode === 400) return $scope.exposedLdapConfig.error = { allowlist: error.message };
|
if (error && error.statusCode === 400) return $scope.userDirectoryConfig.error = { allowlist: error.message };
|
||||||
if (error) return $scope.exposedLdapConfig.error = { generic: error.message };
|
if (error) return $scope.userDirectoryConfig.error = { generic: error.message };
|
||||||
|
|
||||||
$scope.exposedLdapConfigForm.$setUntouched();
|
$scope.userDirectoryConfigForm.$setUntouched();
|
||||||
$scope.exposedLdapConfigForm.$setPristine();
|
$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(refresh);
|
||||||
Client.onReady(function () { if ($scope.user.isAtLeastAdmin) loadExternalLdapConfig(); });
|
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.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(refreshAllUsers);
|
||||||
Client.onReady(function () {
|
Client.onReady(function () {
|
||||||
// Order matters for permissions used in canEdit
|
// Order matters for permissions used in canEdit
|
||||||
|
|||||||
Reference in New Issue
Block a user