mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-09 14:56:10 +01:00
code refactor
This commit is contained in:
@@ -520,7 +520,6 @@ class FirewallManager:
|
||||
if installStatus.find("[200]") > -1:
|
||||
|
||||
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/modSec.py"
|
||||
|
||||
execPath = execPath + " installModSecConfigs"
|
||||
|
||||
output = ProcessUtilities.outputExecutioner(execPath)
|
||||
@@ -1292,7 +1291,6 @@ class FirewallManager:
|
||||
def installStatusCSF(self):
|
||||
try:
|
||||
userID = self.request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
installStatus = ProcessUtilities.outputExecutioner("sudo cat " + CSF.installLogPath)
|
||||
|
||||
|
||||
@@ -443,7 +443,6 @@ def enableDisableRuleFile(request):
|
||||
|
||||
def csf(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
result = pluginManager.preCSF(request)
|
||||
if result != 200:
|
||||
@@ -462,7 +461,6 @@ def csf(request):
|
||||
|
||||
def installCSF(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
fm = FirewallManager(request)
|
||||
return fm.installCSF()
|
||||
except KeyError:
|
||||
@@ -470,7 +468,6 @@ def installCSF(request):
|
||||
|
||||
def installStatusCSF(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
fm = FirewallManager(request)
|
||||
return fm.installStatusCSF()
|
||||
except KeyError:
|
||||
@@ -478,7 +475,6 @@ def installStatusCSF(request):
|
||||
|
||||
def removeCSF(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
fm = FirewallManager(request)
|
||||
return fm.removeCSF()
|
||||
except KeyError:
|
||||
@@ -486,7 +482,6 @@ def removeCSF(request):
|
||||
|
||||
def fetchCSFSettings(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
fm = FirewallManager(request)
|
||||
return fm.fetchCSFSettings()
|
||||
except KeyError:
|
||||
@@ -494,7 +489,6 @@ def fetchCSFSettings(request):
|
||||
|
||||
def changeStatus(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
result = pluginManager.preChangeStatus(request)
|
||||
if result != 200:
|
||||
@@ -513,7 +507,6 @@ def changeStatus(request):
|
||||
|
||||
def modifyPorts(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
result = pluginManager.preModifyPorts(request)
|
||||
if result != 200:
|
||||
@@ -532,7 +525,6 @@ def modifyPorts(request):
|
||||
|
||||
def modifyIPs(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
result = pluginManager.preModifyIPs(request)
|
||||
if result != 200:
|
||||
|
||||
@@ -28,7 +28,6 @@ from plogical.httpProc import httpProc
|
||||
def loadPHPHome(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
proc = httpProc(request, 'managePHP/index.html',
|
||||
None, 'admin')
|
||||
@@ -39,8 +38,6 @@ def loadPHPHome(request):
|
||||
|
||||
def installExtensions(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
if PHP.objects.count() == 0:
|
||||
for i in range(3, 7):
|
||||
@@ -1597,7 +1594,6 @@ def getRequestStatusApache(request):
|
||||
|
||||
def editPHPConfigs(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
proc = httpProc(request, 'managePHP/editPHPConfig.html',
|
||||
{'phps': PHPManager.findPHPVersions()}, 'admin')
|
||||
return proc.render()
|
||||
@@ -1694,7 +1690,6 @@ def getCurrentPHPConfig(request):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def savePHPConfigBasic(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
@@ -103,7 +103,6 @@ def fetchStatus(request):
|
||||
data_ret = {'status': 1, 'error_message': 'None', 'installCheck': 0}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
except BaseException as msg:
|
||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(data_ret)
|
||||
|
||||
@@ -37,7 +37,6 @@ def serverStatusHome(request):
|
||||
def litespeedStatus(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
|
||||
processList = ProcessUtilities.getLitespeedProcessNumber()
|
||||
|
||||
@@ -607,7 +606,6 @@ def topProcessesStatus(request):
|
||||
data['buffCache'] = '%sMB' % ('0')
|
||||
|
||||
|
||||
|
||||
## Swap
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user