diff --git a/src/js/client.js b/src/js/client.js
index 16a16cb90..4a2dadead 100644
--- a/src/js/client.js
+++ b/src/js/client.js
@@ -1943,6 +1943,15 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
}
};
+ Client.prototype.makeUserLocal = function (userId, callback) {
+ post('/api/v1/users/' + userId + '/make_local', {}, null, function (error, data, status) {
+ if (error) return callback(error);
+ if (status !== 204) return callback(new ClientError(status, data));
+
+ callback(null);
+ });
+ };
+
Client.prototype.changePassword = function (currentPassword, newPassword, callback) {
var data = {
password: currentPassword,
diff --git a/src/views/users.html b/src/views/users.html
index 2e73d75f1..a50d8b47a 100644
--- a/src/views/users.html
+++ b/src/views/users.html
@@ -34,6 +34,25 @@
+
+
+
+
+
+
+
This will migrate the user from the external directory to the Cloudron.
+
A password reset will be initiated to set a local password for this user.
+
+
+
+
+
+
@@ -661,8 +680,9 @@
-
-
+
+
+
diff --git a/src/views/users.js b/src/views/users.js
index 300eb350b..bcc729ce7 100644
--- a/src/views/users.js
+++ b/src/views/users.js
@@ -773,6 +773,32 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
}
};
+ $scope.makeLocal = {
+ busy: false,
+ user: null,
+
+ show: function (user) {
+ $scope.makeLocal.busy = false;
+ $scope.makeLocal.user = user;
+
+ $('#makeLocalModal').modal('show');
+ },
+
+ submit: function () {
+ $scope.makeLocal.busy = false;
+
+ Client.makeUserLocal($scope.makeLocal.user.id, function (error) {
+ if (error) return console.error('Failed to make user local.', error);
+
+ $scope.makeLocal.busy = false;
+
+ refreshUsers();
+
+ $('#makeLocalModal').modal('hide');
+ });
+ }
+ };
+
$scope.invitation = {
busy: false,
inviteLink: '',
|