From 1e16db3a05fddec6fce8eeb8e93ef27e026992ef Mon Sep 17 00:00:00 2001
From: usmannasir <01-134132-158@student.bahria.edu.pk>
Date: Wed, 21 Mar 2018 03:04:56 +0500
Subject: [PATCH] ModSec Integration.
---
firewall/static/firewall/firewall.js | 276 ++++--------------
firewall/templates/firewall/modSecurity.html | 109 +++++++
firewall/urls.py | 1 +
firewall/views.py | 112 +++++++
managePHP/static/managePHP/managePHP.js | 17 +-
plogical/modSec.py | 73 ++++-
static/firewall/firewall.js | 276 ++++--------------
static/managePHP/managePHP.js | 17 +-
.../websiteFunctions/createWebsite.html | 2 -
9 files changed, 434 insertions(+), 449 deletions(-)
diff --git a/firewall/static/firewall/firewall.js b/firewall/static/firewall/firewall.js
index 07da99851..294c965c7 100644
--- a/firewall/static/firewall/firewall.js
+++ b/firewall/static/firewall/firewall.js
@@ -983,26 +983,46 @@ app.controller('modSec', function($scope, $http, $timeout, $window) {
}
+ ///// ModSec configs
+
+ var modsecurity_status = false;
+ var SecAuditEngine = false;
+ var SecRuleEngine = false;
- function getSSHConfigs(){
+ $('#modsecurity_status').change(function() {
+ modsecurity_status = $(this).prop('checked');
+ });
- $scope.couldNotSave = true;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = false;
+ $('#SecAuditEngine').change(function() {
+ SecAuditEngine = $(this).prop('checked');
+ });
- url = "/firewall/getSSHConfigs";
- var data = {
- type:"1",
- };
+ $('#SecRuleEngine').change(function() {
+ SecRuleEngine = $(this).prop('checked');
+ });
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
+ fetchModSecSettings();
+ function fetchModSecSettings(){
+
+ $scope.modsecLoading = false;
+
+ $('#modsecurity_status').bootstrapToggle('off');
+ $('#SecAuditEngine').bootstrapToggle('off');
+ $('#SecRuleEngine').bootstrapToggle('off');
+
+ url = "/firewall/fetchModSecSettings";
+
+ var phpSelection = $scope.phpSelection;
+
+ var data = {};
+
+ var config = {
+ headers : {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
@@ -1011,218 +1031,46 @@ app.controller('modSec', function($scope, $http, $timeout, $window) {
function ListInitialDatas(response) {
- $scope.sshPort = response.data.sshPort;
+ $scope.modsecLoading = true;
+
+ if(response.data.fetchStatus === 1){
+
+ if(response.data.installed === 1) {
+
+
+ if (response.data.modsecurity === 1) {
+ $('#modsecurity_status').bootstrapToggle('on');
+ }
+ if (response.data.SecAuditEngine === 1) {
+ $('#SecAuditEngine').bootstrapToggle('on');
+ }
+ if (response.data.SecRuleEngine === 1) {
+ $('#SecRuleEngine').bootstrapToggle('on');
+ }
+
+ $scope.SecDebugLogLevel = response.data.SecDebugLogLevel;
+ $scope.SecAuditLogParts = response.data.SecAuditLogParts;
+ $scope.SecAuditLogRelevantStatus = response.data.SecAuditLogRelevantStatus;
+ $scope.SecAuditLogType = response.data.SecAuditLogType;
+
+ }
- if(response.data.permitRootLogin == 1){
- $('#rootLogin').bootstrapToggle('on');
- $scope.couldNotSave = true;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = true;
- }
- else{
- $scope.errorMessage = response.data.error_message;
- $scope.couldNotSave = true;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = true;
}
}
function cantLoadInitialDatas(response) {
- $scope.couldNotConnect = false;
-
+ $scope.modsecLoading = true;
}
- };
-
- $scope.saveChanges = function () {
-
- $scope.couldNotSave = true;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = false;
-
- url = "/firewall/saveSSHConfigs";
-
- var data = {
- type:"1",
- sshPort:$scope.sshPort,
- rootLogin:rootLogin,
- };
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
-
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- if(response.data.saveStatus == 1){
- $scope.couldNotSave = true;
- $scope.detailsSaved = false;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = true;
- }
- else{
-
- $scope.couldNotSave = false;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = true;
-
- $scope.errorMessage = response.data.error_message;
- }
-
- }
- function cantLoadInitialDatas(response) {
- $scope.couldNotSave = true;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = false;
- $scope.secureSSHLoading = true;
-
- }
- };
-
-
- function populateCurrentKeys(){
-
- url = "/firewall/getSSHConfigs";
-
- var data = {
- type:"2",
- };
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
-
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- if(response.data.status == 1){
- $scope.records = JSON.parse(response.data.data);
- }
-
- }
- function cantLoadInitialDatas(response) {
- $scope.couldNotConnect = false;
-
- }
-
-
- }
-
- $scope.deleteKey = function(key){
-
- $scope.secureSSHLoading = false;
-
- url = "/firewall/deleteSSHKey";
-
- var data = {
- key:key,
- };
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
-
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- if(response.data.delete_status == 1){
- $scope.secureSSHLoading = true;
- $scope.keyDeleted = false;
- populateCurrentKeys();
- }
- else{
- $scope.couldNotConnect = false;
- $scope.secureSSHLoading = true;
- }
-
- }
- function cantLoadInitialDatas(response) {
- $scope.couldNotConnect = false;
- $scope.secureSSHLoading = true;
-
- }
-
-
}
- $scope.saveKey = function(key){
+ /////
- $scope.secureSSHLoading = false;
+ /// Save ModSec Changes
- url = "/firewall/addSSHKey";
-
- var data = {
- key:$scope.keyData,
- };
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
-
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- if(response.data.add_status == 1){
- $scope.secureSSHLoading = true;
- $scope.saveKeyBtn = true;
- $scope.showKeyBox = false;
- $scope.keyBox = true;
-
-
- populateCurrentKeys();
- }
- else{
- $scope.secureSSHLoading = true;
- $scope.saveKeyBtn = false;
- $scope.showKeyBox = true;
- $scope.keyBox = true;
- $scope.couldNotConnect = false;
- $scope.secureSSHLoading = true;
- }
-
- }
- function cantLoadInitialDatas(response) {
- $scope.secureSSHLoading = true;
- $scope.saveKeyBtn = false;
- $scope.showKeyBox = true;
- $scope.keyBox = true;
- $scope.couldNotConnect = false;
- $scope.secureSSHLoading = true;
-
- }
-
-
- }
+ $scope.failedToSave = true;
+ $scope.successfullySaved = true;
});
diff --git a/firewall/templates/firewall/modSecurity.html b/firewall/templates/firewall/modSecurity.html
index 9e22a514f..f319e5d59 100644
--- a/firewall/templates/firewall/modSecurity.html
+++ b/firewall/templates/firewall/modSecurity.html
@@ -74,6 +74,115 @@
{% else %}
+
+
+
{% endif %}
diff --git a/firewall/urls.py b/firewall/urls.py
index f729ba18d..8f123116a 100644
--- a/firewall/urls.py
+++ b/firewall/urls.py
@@ -28,6 +28,7 @@ urlpatterns = [
url(r'^modSecurity', views.loadModSecurityHome, name='modSecurity'),
url(r'^installModSec', views.installModSec, name='installModSec'),
url(r'^installStatusModSec', views.installStatusModSec, name='installStatusModSec'),
+ url(r'^fetchModSecSettings', views.fetchModSecSettings, name='fetchModSecSettings'),
]
\ No newline at end of file
diff --git a/firewall/views.py b/firewall/views.py
index fc1cb739d..533d83b0d 100644
--- a/firewall/views.py
+++ b/firewall/views.py
@@ -678,6 +678,25 @@ def installStatusModSec(request):
if installStatus.find("[200]")>-1:
+ execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
+
+ execPath = execPath + " installModSecConfigs"
+
+ output = subprocess.check_output(shlex.split(execPath))
+
+ if output.find("1,None") > -1:
+ pass
+ else:
+ final_json = json.dumps({
+ 'error_message': "Failed to install ModSecurity configurations.",
+ 'requestStatus': installStatus,
+ 'abort': 1,
+ 'installed': 0,
+ })
+ return HttpResponse(final_json)
+
+ installUtilities.reStartLiteSpeed()
+
final_json = json.dumps({
'error_message': "None",
'requestStatus': installStatus,
@@ -712,3 +731,96 @@ def installStatusModSec(request):
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)
+
+
+def fetchModSecSettings(request):
+ try:
+ val = request.session['userID']
+
+ try:
+ if request.method == 'POST':
+
+ modsecurity = 0
+ SecAuditEngine = 0
+ SecRuleEngine = 0
+ SecDebugLogLevel = "9"
+ SecAuditLogRelevantStatus = '^(?:5|4(?!04))'
+ SecAuditLogParts = 'ABIJDEFHZ'
+ SecAuditLogType = 'Serial'
+
+ confPath = os.path.join(virtualHostUtilities.Server_root, 'conf/httpd_config.conf')
+ modSecPath = os.path.join(virtualHostUtilities.Server_root, 'modules', 'mod_security.so')
+
+ if os.path.exists(modSecPath):
+
+ data = open(confPath, 'r').readlines()
+
+ for items in data:
+
+ if items.find('modsecurity ') > -1:
+ if items.find('on') > -1 or items.find('On') > -1:
+ modsecurity = 1
+ continue
+ if items.find('SecAuditEngine ') > -1:
+ if items.find('on') > -1 or items.find('On') > -1:
+ SecAuditEngine = 1
+ continue
+
+ if items.find('SecRuleEngine ') > -1:
+ if items.find('on') > -1 or items.find('On') > -1:
+ SecRuleEngine = 1
+ continue
+
+ if items.find('SecDebugLogLevel') > -1:
+ result = items.split(' ')
+ if result[0] == 'SecDebugLogLevel':
+ SecDebugLogLevel = result[1]
+ continue
+ if items.find('SecAuditLogRelevantStatus') > -1:
+ result = items.split(' ')
+ if result[0] == 'SecAuditLogRelevantStatus':
+ SecAuditLogRelevantStatus = result[1]
+ continue
+ if items.find('SecAuditLogParts') > -1:
+ result = items.split(' ')
+ if result[0] == 'SecAuditLogParts':
+ SecAuditLogParts = result[1]
+ continue
+ if items.find('SecAuditLogType') > -1:
+ result = items.split(' ')
+ if result[0] == 'SecAuditLogType':
+ SecAuditLogType = result[1]
+ continue
+
+
+ final_dic = {'fetchStatus': 1,
+ 'installed': 1,
+ 'SecRuleEngine': SecRuleEngine,
+ 'modsecurity': modsecurity,
+ 'SecAuditEngine': SecAuditEngine,
+ 'SecDebugLogLevel': SecDebugLogLevel,
+ 'SecAuditLogParts': SecAuditLogParts,
+ 'SecAuditLogRelevantStatus': SecAuditLogRelevantStatus,
+ 'SecAuditLogType': SecAuditLogType,
+ }
+
+ else:
+ final_dic = {'fetchStatus': 1,
+ 'installed': 0}
+
+
+
+ final_json = json.dumps(final_dic)
+ return HttpResponse(final_json)
+
+
+ except BaseException,msg:
+ final_dic = {'fetchStatus': 0, 'error_message': str(msg)}
+ final_json = json.dumps(final_dic)
+
+ return HttpResponse(final_json)
+
+
+ return render(request,'managePHP/editPHPConfig.html')
+ except KeyError:
+ return redirect(loadLoginPage)
diff --git a/managePHP/static/managePHP/managePHP.js b/managePHP/static/managePHP/managePHP.js
index f15425925..8d1b35a94 100644
--- a/managePHP/static/managePHP/managePHP.js
+++ b/managePHP/static/managePHP/managePHP.js
@@ -59,13 +59,12 @@ app.controller('installExtensions', function($scope,$http,$timeout) {
function ListInitialDatas(response) {
- if(response.data.extensionRequestStatus == 1){
+ if(response.data.extensionRequestStatus === 1){
getRequestStatus();
$scope.canNotPerform = true;
-
}
else{
$scope.canNotPerform = false;
@@ -170,7 +169,7 @@ app.controller('installExtensions', function($scope,$http,$timeout) {
function ListInitialDatas(response) {
- if(response.data.fetchStatus == 1){
+ if(response.data.fetchStatus === 1){
$scope.records = JSON.parse(response.data.data);
@@ -225,9 +224,9 @@ app.controller('installExtensions', function($scope,$http,$timeout) {
function ListInitialDatas(response) {
- if(response.data.extensionRequestStatus == 1){
+ if(response.data.extensionRequestStatus === 1){
- if(response.data.finished==1){
+ if(response.data.finished === 1){
$scope.loadingExtensions = true;
$scope.phpSelectionDisabled = false;
@@ -288,20 +287,20 @@ app.controller('editPHPConfig', function($scope,$http,$timeout) {
$('#allow_url_fopen').change(function() {
allow_url_fopen = $(this).prop('checked');
- })
+ });
$('#display_errors').change(function() {
display_errors = $(this).prop('checked');
- })
+ });
$('#file_uploads').change(function() {
file_uploads = $(this).prop('checked');
- })
+ });
$('#allow_url_include').change(function() {
allow_url_include = $(this).prop('checked');
- })
+ });
diff --git a/plogical/modSec.py b/plogical/modSec.py
index 126ae8e28..6085c29bf 100644
--- a/plogical/modSec.py
+++ b/plogical/modSec.py
@@ -1,6 +1,9 @@
import CyberCPLogFileWriter as logging
import subprocess
import shlex
+import argparse
+from virtualHostUtilities import virtualHostUtilities
+import os
class modSec:
installLogPath = "/home/cyberpanel/modSecInstallLog"
@@ -29,4 +32,72 @@ class modSec:
return 1
except BaseException, msg:
- logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[installModSec]")
\ No newline at end of file
+ logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[installModSec]")
+
+ @staticmethod
+ def installModSecConfigs():
+ try:
+ ## Try making a dir that will store ModSec configurations
+ path = os.path.join(virtualHostUtilities.Server_root,"conf/modsec")
+ try:
+ os.mkdir(path)
+ except:
+ logging.CyberCPLogFileWriter.writeToFile(
+ "ModSecurity rules directory already exists." + " [installModSecConfigs]")
+
+ initialConfigs = """
+module mod_security {
+modsecurity on
+modsecurity_rules `
+SecDebugLogLevel 9
+SecDebugLog /usr/local/lsws/logs/modsec.log
+SecAuditEngine on
+SecAuditLogRelevantStatus "^(?:5|4(?!04))"
+SecAuditLogParts ABIJDEFHZ
+SecAuditLogType Serial
+SecAuditLog /usr/local/lsws/logs/auditmodsec.log
+SecRuleEngine On
+`
+modsecurity_rules_file /usr/local/lsws/conf/modsec/rules.conf
+}
+"""
+
+
+ confFile = os.path.join(virtualHostUtilities.Server_root,"conf/httpd_config.conf")
+
+ conf = open(confFile,'a+')
+ conf.write(initialConfigs)
+ conf.close()
+
+ rulesFilePath = os.path.join(virtualHostUtilities.Server_root,"conf/modsec/rules.conf")
+
+ if not os.path.exists(rulesFilePath):
+ initialRules = """
+SecRule ARGS "\.\./" "t:normalisePathWin,id:99999,severity:4,msg:'Drive Access' ,log,auditlog,deny"
+"""
+ rule = open(rulesFilePath,'a+')
+ rule.write(initialRules)
+ rule.close()
+
+ print "1,None"
+ return
+
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [installModSecConfigs]")
+ print "0," + str(msg)
+
+
+
+def main():
+
+ parser = argparse.ArgumentParser(description='CyberPanel Installer')
+ parser.add_argument('function', help='Specific a function to call!')
+
+ args = parser.parse_args()
+
+ if args.function == "installModSecConfigs":
+ modSec.installModSecConfigs()
+
+if __name__ == "__main__":
+ main()
\ No newline at end of file
diff --git a/static/firewall/firewall.js b/static/firewall/firewall.js
index 07da99851..294c965c7 100644
--- a/static/firewall/firewall.js
+++ b/static/firewall/firewall.js
@@ -983,26 +983,46 @@ app.controller('modSec', function($scope, $http, $timeout, $window) {
}
+ ///// ModSec configs
+
+ var modsecurity_status = false;
+ var SecAuditEngine = false;
+ var SecRuleEngine = false;
- function getSSHConfigs(){
+ $('#modsecurity_status').change(function() {
+ modsecurity_status = $(this).prop('checked');
+ });
- $scope.couldNotSave = true;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = false;
+ $('#SecAuditEngine').change(function() {
+ SecAuditEngine = $(this).prop('checked');
+ });
- url = "/firewall/getSSHConfigs";
- var data = {
- type:"1",
- };
+ $('#SecRuleEngine').change(function() {
+ SecRuleEngine = $(this).prop('checked');
+ });
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
+ fetchModSecSettings();
+ function fetchModSecSettings(){
+
+ $scope.modsecLoading = false;
+
+ $('#modsecurity_status').bootstrapToggle('off');
+ $('#SecAuditEngine').bootstrapToggle('off');
+ $('#SecRuleEngine').bootstrapToggle('off');
+
+ url = "/firewall/fetchModSecSettings";
+
+ var phpSelection = $scope.phpSelection;
+
+ var data = {};
+
+ var config = {
+ headers : {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
@@ -1011,218 +1031,46 @@ app.controller('modSec', function($scope, $http, $timeout, $window) {
function ListInitialDatas(response) {
- $scope.sshPort = response.data.sshPort;
+ $scope.modsecLoading = true;
+
+ if(response.data.fetchStatus === 1){
+
+ if(response.data.installed === 1) {
+
+
+ if (response.data.modsecurity === 1) {
+ $('#modsecurity_status').bootstrapToggle('on');
+ }
+ if (response.data.SecAuditEngine === 1) {
+ $('#SecAuditEngine').bootstrapToggle('on');
+ }
+ if (response.data.SecRuleEngine === 1) {
+ $('#SecRuleEngine').bootstrapToggle('on');
+ }
+
+ $scope.SecDebugLogLevel = response.data.SecDebugLogLevel;
+ $scope.SecAuditLogParts = response.data.SecAuditLogParts;
+ $scope.SecAuditLogRelevantStatus = response.data.SecAuditLogRelevantStatus;
+ $scope.SecAuditLogType = response.data.SecAuditLogType;
+
+ }
- if(response.data.permitRootLogin == 1){
- $('#rootLogin').bootstrapToggle('on');
- $scope.couldNotSave = true;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = true;
- }
- else{
- $scope.errorMessage = response.data.error_message;
- $scope.couldNotSave = true;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = true;
}
}
function cantLoadInitialDatas(response) {
- $scope.couldNotConnect = false;
-
+ $scope.modsecLoading = true;
}
- };
-
- $scope.saveChanges = function () {
-
- $scope.couldNotSave = true;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = false;
-
- url = "/firewall/saveSSHConfigs";
-
- var data = {
- type:"1",
- sshPort:$scope.sshPort,
- rootLogin:rootLogin,
- };
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
-
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- if(response.data.saveStatus == 1){
- $scope.couldNotSave = true;
- $scope.detailsSaved = false;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = true;
- }
- else{
-
- $scope.couldNotSave = false;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = true;
- $scope.secureSSHLoading = true;
-
- $scope.errorMessage = response.data.error_message;
- }
-
- }
- function cantLoadInitialDatas(response) {
- $scope.couldNotSave = true;
- $scope.detailsSaved = true;
- $scope.couldNotConnect = false;
- $scope.secureSSHLoading = true;
-
- }
- };
-
-
- function populateCurrentKeys(){
-
- url = "/firewall/getSSHConfigs";
-
- var data = {
- type:"2",
- };
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
-
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- if(response.data.status == 1){
- $scope.records = JSON.parse(response.data.data);
- }
-
- }
- function cantLoadInitialDatas(response) {
- $scope.couldNotConnect = false;
-
- }
-
-
- }
-
- $scope.deleteKey = function(key){
-
- $scope.secureSSHLoading = false;
-
- url = "/firewall/deleteSSHKey";
-
- var data = {
- key:key,
- };
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
-
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- if(response.data.delete_status == 1){
- $scope.secureSSHLoading = true;
- $scope.keyDeleted = false;
- populateCurrentKeys();
- }
- else{
- $scope.couldNotConnect = false;
- $scope.secureSSHLoading = true;
- }
-
- }
- function cantLoadInitialDatas(response) {
- $scope.couldNotConnect = false;
- $scope.secureSSHLoading = true;
-
- }
-
-
}
- $scope.saveKey = function(key){
+ /////
- $scope.secureSSHLoading = false;
+ /// Save ModSec Changes
- url = "/firewall/addSSHKey";
-
- var data = {
- key:$scope.keyData,
- };
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
-
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- if(response.data.add_status == 1){
- $scope.secureSSHLoading = true;
- $scope.saveKeyBtn = true;
- $scope.showKeyBox = false;
- $scope.keyBox = true;
-
-
- populateCurrentKeys();
- }
- else{
- $scope.secureSSHLoading = true;
- $scope.saveKeyBtn = false;
- $scope.showKeyBox = true;
- $scope.keyBox = true;
- $scope.couldNotConnect = false;
- $scope.secureSSHLoading = true;
- }
-
- }
- function cantLoadInitialDatas(response) {
- $scope.secureSSHLoading = true;
- $scope.saveKeyBtn = false;
- $scope.showKeyBox = true;
- $scope.keyBox = true;
- $scope.couldNotConnect = false;
- $scope.secureSSHLoading = true;
-
- }
-
-
- }
+ $scope.failedToSave = true;
+ $scope.successfullySaved = true;
});
diff --git a/static/managePHP/managePHP.js b/static/managePHP/managePHP.js
index f15425925..8d1b35a94 100644
--- a/static/managePHP/managePHP.js
+++ b/static/managePHP/managePHP.js
@@ -59,13 +59,12 @@ app.controller('installExtensions', function($scope,$http,$timeout) {
function ListInitialDatas(response) {
- if(response.data.extensionRequestStatus == 1){
+ if(response.data.extensionRequestStatus === 1){
getRequestStatus();
$scope.canNotPerform = true;
-
}
else{
$scope.canNotPerform = false;
@@ -170,7 +169,7 @@ app.controller('installExtensions', function($scope,$http,$timeout) {
function ListInitialDatas(response) {
- if(response.data.fetchStatus == 1){
+ if(response.data.fetchStatus === 1){
$scope.records = JSON.parse(response.data.data);
@@ -225,9 +224,9 @@ app.controller('installExtensions', function($scope,$http,$timeout) {
function ListInitialDatas(response) {
- if(response.data.extensionRequestStatus == 1){
+ if(response.data.extensionRequestStatus === 1){
- if(response.data.finished==1){
+ if(response.data.finished === 1){
$scope.loadingExtensions = true;
$scope.phpSelectionDisabled = false;
@@ -288,20 +287,20 @@ app.controller('editPHPConfig', function($scope,$http,$timeout) {
$('#allow_url_fopen').change(function() {
allow_url_fopen = $(this).prop('checked');
- })
+ });
$('#display_errors').change(function() {
display_errors = $(this).prop('checked');
- })
+ });
$('#file_uploads').change(function() {
file_uploads = $(this).prop('checked');
- })
+ });
$('#allow_url_include').change(function() {
allow_url_include = $(this).prop('checked');
- })
+ });
diff --git a/websiteFunctions/templates/websiteFunctions/createWebsite.html b/websiteFunctions/templates/websiteFunctions/createWebsite.html
index dda107468..495810d7c 100644
--- a/websiteFunctions/templates/websiteFunctions/createWebsite.html
+++ b/websiteFunctions/templates/websiteFunctions/createWebsite.html
@@ -123,8 +123,6 @@
-
-