mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-09 23:06:16 +01:00
add further debugging to cpanel importerg
This commit is contained in:
@@ -116,6 +116,8 @@ Subject: %s
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def statusWriter(tempStatusPath, mesg, append = None):
|
def statusWriter(tempStatusPath, mesg, append = None):
|
||||||
try:
|
try:
|
||||||
|
if os.path.exists('/usr/local/CyberCP/debug'):
|
||||||
|
print(mesg)
|
||||||
if append == None:
|
if append == None:
|
||||||
statusFile = open(tempStatusPath, 'w')
|
statusFile = open(tempStatusPath, 'w')
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -71,10 +71,17 @@ class cPanelImporter:
|
|||||||
self.MainSite = value
|
self.MainSite = value
|
||||||
self.PHPVersion = value[9]
|
self.PHPVersion = value[9]
|
||||||
self.InheritPHP = self.PHPDecider(None)
|
self.InheritPHP = self.PHPDecider(None)
|
||||||
|
|
||||||
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
print(f'Main domain: {self.MainSite}, MainSite php version or version to be used for sites with no PHP {self.InheritPHP}')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.OtherDomainNames.append(key)
|
self.OtherDomainNames.append(key)
|
||||||
self.OtherDomains.append(value)
|
self.OtherDomains.append(value)
|
||||||
|
|
||||||
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
print(f'Other domains: {key}, Value {str(value)}')
|
||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
print(str(msg))
|
print(str(msg))
|
||||||
|
|
||||||
@@ -773,9 +780,18 @@ class cPanelImporter:
|
|||||||
|
|
||||||
####
|
####
|
||||||
|
|
||||||
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
logging.statusWriter(self.logFile, f'Content of user data before starting to restore emails {str(UserData)}')
|
||||||
|
|
||||||
|
|
||||||
for items in os.listdir(UserData):
|
for items in os.listdir(UserData):
|
||||||
|
|
||||||
FinalMailDomainPath = '%s/%s' % (UserData, items)
|
FinalMailDomainPath = '%s/%s' % (UserData, items)
|
||||||
|
|
||||||
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
logging.statusWriter(self.logFile,
|
||||||
|
f'Final email path for {items} is {str(FinalMailDomainPath)}')
|
||||||
|
|
||||||
if os.path.isdir(FinalMailDomainPath):
|
if os.path.isdir(FinalMailDomainPath):
|
||||||
if items[0] == '.':
|
if items[0] == '.':
|
||||||
continue
|
continue
|
||||||
@@ -804,6 +820,10 @@ class cPanelImporter:
|
|||||||
|
|
||||||
MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)
|
MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)
|
||||||
|
|
||||||
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
logging.statusWriter(self.logFile,
|
||||||
|
f'Mail path in backup for {items} is {str(MailPathInBackup)}')
|
||||||
|
|
||||||
command = 'mv %s %s/Maildir' % (MailPathInBackup, MailPath)
|
command = 'mv %s %s/Maildir' % (MailPathInBackup, MailPath)
|
||||||
subprocess.call(command, shell=True)
|
subprocess.call(command, shell=True)
|
||||||
|
|
||||||
@@ -819,6 +839,10 @@ class cPanelImporter:
|
|||||||
|
|
||||||
MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)
|
MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)
|
||||||
|
|
||||||
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
logging.statusWriter(self.logFile,
|
||||||
|
f'Mail path in backup for {items} is {str(MailPathInBackup)}')
|
||||||
|
|
||||||
command = 'mv %s %s/Mdbox' % (MailPathInBackup, MailPath)
|
command = 'mv %s %s/Mdbox' % (MailPathInBackup, MailPath)
|
||||||
subprocess.call(command, shell=True)
|
subprocess.call(command, shell=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user