ACL Manager

This commit is contained in:
usmannasir
2018-08-18 00:39:10 +05:00
parent bc29c59287
commit f3230a010b
57 changed files with 25510 additions and 23870 deletions

View File

@@ -70,16 +70,13 @@ app.controller('systemStatusInfo', function($scope,$http,$timeout) {
function ListInitialData(response) {
$scope.cpuUsage = response.data.cpuUsage;
$scope.ramUsage = response.data.ramUsage;
$scope.diskUsage = response.data.diskUsage;
}
function cantLoadInitialData(response) {
console.log("not good");
}
function cantLoadInitialData(response) {}
//$timeout(getStuff, 2000);
@@ -103,52 +100,173 @@ app.controller('adminController', function($scope,$http,$timeout) {
function ListInitialData(response) {
$scope.currentAdmin = response.data.user_name;
$scope.currentAdmin = response.data.adminName;
$scope.admin_type = response.data.admin_type;
$("#serverIPAddress").text(response.data.serverIPAddress);
if (response.data.admin_type !== "Administrator")
{
if (response.data.admin === 0) {
$('.serverACL').hide();
if(response.data.admin_type !== "Reseller") {
$("#normalUser").hide();
$("#normalUserA").hide();
$("#normalUserB").hide();
if(!Boolean(response.data.versionManagement)){
$('.versionManagement').hide();
}
// User Management
if(!Boolean(response.data.createNewUser)){
$('.createNewUser').hide();
}
if(!Boolean(response.data.resellerCenter)){
$('.resellerCenter').hide();
}
if(!Boolean(response.data.deleteUser)){
$('.deleteUser').hide();
}
if(!Boolean(response.data.changeUserACL)){
$('.changeUserACL').hide();
}
// Website Management
if(!Boolean(response.data.createWebsite)){
$('.createWebsite').hide();
}
if(!Boolean(response.data.modifyWebsite)){
$('.modifyWebsite').hide();
}
if(!Boolean(response.data.suspendWebsite)){
$('.suspendWebsite').hide();
}
if(!Boolean(response.data.deleteWebsite)){
$('.deleteWebsite').hide();
}
$("#normalUserC").hide();
$("#normalUserD").hide();
$("#normalUserE").hide();
$("#normalUserF").hide();
$("#normalUserG").hide();
$("#normalUserH").hide();
$("#normalUserP").hide();
$("#normalUserI").hide();
// Package Management
$("#ssl").hide();
$("#sslA").hide();
$("#siteState").hide();
if(!Boolean(response.data.createPackage)){
$('.createPackage').hide();
}
$("#restoreSite").hide();
$("#backupDestinations").hide();
$("#scheduleBackup").hide();
if(!Boolean(response.data.deletePackage)){
$('.deletePackage').hide();
}
if(!Boolean(response.data.modifyPackage)){
$('.modifyPackage').hide();
}
// Database Management
if(!Boolean(response.data.createDatabase)){
$('.createDatabase').hide();
}
if(!Boolean(response.data.deleteDatabase)){
$('.deleteDatabase').hide();
}
if(!Boolean(response.data.listDatabases)){
$('.listDatabases').hide();
}
// DNS Management
if(!Boolean(response.data.createNameServer)){
$('.createNameServer').hide();
}
if(!Boolean(response.data.createDNSZone)){
$('.createDNSZone').hide();
}
if(!Boolean(response.data.deleteZone)){
$('.addDeleteRecords').hide();
}
if(!Boolean(response.data.addDeleteRecords)){
$('.deleteDatabase').hide();
}
// Email Management
if(!Boolean(response.data.createEmail)){
$('.createEmail').hide();
}
if(!Boolean(response.data.deleteEmail)){
$('.deleteEmail').hide();
}
if(!Boolean(response.data.emailForwarding)){
$('.emailForwarding').hide();
}
if(!Boolean(response.data.changeEmailPassword)){
$('.changeEmailPassword').hide();
}
if(!Boolean(response.data.dkimManager)){
$('.dkimManager').hide();
}
// FTP Management
if(!Boolean(response.data.createFTPAccount)){
$('.createFTPAccount').hide();
}
if(!Boolean(response.data.deleteFTPAccount)){
$('.deleteFTPAccount').hide();
}
if(!Boolean(response.data.listFTPAccounts)){
$('.listFTPAccounts').hide();
}
// Backup Management
if(!Boolean(response.data.createBackup)){
$('.createBackup').hide();
}
if(!Boolean(response.data.restoreBackup)){
$('.restoreBackup').hide();
}
if(!Boolean(response.data.addDeleteDestinations)){
$('.addDeleteDestinations').hide();
}
if(!Boolean(response.data.scheDuleBackups)){
$('.scheDuleBackups').hide();
}
if(!Boolean(response.data.remoteBackups)){
$('.remoteBackups').hide();
}
// SSL Management
if(!Boolean(response.data.manageSSL)){
$('.manageSSL').hide();
}
if(!Boolean(response.data.hostnameSSL)){
$('.hostnameSSL').hide();
}
if(!Boolean(response.data.mailServerSSL)){
$('.mailServerSSL').hide();
}
$("#remoteBackups").hide();
$("#packageHome").hide();
$("#packageSub").hide();
$("#createWebsite").hide();
$("#modifyWebSite").hide();
$("#deleteWebsite").hide();
$("#versionManagement").hide();
}
}
function cantLoadInitialData(response) {
console.log("not good");
}
function cantLoadInitialData(response) {}
});

View File

@@ -288,8 +288,7 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
data.priority = $scope.priority;
data.ttl = $scope.ttl;
data.recordType = type;
}
else if(type === "CAA"){
}else if(type === "CAA"){
data.selectedZone = $scope.selectedZone;
data.recordName = $scope.recordName;
data.recordContentCAA = $scope.recordContentCAA;

View File

@@ -985,15 +985,10 @@ app.controller('modSec', function($scope, $http, $timeout, $window) {
///// ModSec configs
var modsecurity_status = false;
var SecAuditEngine = false;
var SecRuleEngine = false;
$('#modsecurity_status').change(function() {
modsecurity_status = $(this).prop('checked');
});
$('#SecAuditEngine').change(function() {
SecAuditEngine = $(this).prop('checked');
});
@@ -1008,7 +1003,6 @@ app.controller('modSec', function($scope, $http, $timeout, $window) {
$scope.modsecLoading = false;
$('#modsecurity_status').bootstrapToggle('off');
$('#SecAuditEngine').bootstrapToggle('off');
$('#SecRuleEngine').bootstrapToggle('off');
@@ -1037,10 +1031,6 @@ app.controller('modSec', function($scope, $http, $timeout, $window) {
if(response.data.installed === 1) {
if (response.data.modsecurity === 1) {
$('#modsecurity_status').bootstrapToggle('on');
}
if (response.data.SecAuditEngine === 1) {
$('#SecAuditEngine').bootstrapToggle('on');
}
@@ -1083,13 +1073,12 @@ app.controller('modSec', function($scope, $http, $timeout, $window) {
url = "/firewall/saveModSecConfigurations";
var data = {
modsecurity_status:modsecurity_status,
SecAuditEngine:SecAuditEngine,
SecRuleEngine:SecRuleEngine,
SecDebugLogLevel:$scope.SecDebugLogLevel,
SecAuditLogParts:$scope.SecAuditLogParts,
SecAuditLogRelevantStatus:$scope.SecAuditLogRelevantStatus,
SecAuditLogType:$scope.SecAuditLogType,
SecAuditLogType:$scope.SecAuditLogType
};
var config = {
@@ -1494,8 +1483,6 @@ app.controller('modSecRulesPack', function($scope, $http, $timeout, $window) {
$scope.modsecLoading = false;
url = "/firewall/enableDisableRuleFile";
var data = {
@@ -1529,6 +1516,12 @@ app.controller('modSecRulesPack', function($scope, $http, $timeout, $window) {
$scope.installationFailed = true;
$scope.installationSuccess = false;
new PNotify({
title: 'Success!',
text: 'Changes successfully applied.',
type:'success'
});
$scope.fetchRulesFile(packName);
}else{
@@ -1541,6 +1534,12 @@ app.controller('modSecRulesPack', function($scope, $http, $timeout, $window) {
$scope.installationFailed = false;
$scope.installationSuccess = true;
new PNotify({
title: 'Error!',
text: response.data.error_message,
type:'error'
});
$scope.errorMessage = response.data.error_message;
}
@@ -1554,6 +1553,12 @@ app.controller('modSecRulesPack', function($scope, $http, $timeout, $window) {
$scope.couldNotConnect = false;
$scope.installationFailed = true;
$scope.installationSuccess = true;
new PNotify({
title: 'Error!',
text: 'Could not connect to server, please refresh this page.',
type:'error'
});
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -537,8 +537,6 @@ app.controller('modifyWebsitesController', function($scope,$http) {
});
/* Java script code to Modify Pacakge ends here */
@@ -723,7 +721,7 @@ app.controller('websitePages', function($scope, $http, $timeout, $window) {
function ListInitialDatas(response) {
if(response.data.logstatus == 1){
if(response.data.logstatus === 1){
// notifications
@@ -839,7 +837,7 @@ app.controller('websitePages', function($scope, $http, $timeout, $window) {
function ListInitialDatas(response) {
if(response.data.configstatus == 1){
if(response.data.configstatus === 1){
//Rewrite rules
@@ -956,7 +954,7 @@ app.controller('websitePages', function($scope, $http, $timeout, $window) {
function ListInitialDatas(response) {
if(response.data.configstatus == 1){
if(response.data.configstatus === 1){
$scope.configurationsBox = false;
$scope.configsFetched = true;
@@ -1366,10 +1364,10 @@ app.controller('websitePages', function($scope, $http, $timeout, $window) {
var domain = $("#domainNamePage").text();
var path = $scope.installPath;
var sitename = $scope.sitename
var username = $scope.username
var password = $scope.password
var prefix = $scope.prefix
var sitename = $scope.sitename;
var username = $scope.username;
var password = $scope.password;
var prefix = $scope.prefix;
url = "/websites/installJoomla";
@@ -1480,7 +1478,7 @@ app.controller('websitePages', function($scope, $http, $timeout, $window) {
var data = {
virtualHost: virtualHost,
cert:cert,
key:key,
key:key
};
var config = {
@@ -2377,9 +2375,8 @@ app.controller('suspendWebsiteControl', function($scope,$http) {
function ListInitialDatas(response) {
console.log(response.data)
if (response.data.websiteStatus == 1)
if (response.data.websiteStatus === 1)
{
if(state=="Suspend"){
@@ -3071,6 +3068,10 @@ app.controller('launchChild', function($scope,$http) {
$scope.fileManagerURL = "/filemanager/"+$("#domainNamePage").text();
$scope.previewUrl = "/preview/"+$("#childDomain").text()+"/";
$scope.wordPressInstallURL = "/websites/" + $("#childDomain").text() + "/wordpressInstall";
$scope.joomlaInstallURL = "/websites/" + $("#childDomain").text() + "/joomlaInstall";
$scope.setupGit = "/websites/" + $("#childDomain").text() + "/setupGit";
$scope.installPrestaURL = "/websites/" + $("#childDomain").text() + "/installPrestaShop";
var logType = 0;
$scope.pageNumber = 1;
@@ -3124,7 +3125,7 @@ app.controller('launchChild', function($scope,$http) {
function ListInitialDatas(response) {
if(response.data.logstatus == 1){
if(response.data.logstatus === 1){
$scope.logFileLoading = true;
@@ -3180,11 +3181,11 @@ app.controller('launchChild', function($scope,$http) {
var errorPageNumber = $scope.errorPageNumber;
if(type==3){
if(type === 3){
errorPageNumber = $scope.errorPageNumber+1;
$scope.errorPageNumber = errorPageNumber;
}
else if(type==4){
else if(type === 4){
errorPageNumber = $scope.errorPageNumber-1;
$scope.errorPageNumber = errorPageNumber;
}
@@ -3225,7 +3226,7 @@ app.controller('launchChild', function($scope,$http) {
function ListInitialDatas(response) {
if(response.data.logstatus == 1){
if(response.data.logstatus === 1){
// notifications
@@ -3805,7 +3806,7 @@ app.controller('launchChild', function($scope,$http) {
function ListInitialDatas(response) {
if(response.data.sslStatus == 1){
if(response.data.sslStatus === 1){
$scope.sslSaved = false;
$scope.couldNotSaveSSL = true;
@@ -3931,7 +3932,7 @@ app.controller('launchChild', function($scope,$http) {
}
}
};