mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-28 02:09:03 +01:00
bug fix: email limits, cPanel Importer: custom child domain path
This commit is contained in:
@@ -225,7 +225,24 @@ def getFurtherDomains(request):
|
||||
else:
|
||||
json_data = json_data +',' + json.dumps(dic)
|
||||
except BaseException, msg:
|
||||
pass
|
||||
try:
|
||||
domain = Domains.objects.get(domainOwner=items)
|
||||
except:
|
||||
domain = Domains(domainOwner=items, domain=items.domain)
|
||||
domain.save()
|
||||
|
||||
domainLimits = DomainLimits(domain=domain)
|
||||
domainLimits.save()
|
||||
|
||||
dic = {'domain': items.domain, 'emails': domain.eusers_set.all().count(),
|
||||
'monthlyLimit': domainLimits.monthlyLimit, 'monthlyUsed': domainLimits.monthlyUsed,
|
||||
'status': domainLimits.limitStatus}
|
||||
|
||||
if checker == 0:
|
||||
json_data = json_data + json.dumps(dic)
|
||||
checker = 1
|
||||
else:
|
||||
json_data = json_data + ',' + json.dumps(dic)
|
||||
|
||||
json_data = json_data + ']'
|
||||
final_dic = {'listWebSiteStatus': 1, 'error_message': "None", "data": json_data}
|
||||
|
||||
@@ -74,7 +74,6 @@ class cPanelImporter:
|
||||
if self.PHPVersion == '':
|
||||
self.PHPVersion = 'PHP 7.1'
|
||||
|
||||
|
||||
def SetupSSL(self, path, domain):
|
||||
|
||||
data = open(path, 'r').readlines()
|
||||
@@ -445,7 +444,12 @@ class cPanelImporter:
|
||||
else:
|
||||
movePath = '%s/homedir/%s' % (
|
||||
CompletPathToExtractedArchive, ChildDocRoot.split('/')[-1].replace(self.documentRoot, '', 1).replace('/', ''))
|
||||
shutil.move(movePath, path)
|
||||
if os.path.exists(movePath):
|
||||
shutil.move(movePath, path)
|
||||
else:
|
||||
movePath = '%s/homedir/%s' % (
|
||||
CompletPathToExtractedArchive, items.domain)
|
||||
shutil.move(movePath, path)
|
||||
|
||||
command = 'chown -R %s:%s %s' % (externalApp, externalApp, path)
|
||||
ProcessUtilities.normalExecutioner(command)
|
||||
|
||||
@@ -360,6 +360,19 @@ class Upgrade:
|
||||
|
||||
writeToFile.close()
|
||||
|
||||
command = "mkdir -p /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/"
|
||||
Upgrade.executioner(command, 'mkdir rainloop configs', 0)
|
||||
|
||||
labsPath = '/usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/application.ini'
|
||||
|
||||
labsData = """[labs]
|
||||
imap_folder_list_limit = 0
|
||||
"""
|
||||
|
||||
writeToFile = open(labsPath, 'w')
|
||||
writeToFile.write(labsData)
|
||||
writeToFile.close()
|
||||
|
||||
os.chdir(cwd)
|
||||
|
||||
except BaseException, msg:
|
||||
|
||||
Reference in New Issue
Block a user