correct function name

This commit is contained in:
usmannasir
2024-01-22 18:30:20 +05:00
parent 0758d882b2
commit 761331069d
3 changed files with 25 additions and 12 deletions

View File

@@ -345,18 +345,11 @@ class CloudManager:
try: try:
statusFile = self.data['statusFile'] statusFile = self.data['statusFile']
if not statusFile.startswith('/home/cyberpanel'): if ACLManager.CheckStatusFilleLoc(statusFile):
data_ret = {'status': 0, 'abort': 0, 'installationProgress': "0", } pass
json_data = json.dumps(data_ret) else:
return HttpResponse(json_data) data_ret = {'abort': 1, 'installStatus': 0, 'installationProgress': "100",
'currentStatus': 'Invalid status file.'}
TemFilePath = statusFile.split('panel/')[1]
try:
value = int(TemFilePath)
print(value)
except:
data_ret = {'status': 0, 'abort': 0, 'installationProgress': "0", }
json_data = json.dumps(data_ret) json_data = json.dumps(data_ret)
return HttpResponse(json_data) return HttpResponse(json_data)

View File

@@ -882,6 +882,14 @@ class ACLManager:
@staticmethod @staticmethod
def CheckStatusFilleLoc(statusFile): def CheckStatusFilleLoc(statusFile):
TemFilePath = statusFile.split('panel/')[1]
try:
value = int(TemFilePath)
print(value)
except:
return 0
if (statusFile[:18] != "/home/cyberpanel/." or statusFile[:16] == "/home/cyberpanel" or statusFile[ if (statusFile[:18] != "/home/cyberpanel/." or statusFile[:16] == "/home/cyberpanel" or statusFile[
:4] == '/tmp' or statusFile[ :4] == '/tmp' or statusFile[
:18] == '/usr/local/CyberCP') \ :18] == '/usr/local/CyberCP') \

View File

@@ -356,6 +356,10 @@ class mailUtilities:
keyTable = "/etc/opendkim/KeyTable" keyTable = "/etc/opendkim/KeyTable"
configToWrite = "default._domainkey." + actualDomain + " " + actualDomain + ":default:/etc/opendkim/keys/" + virtualHostName + "/default.private\n" configToWrite = "default._domainkey." + actualDomain + " " + actualDomain + ":default:/etc/opendkim/keys/" + virtualHostName + "/default.private\n"
writeToFile = open(keyTable, 'a')
writeToFile.write("##### CyberPanel Generated File - Do not edit if you don't know what you are doing.")
writeToFile.close()
data = open(keyTable, 'r').read() data = open(keyTable, 'r').read()
if data.find("default._domainkey." + actualDomain) == -1: if data.find("default._domainkey." + actualDomain) == -1:
@@ -369,6 +373,10 @@ class mailUtilities:
signingTable = "/etc/opendkim/SigningTable" signingTable = "/etc/opendkim/SigningTable"
configToWrite = "*@" + actualDomain + " default._domainkey." + actualDomain + "\n" configToWrite = "*@" + actualDomain + " default._domainkey." + actualDomain + "\n"
writeToFile = open(signingTable, 'a')
writeToFile.write("##### CyberPanel Generated File - Do not edit if you don't know what you are doing.")
writeToFile.close()
data = open(signingTable, 'r').read() data = open(signingTable, 'r').read()
if data.find("default._domainkey." + actualDomain) == -1: if data.find("default._domainkey." + actualDomain) == -1:
@@ -382,6 +390,10 @@ class mailUtilities:
trustedHosts = "/etc/opendkim/TrustedHosts" trustedHosts = "/etc/opendkim/TrustedHosts"
configToWrite = actualDomain + "\n" configToWrite = actualDomain + "\n"
writeToFile = open(trustedHosts, 'a')
writeToFile.write("##### CyberPanel Generated File - Do not edit if you don't know what you are doing.")
writeToFile.close()
data = open(trustedHosts, 'r').read() data = open(trustedHosts, 'r').read()
if data.find(actualDomain) == -1: if data.find(actualDomain) == -1: