Skip to content

Commit

Permalink
bug fix: email limits, cPanel Importer: custom child domain path
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Sep 2, 2019
1 parent 2405746 commit 74c1c66
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
19 changes: 18 additions & 1 deletion emailPremium/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
8 changes: 6 additions & 2 deletions plogical/cPanelImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def PHPDecider(self):
if self.PHPVersion == '':
self.PHPVersion = 'PHP 7.1'


def SetupSSL(self, path, domain):

data = open(path, 'r').readlines()
Expand Down Expand Up @@ -445,7 +444,12 @@ def CreateChildDomains(self):
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)
Expand Down
13 changes: 13 additions & 0 deletions plogical/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,19 @@ def downoad_and_install_raindloop():

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:
Expand Down

0 comments on commit 74c1c66

Please sign in to comment.