account setup: Make fields readonly when profile is locked

part of cloudron/box#704
This commit is contained in:
Girish Ramakrishnan
2020-07-09 15:36:46 -07:00
parent d2ece2b7f9
commit 50b528260c
2 changed files with 9 additions and 9 deletions

View File

@@ -35,6 +35,7 @@ app.controller('SetupAccountController', ['$scope', '$http', function ($scope, $
$scope.view = 'setup';
$scope.status = null;
$scope.profileLocked = !!search.profileLocked;
$scope.existingUsername = !!search.username;
$scope.username = search.username || '';
$scope.displayName = search.displayName || '';
@@ -47,11 +48,14 @@ app.controller('SetupAccountController', ['$scope', '$http', function ($scope, $
var data = {
resetToken: search.resetToken,
username: $scope.username,
displayName: $scope.displayName,
password: $scope.password
};
if (!$scope.profileLocked) {
data.username = $scope.username;
data.displayName = $scope.displayName;
}
function error(data, status) {
$scope.busy = false;