Skip to content

Commit 74c1c66

Browse files
committed
bug fix: email limits, cPanel Importer: custom child domain path
1 parent 2405746 commit 74c1c66

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

emailPremium/views.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,24 @@ def getFurtherDomains(request):
225225
else:
226226
json_data = json_data +',' + json.dumps(dic)
227227
except BaseException, msg:
228-
pass
228+
try:
229+
domain = Domains.objects.get(domainOwner=items)
230+
except:
231+
domain = Domains(domainOwner=items, domain=items.domain)
232+
domain.save()
233+
234+
domainLimits = DomainLimits(domain=domain)
235+
domainLimits.save()
236+
237+
dic = {'domain': items.domain, 'emails': domain.eusers_set.all().count(),
238+
'monthlyLimit': domainLimits.monthlyLimit, 'monthlyUsed': domainLimits.monthlyUsed,
239+
'status': domainLimits.limitStatus}
240+
241+
if checker == 0:
242+
json_data = json_data + json.dumps(dic)
243+
checker = 1
244+
else:
245+
json_data = json_data + ',' + json.dumps(dic)
229246

230247
json_data = json_data + ']'
231248
final_dic = {'listWebSiteStatus': 1, 'error_message': "None", "data": json_data}

plogical/cPanelImporter.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def PHPDecider(self):
7474
if self.PHPVersion == '':
7575
self.PHPVersion = 'PHP 7.1'
7676

77-
7877
def SetupSSL(self, path, domain):
7978

8079
data = open(path, 'r').readlines()
@@ -445,7 +444,12 @@ def CreateChildDomains(self):
445444
else:
446445
movePath = '%s/homedir/%s' % (
447446
CompletPathToExtractedArchive, ChildDocRoot.split('/')[-1].replace(self.documentRoot, '', 1).replace('/', ''))
448-
shutil.move(movePath, path)
447+
if os.path.exists(movePath):
448+
shutil.move(movePath, path)
449+
else:
450+
movePath = '%s/homedir/%s' % (
451+
CompletPathToExtractedArchive, items.domain)
452+
shutil.move(movePath, path)
449453

450454
command = 'chown -R %s:%s %s' % (externalApp, externalApp, path)
451455
ProcessUtilities.normalExecutioner(command)

plogical/upgrade.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,19 @@ def downoad_and_install_raindloop():
360360

361361
writeToFile.close()
362362

363+
command = "mkdir -p /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/"
364+
Upgrade.executioner(command, 'mkdir rainloop configs', 0)
365+
366+
labsPath = '/usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/application.ini'
367+
368+
labsData = """[labs]
369+
imap_folder_list_limit = 0
370+
"""
371+
372+
writeToFile = open(labsPath, 'w')
373+
writeToFile.write(labsData)
374+
writeToFile.close()
375+
363376
os.chdir(cwd)
364377

365378
except BaseException, msg:

0 commit comments

Comments
 (0)