mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 15:26:13 +01:00
centralized execution ph2
This commit is contained in:
@@ -23,6 +23,7 @@ from plogical.acl import ACLManager
|
||||
import os
|
||||
from plogical.dnsUtilities import DNS
|
||||
from loginSystem.models import Administrator
|
||||
from plogical.processUtilities import ProcessUtilities
|
||||
|
||||
class MailServerManager:
|
||||
|
||||
@@ -76,7 +77,7 @@ class MailServerManager:
|
||||
execPath = execPath + " createEmailAccount --domain " + domainName + " --userName " \
|
||||
+ userName + " --password " + password
|
||||
|
||||
output = ProcessUtilities.outputExecutioner(shlex.split(execPath))
|
||||
output = ProcessUtilities.outputExecutioner(execPath)
|
||||
|
||||
if output.find("1,None") > -1:
|
||||
data_ret = {'status': 1, 'createEmailStatus': 1, 'error_message': "None"}
|
||||
@@ -391,13 +392,13 @@ class MailServerManager:
|
||||
try:
|
||||
path = "/etc/opendkim/keys/" + domainName + "/default.txt"
|
||||
command = "sudo cat " + path
|
||||
output = ProcessUtilities.outputExecutioner(shlex.split(command))
|
||||
output = ProcessUtilities.outputExecutioner(command)
|
||||
leftIndex = output.index('(') + 2
|
||||
rightIndex = output.rindex(')') - 1
|
||||
|
||||
path = "/etc/opendkim/keys/" + domainName + "/default.private"
|
||||
command = "sudo cat " + path
|
||||
privateKey = ProcessUtilities.outputExecutioner(shlex.split(command))
|
||||
privateKey = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
data_ret = {'status': 1, 'fetchStatus': 1, 'keysAvailable': 1, 'publicKey': output[leftIndex:rightIndex],
|
||||
'privateKey': privateKey, 'dkimSuccessMessage': 'Keys successfully fetched!',
|
||||
@@ -428,7 +429,7 @@ class MailServerManager:
|
||||
|
||||
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
|
||||
execPath = execPath + " generateKeys --domain " + domainName
|
||||
output = ProcessUtilities.outputExecutioner(shlex.split(execPath))
|
||||
output = ProcessUtilities.outputExecutioner(execPath)
|
||||
|
||||
admin = Administrator.objects.get(pk=userID)
|
||||
DNS.dnsTemplate(domainName, admin)
|
||||
@@ -444,7 +445,7 @@ class MailServerManager:
|
||||
|
||||
path = "/etc/opendkim/keys/" + domainName + "/default.txt"
|
||||
command = "sudo cat " + path
|
||||
output = ProcessUtilities.outputExecutioner(shlex.split(command))
|
||||
output = ProcessUtilities.outputExecutioner(command)
|
||||
leftIndex = output.index('(') + 2
|
||||
rightIndex = output.rindex(')') - 1
|
||||
|
||||
@@ -492,15 +493,14 @@ class MailServerManager:
|
||||
def installStatusOpenDKIM(self):
|
||||
try:
|
||||
command = "sudo cat " + mailUtilities.installLogPath
|
||||
installStatus = ProcessUtilities.outputExecutioner(shlex.split(command))
|
||||
installStatus = subprocess.check_output(shlex.split(command))
|
||||
|
||||
if installStatus.find("[200]") > -1:
|
||||
|
||||
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/mailUtilities.py"
|
||||
|
||||
execPath = execPath + " configureOpenDKIM"
|
||||
|
||||
output = ProcessUtilities.outputExecutioner(shlex.split(execPath))
|
||||
output = ProcessUtilities.outputExecutioner(execPath)
|
||||
|
||||
if output.find("1,None") > -1:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user