Remove email domain logic from users view
This commit is contained in:
@@ -12,7 +12,6 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
|||||||
$scope.groupsById = { };
|
$scope.groupsById = { };
|
||||||
$scope.config = Client.getConfig();
|
$scope.config = Client.getConfig();
|
||||||
$scope.userInfo = Client.getUserInfo();
|
$scope.userInfo = Client.getUserInfo();
|
||||||
$scope.emailDomains = [];
|
|
||||||
|
|
||||||
$scope.userremove = {
|
$scope.userremove = {
|
||||||
busy: false,
|
busy: false,
|
||||||
@@ -147,9 +146,6 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
|||||||
email: '',
|
email: '',
|
||||||
fallbackEmail: '',
|
fallbackEmail: '',
|
||||||
aliases: {},
|
aliases: {},
|
||||||
selectedEmailDomains: [],
|
|
||||||
currentEmailDomains: [],
|
|
||||||
availableEmailDomains: [],
|
|
||||||
superuser: false,
|
superuser: false,
|
||||||
|
|
||||||
show: function (userInfo) {
|
show: function (userInfo) {
|
||||||
@@ -367,29 +363,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
|||||||
|
|
||||||
$scope.users = result;
|
$scope.users = result;
|
||||||
|
|
||||||
Client.getDomains(function (error, result) {
|
$scope.ready = true;
|
||||||
if (error) return console.error('Unable to get domain listing.', error);
|
|
||||||
|
|
||||||
// reset so we can push the fresh config
|
|
||||||
$scope.emailDomains = [];
|
|
||||||
|
|
||||||
asyncForEach(result, function (domain, callback) {
|
|
||||||
Client.getMailConfigForDomain(domain.domain, function (error, mailConfig) {
|
|
||||||
if (error) return callback(error);
|
|
||||||
|
|
||||||
domain.mailConfig = mailConfig;
|
|
||||||
|
|
||||||
// only collect domains where email is enabled
|
|
||||||
if (mailConfig.enabled) $scope.emailDomains.push(domain);
|
|
||||||
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}, function (error) {
|
|
||||||
if (error) return console.error('Unable to get mail config for domains.', error);
|
|
||||||
|
|
||||||
$scope.ready = true;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user