mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
correct function name
This commit is contained in:
@@ -345,18 +345,11 @@ class CloudManager:
|
||||
try:
|
||||
statusFile = self.data['statusFile']
|
||||
|
||||
if not statusFile.startswith('/home/cyberpanel'):
|
||||
data_ret = {'status': 0, 'abort': 0, 'installationProgress': "0", }
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
TemFilePath = statusFile.split('panel/')[1]
|
||||
|
||||
try:
|
||||
value = int(TemFilePath)
|
||||
print(value)
|
||||
except:
|
||||
data_ret = {'status': 0, 'abort': 0, 'installationProgress': "0", }
|
||||
if ACLManager.CheckStatusFilleLoc(statusFile):
|
||||
pass
|
||||
else:
|
||||
data_ret = {'abort': 1, 'installStatus': 0, 'installationProgress': "100",
|
||||
'currentStatus': 'Invalid status file.'}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
@@ -882,6 +882,14 @@ class ACLManager:
|
||||
|
||||
@staticmethod
|
||||
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[
|
||||
:4] == '/tmp' or statusFile[
|
||||
:18] == '/usr/local/CyberCP') \
|
||||
|
||||
@@ -356,6 +356,10 @@ class mailUtilities:
|
||||
keyTable = "/etc/opendkim/KeyTable"
|
||||
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()
|
||||
|
||||
if data.find("default._domainkey." + actualDomain) == -1:
|
||||
@@ -369,6 +373,10 @@ class mailUtilities:
|
||||
signingTable = "/etc/opendkim/SigningTable"
|
||||
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()
|
||||
|
||||
if data.find("default._domainkey." + actualDomain) == -1:
|
||||
@@ -382,6 +390,10 @@ class mailUtilities:
|
||||
trustedHosts = "/etc/opendkim/TrustedHosts"
|
||||
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()
|
||||
|
||||
if data.find(actualDomain) == -1:
|
||||
|
||||
Reference in New Issue
Block a user