diff --git a/src/js/client.js b/src/js/client.js index b30651d78..694221ad5 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -1379,6 +1379,15 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N }); }; + Client.prototype.startExternalLdapSync = function (callback) { + post('/api/v1/cloudron/sync_external_ldap', {}, null, function (error, data, status) { + if (error) return callback(error); + if (status !== 202) return callback(new ClientError(status, data)); + + callback(null); + }); + }; + Client.prototype.setUserActive = function (userId, active, callback) { var data = { active: active diff --git a/src/views/users.html b/src/views/users.html index 479720e3b..dffe61a35 100644 --- a/src/views/users.html +++ b/src/views/users.html @@ -402,6 +402,7 @@

This option allows to use an external LDAP or ActiveDirectory service for user management. +

diff --git a/src/views/users.js b/src/views/users.js index 89d4ee5f9..e9b736f17 100644 --- a/src/views/users.js +++ b/src/views/users.js @@ -417,6 +417,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio busy: false, error: {}, success: false, + syncBusy: false, // fields enabled: false, @@ -426,6 +427,18 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio bindDn: '', bindPassword: '', + sync: function () { + $scope.externalLdap.syncBusy = true; + Client.startExternalLdapSync(function (error, result) { + if (error) { + $scope.externalLdap.syncBusy = false; + console.error('Unable to start ldap syncer task.', error); + } else { + console.log(result); + } + }) + }, + submit: function () { $scope.externalLdap.busy = true; $scope.externalLdap.error = {};