Only allow email to be enabled if a real dns provider is setup

This commit is contained in:
Johannes
2016-10-25 16:31:22 +02:00
parent fc09cf2205
commit 25243970ad
2 changed files with 13 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.user = Client.getUserInfo();
$scope.config = Client.getConfig();
$scope.backupConfig = {};
$scope.dnsConfig = {};
$scope.appstoreConfig = {};
$scope.mailConfig = null;
@@ -364,6 +365,14 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
});
}
function getDnsConfig() {
Client.getDnsConfig(function (error, dnsConfig) {
if (error) return console.error(error);
$scope.dnsConfig = dnsConfig;
});
}
$scope.toggleEmail = function () {
Client.setMailConfig({ enabled: !$scope.mailConfig.enabled }, function (error) {
if (error) return console.error(error);
@@ -469,6 +478,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
fetchBackups();
getMailConfig();
getBackupConfig();
getDnsConfig();
if ($scope.config.provider === 'caas') {
getPlans();