mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 14:26:16 +01:00
bug fix: mailscanner install
This commit is contained in:
@@ -39,14 +39,13 @@ app.controller('listDomains', function($scope,$http) {
|
||||
|
||||
$scope.WebSitesList = JSON.parse(response.data.data);
|
||||
$scope.listFail = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.listFail = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -84,14 +83,13 @@ app.controller('listDomains', function($scope,$http) {
|
||||
|
||||
$scope.getFurtherWebsitesFromDB(globalPageNumber);
|
||||
$scope.listFail = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.listFail = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -144,14 +142,13 @@ app.controller('emailDomainPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
$scope.emailList = JSON.parse(response.data.data);
|
||||
$scope.listFail = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.listFail = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -187,15 +184,20 @@ app.controller('emailDomainPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
} else {
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -248,10 +250,10 @@ app.controller('emailDomainPage', function($scope,$http, $timeout, $window) {
|
||||
$scope.changeLimitsFail = true;
|
||||
$scope.changeLimitsSuccess = false;
|
||||
$scope.couldNotConnect = true;
|
||||
$timeout(function() { $window.location.reload(); }, 3000);
|
||||
}
|
||||
else
|
||||
{
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 3000);
|
||||
} else {
|
||||
$scope.changeLimitsForm = false;
|
||||
$scope.changeLimitsFail = false;
|
||||
$scope.changeLimitsSuccess = true;
|
||||
@@ -260,6 +262,7 @@ app.controller('emailDomainPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.changeLimitsForm = false;
|
||||
@@ -296,12 +299,11 @@ app.controller('emailDomainPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
$scope.getFurtherEmailsFromDB(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.getFurtherEmailsFromDB(1);
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.getFurtherEmailsFromDB(1);
|
||||
}
|
||||
@@ -373,14 +375,13 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
$scope.loggingOff = false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -416,12 +417,11 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
@@ -452,12 +452,11 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
@@ -490,15 +489,20 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
} else {
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -553,9 +557,7 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.getEmailStats();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.changeLimitsForm = false;
|
||||
$scope.changeLimitsFail = false;
|
||||
$scope.changeLimitsSuccess = true;
|
||||
@@ -564,6 +566,7 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.changeLimitsForm = false;
|
||||
@@ -604,14 +607,13 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
$scope.logs = JSON.parse(response.data.data);
|
||||
$scope.listFail = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.listFail = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -648,14 +650,13 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
if (response.data.status === 1) {
|
||||
$scope.getLogEntries(1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.listFail = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -681,7 +682,6 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
$scope.installationFailed = true;
|
||||
|
||||
|
||||
|
||||
$scope.installSpamAssassin = function () {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = true;
|
||||
@@ -703,7 +703,6 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -722,8 +721,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
|
||||
getRequestStatus();
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -735,6 +733,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -769,7 +768,6 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -788,8 +786,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
|
||||
$scope.requestData = response.data.requestStatus;
|
||||
$timeout(getRequestStatus, 1000);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
// Notifications
|
||||
$timeout.cancel();
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -805,12 +802,15 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
} else {
|
||||
$scope.SpamAssassinSuccessfullyInstalled = false;
|
||||
$timeout(function() { $window.location.reload(); }, 3000);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -836,6 +836,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
});
|
||||
|
||||
fetchSpamAssassinSettings();
|
||||
|
||||
function fetchSpamAssassinSettings() {
|
||||
|
||||
$scope.SpamAssassinLoading = false;
|
||||
@@ -853,7 +854,6 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -878,6 +878,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.SpamAssassinLoading = true;
|
||||
}
|
||||
@@ -916,7 +917,6 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -930,8 +930,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
$scope.SpamAssassinLoading = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
$scope.failedToSave = false;
|
||||
@@ -941,6 +940,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.failedToSave = true;
|
||||
$scope.successfullySaved = false;
|
||||
@@ -975,6 +975,7 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
});
|
||||
|
||||
fetchPolicServerStatus();
|
||||
|
||||
function fetchPolicServerStatus() {
|
||||
|
||||
$scope.policyServerLoading = false;
|
||||
@@ -992,7 +993,6 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1016,6 +1016,7 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.policyServerLoading = true;
|
||||
$scope.failedToFetch = true;
|
||||
@@ -1034,7 +1035,6 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
$scope.changesApplied = true;
|
||||
|
||||
|
||||
|
||||
url = "/emailPremium/savePolicyServerStatus";
|
||||
|
||||
var data = {
|
||||
@@ -1048,7 +1048,6 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1061,8 +1060,7 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.changesApplied = false;
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
$scope.failedToFetch = false;
|
||||
@@ -1071,6 +1069,7 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.policyServerLoading = true;
|
||||
$scope.failedToFetch = true;
|
||||
@@ -1248,8 +1247,7 @@ app.controller('mailQueue', function($scope,$http) {
|
||||
}
|
||||
};
|
||||
|
||||
var data = {
|
||||
};
|
||||
var data = {};
|
||||
|
||||
dataurl = "/emailPremium/flushQueue";
|
||||
|
||||
@@ -1300,7 +1298,6 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
$scope.installationFailed = true;
|
||||
|
||||
|
||||
|
||||
$scope.installSpamAssassin = function () {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = true;
|
||||
@@ -1322,7 +1319,6 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1341,8 +1337,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
|
||||
getRequestStatus();
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -1354,6 +1349,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -1377,7 +1373,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
$scope.SpamAssassinSuccessfullyInstalled = true;
|
||||
$scope.installationFailed = true;
|
||||
|
||||
url = "/emailPremium/installStatusSpamAssassin";
|
||||
url = "/emailPremium/installStatusMailScanner";
|
||||
|
||||
var data = {};
|
||||
|
||||
@@ -1388,7 +1384,6 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1407,8 +1402,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
|
||||
$scope.requestData = response.data.requestStatus;
|
||||
$timeout(getRequestStatus, 1000);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
// Notifications
|
||||
$timeout.cancel();
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -1424,12 +1418,15 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
} else {
|
||||
$scope.SpamAssassinSuccessfullyInstalled = false;
|
||||
$timeout(function() { $window.location.reload(); }, 3000);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -1455,6 +1452,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
});
|
||||
|
||||
fetchSpamAssassinSettings();
|
||||
|
||||
function fetchSpamAssassinSettings() {
|
||||
|
||||
$scope.SpamAssassinLoading = false;
|
||||
@@ -1472,7 +1470,6 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1497,6 +1494,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.SpamAssassinLoading = true;
|
||||
}
|
||||
@@ -1535,7 +1533,6 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1549,8 +1546,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
$scope.SpamAssassinLoading = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
$scope.failedToSave = false;
|
||||
@@ -1560,6 +1556,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.failedToSave = true;
|
||||
$scope.successfullySaved = false;
|
||||
|
||||
@@ -1190,7 +1190,6 @@ def MailScanner(request):
|
||||
if mailUtilities.checkIfMailScannerInstalled() == 1:
|
||||
checkIfMailScannerInstalled = 1
|
||||
|
||||
|
||||
return render(request, 'emailPremium/MailScanner.html',{'checkIfMailScannerInstalled': checkIfMailScannerInstalled, 'ipAddress': ipAddress})
|
||||
|
||||
except KeyError:
|
||||
@@ -1221,3 +1220,57 @@ def installMailScanner(request):
|
||||
final_dic = {'status': 0, 'error_message': "Not Logged In, please refresh the page or login again."}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def installStatusMailScanner(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
if currentACL['admin'] == 1:
|
||||
pass
|
||||
else:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
try:
|
||||
if request.method == 'POST':
|
||||
|
||||
command = "sudo cat " + mailUtilities.spamassassinInstallLogPath
|
||||
installStatus = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
if installStatus.find("[200]")>-1:
|
||||
|
||||
final_json = json.dumps({
|
||||
'error_message': "None",
|
||||
'requestStatus': installStatus,
|
||||
'abort': 1,
|
||||
'installed': 1,
|
||||
})
|
||||
return HttpResponse(final_json)
|
||||
|
||||
elif installStatus.find("[404]") > -1:
|
||||
|
||||
final_json = json.dumps({
|
||||
'abort':1,
|
||||
'installed':0,
|
||||
'error_message': "None",
|
||||
'requestStatus': installStatus,
|
||||
})
|
||||
return HttpResponse(final_json)
|
||||
|
||||
else:
|
||||
final_json = json.dumps({
|
||||
'abort':0,
|
||||
'error_message': "None",
|
||||
'requestStatus': installStatus,
|
||||
})
|
||||
return HttpResponse(final_json)
|
||||
|
||||
|
||||
except BaseException as msg:
|
||||
final_dic = {'abort':1,'installed':0, 'error_message': str(msg)}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
except KeyError:
|
||||
final_dic = {'abort':1,'installed':0, 'error_message': "Not Logged In, please refresh the page or login again."}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
@@ -39,14 +39,13 @@ app.controller('listDomains', function($scope,$http) {
|
||||
|
||||
$scope.WebSitesList = JSON.parse(response.data.data);
|
||||
$scope.listFail = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.listFail = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -84,14 +83,13 @@ app.controller('listDomains', function($scope,$http) {
|
||||
|
||||
$scope.getFurtherWebsitesFromDB(globalPageNumber);
|
||||
$scope.listFail = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.listFail = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -144,14 +142,13 @@ app.controller('emailDomainPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
$scope.emailList = JSON.parse(response.data.data);
|
||||
$scope.listFail = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.listFail = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -187,15 +184,20 @@ app.controller('emailDomainPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
} else {
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -248,10 +250,10 @@ app.controller('emailDomainPage', function($scope,$http, $timeout, $window) {
|
||||
$scope.changeLimitsFail = true;
|
||||
$scope.changeLimitsSuccess = false;
|
||||
$scope.couldNotConnect = true;
|
||||
$timeout(function() { $window.location.reload(); }, 3000);
|
||||
}
|
||||
else
|
||||
{
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 3000);
|
||||
} else {
|
||||
$scope.changeLimitsForm = false;
|
||||
$scope.changeLimitsFail = false;
|
||||
$scope.changeLimitsSuccess = true;
|
||||
@@ -260,6 +262,7 @@ app.controller('emailDomainPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.changeLimitsForm = false;
|
||||
@@ -296,12 +299,11 @@ app.controller('emailDomainPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
$scope.getFurtherEmailsFromDB(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.getFurtherEmailsFromDB(1);
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.getFurtherEmailsFromDB(1);
|
||||
}
|
||||
@@ -373,14 +375,13 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
$scope.loggingOff = false;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -416,12 +417,11 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
@@ -452,12 +452,11 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.getEmailStats();
|
||||
}
|
||||
@@ -490,15 +489,20 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
if (response.data.status === 1) {
|
||||
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
} else {
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$timeout(function() { $window.location.reload(); }, 0);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -553,9 +557,7 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.getEmailStats();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.changeLimitsForm = false;
|
||||
$scope.changeLimitsFail = false;
|
||||
$scope.changeLimitsSuccess = true;
|
||||
@@ -564,6 +566,7 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.changeLimitsForm = false;
|
||||
@@ -604,14 +607,13 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
|
||||
$scope.logs = JSON.parse(response.data.data);
|
||||
$scope.listFail = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.listFail = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -648,14 +650,13 @@ app.controller('emailPage', function($scope,$http, $timeout, $window) {
|
||||
if (response.data.status === 1) {
|
||||
$scope.getLogEntries(1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.listFail = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.emailLimitsLoading = true;
|
||||
$scope.listFail = false;
|
||||
@@ -681,7 +682,6 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
$scope.installationFailed = true;
|
||||
|
||||
|
||||
|
||||
$scope.installSpamAssassin = function () {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = true;
|
||||
@@ -703,7 +703,6 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -722,8 +721,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
|
||||
getRequestStatus();
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -735,6 +733,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -769,7 +768,6 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -788,8 +786,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
|
||||
$scope.requestData = response.data.requestStatus;
|
||||
$timeout(getRequestStatus, 1000);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
// Notifications
|
||||
$timeout.cancel();
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -805,12 +802,15 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
} else {
|
||||
$scope.SpamAssassinSuccessfullyInstalled = false;
|
||||
$timeout(function() { $window.location.reload(); }, 3000);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -836,6 +836,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
});
|
||||
|
||||
fetchSpamAssassinSettings();
|
||||
|
||||
function fetchSpamAssassinSettings() {
|
||||
|
||||
$scope.SpamAssassinLoading = false;
|
||||
@@ -853,7 +854,6 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -878,6 +878,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.SpamAssassinLoading = true;
|
||||
}
|
||||
@@ -916,7 +917,6 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -930,8 +930,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
$scope.SpamAssassinLoading = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
$scope.failedToSave = false;
|
||||
@@ -941,6 +940,7 @@ app.controller('SpamAssassin', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.failedToSave = true;
|
||||
$scope.successfullySaved = false;
|
||||
@@ -975,6 +975,7 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
});
|
||||
|
||||
fetchPolicServerStatus();
|
||||
|
||||
function fetchPolicServerStatus() {
|
||||
|
||||
$scope.policyServerLoading = false;
|
||||
@@ -992,7 +993,6 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1016,6 +1016,7 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.policyServerLoading = true;
|
||||
$scope.failedToFetch = true;
|
||||
@@ -1034,7 +1035,6 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
$scope.changesApplied = true;
|
||||
|
||||
|
||||
|
||||
url = "/emailPremium/savePolicyServerStatus";
|
||||
|
||||
var data = {
|
||||
@@ -1048,7 +1048,6 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1061,8 +1060,7 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.changesApplied = false;
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
$scope.failedToFetch = false;
|
||||
@@ -1071,6 +1069,7 @@ app.controller('policyServer', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.policyServerLoading = true;
|
||||
$scope.failedToFetch = true;
|
||||
@@ -1248,8 +1247,7 @@ app.controller('mailQueue', function($scope,$http) {
|
||||
}
|
||||
};
|
||||
|
||||
var data = {
|
||||
};
|
||||
var data = {};
|
||||
|
||||
dataurl = "/emailPremium/flushQueue";
|
||||
|
||||
@@ -1300,7 +1298,6 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
$scope.installationFailed = true;
|
||||
|
||||
|
||||
|
||||
$scope.installSpamAssassin = function () {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = true;
|
||||
@@ -1322,7 +1319,6 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1341,8 +1337,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
|
||||
getRequestStatus();
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -1354,6 +1349,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -1377,7 +1373,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
$scope.SpamAssassinSuccessfullyInstalled = true;
|
||||
$scope.installationFailed = true;
|
||||
|
||||
url = "/emailPremium/installStatusSpamAssassin";
|
||||
url = "/emailPremium/installStatusMailScanner";
|
||||
|
||||
var data = {};
|
||||
|
||||
@@ -1388,7 +1384,6 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1407,8 +1402,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
|
||||
$scope.requestData = response.data.requestStatus;
|
||||
$timeout(getRequestStatus, 1000);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
// Notifications
|
||||
$timeout.cancel();
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -1424,12 +1418,15 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
} else {
|
||||
$scope.SpamAssassinSuccessfullyInstalled = false;
|
||||
$timeout(function() { $window.location.reload(); }, 3000);
|
||||
$timeout(function () {
|
||||
$window.location.reload();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.SpamAssassinNotifyBox = false;
|
||||
@@ -1455,6 +1452,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
});
|
||||
|
||||
fetchSpamAssassinSettings();
|
||||
|
||||
function fetchSpamAssassinSettings() {
|
||||
|
||||
$scope.SpamAssassinLoading = false;
|
||||
@@ -1472,7 +1470,6 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1497,6 +1494,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.SpamAssassinLoading = true;
|
||||
}
|
||||
@@ -1535,7 +1533,6 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
@@ -1549,8 +1546,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
$scope.SpamAssassinLoading = true;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
$scope.failedToSave = false;
|
||||
@@ -1560,6 +1556,7 @@ app.controller('MailScanner', function($scope, $http, $timeout, $window) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.failedToSave = true;
|
||||
$scope.successfullySaved = false;
|
||||
|
||||
Reference in New Issue
Block a user