mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
p3
This commit is contained in:
@@ -81,7 +81,7 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
|
|||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
message = "%s. [%s]" % (str(msg), '[ApacheController.checkIfApacheInstalled]')
|
message = "%s. [%s]" % (str(msg), '[ApacheController.checkIfApacheInstalled]')
|
||||||
logging.CyberCPLogFileWriter.writeToFile(message)
|
logging.CyberCPLogFileWriter.writeToFile(message)
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
|
|||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return str(msg)
|
return str(msg)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -302,5 +302,5 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
|
|||||||
return [0,result]
|
return [0,result]
|
||||||
|
|
||||||
return [1, 'None']
|
return [1, 'None']
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return [0, str(msg)]
|
return [0, str(msg)]
|
||||||
@@ -144,7 +144,7 @@ class ApacheVhost:
|
|||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
return [1, 'None']
|
return [1, 'None']
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return [0, str(msg)]
|
return [0, str(msg)]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -172,7 +172,7 @@ class ApacheVhost:
|
|||||||
confFile.close()
|
confFile.close()
|
||||||
|
|
||||||
return [1, 'None']
|
return [1, 'None']
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return [0, str(msg)]
|
return [0, str(msg)]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -183,7 +183,7 @@ class ApacheVhost:
|
|||||||
confFile.write("REWRITERULE ^(.*)$ HTTP://apachebackend/$1 [P]")
|
confFile.write("REWRITERULE ^(.*)$ HTTP://apachebackend/$1 [P]")
|
||||||
confFile.close()
|
confFile.close()
|
||||||
return [1, 'None']
|
return [1, 'None']
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return [0, str(msg)]
|
return [0, str(msg)]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -256,7 +256,7 @@ class ApacheVhost:
|
|||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
return [1, 'None']
|
return [1, 'None']
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return [0, str(msg)]
|
return [0, str(msg)]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -285,7 +285,7 @@ class ApacheVhost:
|
|||||||
command = "systemctl restart httpd"
|
command = "systemctl restart httpd"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -300,7 +300,7 @@ class ApacheVhost:
|
|||||||
confFile.write(currentConf)
|
confFile.write(currentConf)
|
||||||
confFile.close()
|
confFile.close()
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(
|
logging.writeToFile(
|
||||||
str(msg) + " [IO Error with per host config file [ApacheVhosts.perHostVirtualConf]]")
|
str(msg) + " [IO Error with per host config file [ApacheVhosts.perHostVirtualConf]]")
|
||||||
|
|
||||||
@@ -383,6 +383,6 @@ class ApacheVhost:
|
|||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
return 1
|
return 1
|
||||||
@@ -14,7 +14,7 @@ class BackupUtil:
|
|||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -25,9 +25,9 @@ class BackupUtil:
|
|||||||
try:
|
try:
|
||||||
smtpObj = smtplib.SMTP('127.0.0.1')
|
smtpObj = smtplib.SMTP('127.0.0.1')
|
||||||
smtpObj.sendmail(sender, receivers, message)
|
smtpObj.sendmail(sender, receivers, message)
|
||||||
print "Successfully sent email"
|
print("Successfully sent email")
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
print "Error: unable to send email %s" % str(msg)
|
print("Error: unable to send email %s" % str(msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def SyncHome():
|
def SyncHome():
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class CLManagerMain(multi.Thread):
|
|||||||
elif self.function == 'enableOrDisable':
|
elif self.function == 'enableOrDisable':
|
||||||
self.enableOrDisable()
|
self.enableOrDisable()
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [ContainerManager.run]')
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [ContainerManager.run]')
|
||||||
|
|
||||||
def renderC(self):
|
def renderC(self):
|
||||||
@@ -77,7 +77,7 @@ class CLManagerMain(multi.Thread):
|
|||||||
execPath = execPath + " --function submitCageFSInstall"
|
execPath = execPath + " --function submitCageFSInstall"
|
||||||
ProcessUtilities.outputExecutioner(execPath)
|
ProcessUtilities.outputExecutioner(execPath)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
||||||
|
|
||||||
def findWebsitesJson(self, currentACL, userID, pageNumber):
|
def findWebsitesJson(self, currentACL, userID, pageNumber):
|
||||||
@@ -144,7 +144,7 @@ class CLManagerMain(multi.Thread):
|
|||||||
'pagination': pagination, 'default': default}
|
'pagination': pagination, 'default': default}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
dic = {'status': 1, 'listWebSiteStatus': 0, 'error_message': str(msg)}
|
dic = {'status': 1, 'listWebSiteStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -160,7 +160,7 @@ class CLManagerMain(multi.Thread):
|
|||||||
for items in websites:
|
for items in websites:
|
||||||
command = '/usr/sbin/cagefsctl --disable %s' % (items.externalApp)
|
command = '/usr/sbin/cagefsctl --disable %s' % (items.externalApp)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
|
|
||||||
def fetchPackages(self, currentACL):
|
def fetchPackages(self, currentACL):
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class CLinuxPackages:
|
|||||||
try:
|
try:
|
||||||
clPackage = CLPackages.objects.get(owner=itemPackage)
|
clPackage = CLPackages.objects.get(owner=itemPackage)
|
||||||
statement = '%s %s' % (pwd.getpwnam(items.externalApp).pw_uid, clPackage.name)
|
statement = '%s %s' % (pwd.getpwnam(items.externalApp).pw_uid, clPackage.name)
|
||||||
print statement
|
print(statement)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ class CLinuxPackages:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def listPackages():
|
def listPackages():
|
||||||
for items in CLPackages.objects.all():
|
for items in CLPackages.objects.all():
|
||||||
print items.name
|
print(items.name)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def userIDPackage(user):
|
def userIDPackage(user):
|
||||||
@@ -36,7 +36,7 @@ class CLinuxPackages:
|
|||||||
itemPackage = website.package
|
itemPackage = website.package
|
||||||
try:
|
try:
|
||||||
clPackage = CLPackages.objects.get(owner=itemPackage)
|
clPackage = CLPackages.objects.get(owner=itemPackage)
|
||||||
print clPackage
|
print(clPackage)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ class CLinuxPackages:
|
|||||||
try:
|
try:
|
||||||
clPackage = CLPackages.objects.get(owner=itemPackage)
|
clPackage = CLPackages.objects.get(owner=itemPackage)
|
||||||
if clPackage.name == package:
|
if clPackage.name == package:
|
||||||
print pwd.getpwnam(items.externalApp).pw_uid
|
print(pwd.getpwnam(items.externalApp).pw_uid)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class CageFS:
|
|||||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
|
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
|
||||||
"Packages successfully installed.[200]\n", 1)
|
"Packages successfully installed.[200]\n", 1)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from packages.models import Package
|
from packages.models import Package
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.shortcuts import redirect, HttpResponse
|
from django.shortcuts import redirect, HttpResponse
|
||||||
from loginSystem.views import loadLoginPage
|
from loginSystem.views import loadLoginPage
|
||||||
@@ -43,7 +43,7 @@ def submitCageFSInstall(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -104,7 +104,7 @@ def enableOrDisable(request):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -169,7 +169,7 @@ def submitCreatePackage(request):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -213,7 +213,7 @@ def deleteCLPackage(request):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -266,7 +266,7 @@ def saveSettings(request):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -352,7 +352,7 @@ def getUsageData(request):
|
|||||||
final_json = json.dumps(finalData)
|
final_json = json.dumps(finalData)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg), 'cpu': 0, 'memory':0}
|
data_ret = {'status': 0, 'error_message': str(msg), 'cpu': 0, 'memory':0}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -48,7 +48,7 @@ class secMiddleware:
|
|||||||
try:
|
try:
|
||||||
#logging.writeToFile(request.body)
|
#logging.writeToFile(request.body)
|
||||||
data = json.loads(request.body)
|
data = json.loads(request.body)
|
||||||
for key, value in data.iteritems():
|
for key, value in data.items():
|
||||||
if request.path.find('gitNotify') > -1:
|
if request.path.find('gitNotify') > -1:
|
||||||
break
|
break
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ class secMiddleware:
|
|||||||
final_dic = {'error_message': "Data supplied is not accepted.", "errorMessage": "Data supplied is not accepted."}
|
final_dic = {'error_message': "Data supplied is not accepted.", "errorMessage": "Data supplied is not accepted."}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
response = self.get_response(request)
|
response = self.get_response(request)
|
||||||
return response
|
return response
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
metaFileXML.append(dnsRecordsXML)
|
metaFileXML.append(dnsRecordsXML)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, '%s. [158:prepMeta]' % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, '%s. [158:prepMeta]' % (str(msg)), 1)
|
||||||
|
|
||||||
## Email accounts XML
|
## Email accounts XML
|
||||||
@@ -176,7 +176,7 @@ class IncJobs(multi.Thread):
|
|||||||
emailRecordsXML.append(emailRecordXML)
|
emailRecordsXML.append(emailRecordXML)
|
||||||
|
|
||||||
metaFileXML.append(emailRecordsXML)
|
metaFileXML.append(emailRecordsXML)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(self.statusPath, '%s. [warning:179:prepMeta]' % (str(msg)), 1)
|
logging.writeToFile(self.statusPath, '%s. [warning:179:prepMeta]' % (str(msg)), 1)
|
||||||
|
|
||||||
## Email meta generated!
|
## Email meta generated!
|
||||||
@@ -196,7 +196,7 @@ class IncJobs(multi.Thread):
|
|||||||
metaFile = open(metaPath, 'w')
|
metaFile = open(metaPath, 'w')
|
||||||
metaFile.write(xmlpretty)
|
metaFile.write(xmlpretty)
|
||||||
metaFile.close()
|
metaFile.close()
|
||||||
os.chmod(metaPath, 0640)
|
os.chmod(metaPath, 0o640)
|
||||||
|
|
||||||
## meta generated
|
## meta generated
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, "%s [207][5009]" % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, "%s [207][5009]" % (str(msg)), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -239,7 +239,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
logging.statusWriter(self.statusPath, 'Data for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
logging.statusWriter(self.statusPath, 'Data for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath,'%s. [IncJobs.backupData.223][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath,'%s. [IncJobs.backupData.223][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ class IncJobs(multi.Thread):
|
|||||||
destination=self.backupDestinations)
|
destination=self.backupDestinations)
|
||||||
newSnapshot.save()
|
newSnapshot.save()
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath,'%s. [IncJobs.backupDatabases.269][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath,'%s. [IncJobs.backupDatabases.269][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
logging.statusWriter(self.statusPath, 'Emails for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
logging.statusWriter(self.statusPath, 'Emails for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath,'%s. [IncJobs.backupDatabases.269][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath,'%s. [IncJobs.backupDatabases.269][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -323,7 +323,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
logging.statusWriter(self.statusPath, 'Repo %s initiated for %s.' % (self.backupDestinations, self.website.domain), 1)
|
logging.statusWriter(self.statusPath, 'Repo %s initiated for %s.' % (self.backupDestinations, self.website.domain), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath,'%s. [IncJobs.initiateRepo.47][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath,'%s. [IncJobs.initiateRepo.47][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class IncJobs(multi.Thread):
|
|||||||
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
|
|
||||||
####
|
####
|
||||||
@@ -163,7 +163,7 @@ class IncJobs(multi.Thread):
|
|||||||
logging.statusWriter(self.statusPath, result, 1)
|
logging.statusWriter(self.statusPath, result, 1)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, "%s [88][5009]" % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, "%s [88][5009]" % (str(msg)), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ class IncJobs(multi.Thread):
|
|||||||
else:
|
else:
|
||||||
self.awsFunction('restore', '', self.jobid.snapshotid)
|
self.awsFunction('restore', '', self.jobid.snapshotid)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, "%s [138][5009]" % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, "%s [138][5009]" % (str(msg)), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -274,10 +274,10 @@ class IncJobs(multi.Thread):
|
|||||||
os.remove('/home/cyberpanel/%s' % (self.path.split('/')[-1]))
|
os.remove('/home/cyberpanel/%s' % (self.path.split('/')[-1]))
|
||||||
else:
|
else:
|
||||||
os.remove('/home/cyberpanel/%s.sql' % (self.jobid.type.split(':')[1]))
|
os.remove('/home/cyberpanel/%s.sql' % (self.jobid.type.split(':')[1]))
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, "%s [160][5009]" % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, "%s [160][5009]" % (str(msg)), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -297,7 +297,7 @@ class IncJobs(multi.Thread):
|
|||||||
else:
|
else:
|
||||||
self.awsFunction('restore', '', self.jobid.snapshotid)
|
self.awsFunction('restore', '', self.jobid.snapshotid)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, "%s [46][5009]" % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, "%s [46][5009]" % (str(msg)), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -328,7 +328,7 @@ class IncJobs(multi.Thread):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, "%s [46][5009]" % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, "%s [46][5009]" % (str(msg)), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ class IncJobs(multi.Thread):
|
|||||||
logging.statusWriter(self.statusPath, message, 1)
|
logging.statusWriter(self.statusPath, message, 1)
|
||||||
|
|
||||||
logging.statusWriter(self.statusPath, 'Completed', 1)
|
logging.statusWriter(self.statusPath, 'Completed', 1)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.extraArgs['tempPath'], str(msg), 1)
|
logging.statusWriter(self.extraArgs['tempPath'], str(msg), 1)
|
||||||
|
|
||||||
### Backup functions
|
### Backup functions
|
||||||
@@ -520,7 +520,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
metaFileXML.append(dnsRecordsXML)
|
metaFileXML.append(dnsRecordsXML)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, '%s. [158:prepMeta]' % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, '%s. [158:prepMeta]' % (str(msg)), 1)
|
||||||
|
|
||||||
## Email accounts XML
|
## Email accounts XML
|
||||||
@@ -541,7 +541,7 @@ class IncJobs(multi.Thread):
|
|||||||
emailRecordsXML.append(emailRecordXML)
|
emailRecordsXML.append(emailRecordXML)
|
||||||
|
|
||||||
metaFileXML.append(emailRecordsXML)
|
metaFileXML.append(emailRecordsXML)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, '%s. [warning:179:prepMeta]' % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, '%s. [warning:179:prepMeta]' % (str(msg)), 1)
|
||||||
|
|
||||||
## Email meta generated!
|
## Email meta generated!
|
||||||
@@ -561,7 +561,7 @@ class IncJobs(multi.Thread):
|
|||||||
metaFile = open(metaPath, 'w')
|
metaFile = open(metaPath, 'w')
|
||||||
metaFile.write(xmlpretty)
|
metaFile.write(xmlpretty)
|
||||||
metaFile.close()
|
metaFile.close()
|
||||||
os.chmod(metaPath, 0640)
|
os.chmod(metaPath, 0o640)
|
||||||
|
|
||||||
## meta generated
|
## meta generated
|
||||||
|
|
||||||
@@ -573,7 +573,7 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, "%s [207][5009]" % (str(msg)), 1)
|
logging.statusWriter(self.statusPath, "%s [207][5009]" % (str(msg)), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -592,7 +592,7 @@ class IncJobs(multi.Thread):
|
|||||||
logging.statusWriter(self.statusPath,
|
logging.statusWriter(self.statusPath,
|
||||||
'Data for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
'Data for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, '%s. [IncJobs.backupData.223][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath, '%s. [IncJobs.backupData.223][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -617,11 +617,11 @@ class IncJobs(multi.Thread):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
os.remove('/home/cyberpanel/%s.sql' % (items.dbName))
|
os.remove('/home/cyberpanel/%s.sql' % (items.dbName))
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath,
|
logging.statusWriter(self.statusPath,
|
||||||
'Failed to delete database: %s. [IncJobs.backupDatabases.456]' % str(msg), 1)
|
'Failed to delete database: %s. [IncJobs.backupDatabases.456]' % str(msg), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, '%s. [IncJobs.backupDatabases.269][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath, '%s. [IncJobs.backupDatabases.269][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -641,7 +641,7 @@ class IncJobs(multi.Thread):
|
|||||||
logging.statusWriter(self.statusPath,
|
logging.statusWriter(self.statusPath,
|
||||||
'Emails for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
'Emails for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, '%s. [IncJobs.emailBackup.269][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath, '%s. [IncJobs.emailBackup.269][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -661,7 +661,7 @@ class IncJobs(multi.Thread):
|
|||||||
logging.statusWriter(self.statusPath,
|
logging.statusWriter(self.statusPath,
|
||||||
'Meta for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
'Meta for %s backed to %s.' % (self.website.domain, self.backupDestinations), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, '%s. [IncJobs.metaBackup.269][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath, '%s. [IncJobs.metaBackup.269][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -691,7 +691,7 @@ class IncJobs(multi.Thread):
|
|||||||
logging.statusWriter(self.statusPath,
|
logging.statusWriter(self.statusPath,
|
||||||
'Repo %s initiated for %s.' % (self.backupDestinations, self.website.domain), 1)
|
'Repo %s initiated for %s.' % (self.backupDestinations, self.website.domain), 1)
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath, '%s. [IncJobs.initiateRepo.47][5009]' % str(msg), 1)
|
logging.statusWriter(self.statusPath, '%s. [IncJobs.initiateRepo.47][5009]' % str(msg), 1)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -763,7 +763,7 @@ Subject: %s
|
|||||||
try:
|
try:
|
||||||
command = 'rm -f %s' % (metaPathNew)
|
command = 'rm -f %s' % (metaPathNew)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.statusWriter(self.statusPath,
|
logging.statusWriter(self.statusPath,
|
||||||
'Failed to delete meta file: %s. [IncJobs.createBackup.591]' % str(msg), 1)
|
'Failed to delete meta file: %s. [IncJobs.createBackup.591]' % str(msg), 1)
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class IncScheduler():
|
|||||||
|
|
||||||
logging.statusWriter(IncScheduler.logPath, 'Failed backup for %s, error: %s.' % (web.website, result), 1)
|
logging.statusWriter(IncScheduler.logPath, 'Failed backup for %s, error: %s.' % (web.website, result), 1)
|
||||||
break
|
break
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from websiteFunctions.models import Websites
|
from websiteFunctions.models import Websites
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class restoreMeta():
|
|||||||
|
|
||||||
virtualHostUtilities.createDomain(masterDomain, domain, phpSelection, path, 0, 0, 0,
|
virtualHostUtilities.createDomain(masterDomain, domain, phpSelection, path, 0, 0, 0,
|
||||||
'admin', 0)
|
'admin', 0)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg) + " [startRestore]")
|
logging.writeToFile(str(msg) + " [startRestore]")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ class restoreMeta():
|
|||||||
'Email created: %s' % (
|
'Email created: %s' % (
|
||||||
email))
|
email))
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg) + " [startRestore]")
|
logging.writeToFile(str(msg) + " [startRestore]")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ class restoreMeta():
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg) + " [startRestore]")
|
logging.writeToFile(str(msg) + " [startRestore]")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from plogical.acl import ACLManager
|
from plogical.acl import ACLManager
|
||||||
@@ -48,7 +48,7 @@ def createBackup(request):
|
|||||||
destinations.append('s3:s3.amazonaws.com/%s' % (items))
|
destinations.append('s3:s3.amazonaws.com/%s' % (items))
|
||||||
|
|
||||||
return defRenderer(request, 'IncBackups/createBackup.html', {'websiteList': websitesName, 'destinations': destinations})
|
return defRenderer(request, 'IncBackups/createBackup.html', {'websiteList': websitesName, 'destinations': destinations})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ def backupDestinations(request):
|
|||||||
return ACLManager.loadError()
|
return ACLManager.loadError()
|
||||||
|
|
||||||
return defRenderer(request, 'IncBackups/incrementalDestinations.html', {})
|
return defRenderer(request, 'IncBackups/incrementalDestinations.html', {})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ def addDestination(request):
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -235,7 +235,7 @@ def populateCurrentRecords(request):
|
|||||||
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -264,7 +264,7 @@ def removeDestination(request):
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'destStatus': 0, 'error_message': str(msg)}
|
final_dic = {'destStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -337,7 +337,7 @@ def fetchCurrentBackups(request):
|
|||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -398,7 +398,7 @@ def submitBackupCreation(request):
|
|||||||
final_json = json.dumps({'status': 1, 'error_message': "None", 'tempPath': tempPath})
|
final_json = json.dumps({'status': 1, 'error_message': "None", 'tempPath': tempPath})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
final_dic = {'status': 0, 'metaStatus': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'metaStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
@@ -456,7 +456,7 @@ def getBackupStatus(request):
|
|||||||
final_json = json.dumps({'backupStatus': 1, 'error_message': "None", "status": 1, "abort": 0})
|
final_json = json.dumps({'backupStatus': 1, 'error_message': "None", "status": 1, "abort": 0})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'backupStatus': 0, 'error_message': str(msg)}
|
final_dic = {'backupStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
logging.writeToFile(str(msg) + " [backupStatus]")
|
logging.writeToFile(str(msg) + " [backupStatus]")
|
||||||
@@ -483,7 +483,7 @@ def deleteBackup(request):
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'destStatus': 0, 'error_message': str(msg)}
|
final_dic = {'destStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -528,7 +528,7 @@ def fetchRestorePoints(request):
|
|||||||
json_data = json_data + ']'
|
json_data = json_data + ']'
|
||||||
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -576,7 +576,7 @@ def restorePoint(request):
|
|||||||
final_json = json.dumps({'status': 1, 'error_message': "None", 'tempPath': tempPath})
|
final_json = json.dumps({'status': 1, 'error_message': "None", 'tempPath': tempPath})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
final_dic = {'status': 0, 'metaStatus': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'metaStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
@@ -607,7 +607,7 @@ def scheduleBackups(request):
|
|||||||
destinations.append('s3:s3.amazonaws.com/%s' % (items))
|
destinations.append('s3:s3.amazonaws.com/%s' % (items))
|
||||||
|
|
||||||
return defRenderer(request, 'IncBackups/backupSchedule.html', {'websiteList': websitesName, 'destinations': destinations})
|
return defRenderer(request, 'IncBackups/backupSchedule.html', {'websiteList': websitesName, 'destinations': destinations})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
@@ -657,7 +657,7 @@ def submitBackupSchedule(request):
|
|||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_json = json.dumps({'status': 0, 'error_message': str(msg)})
|
final_json = json.dumps({'status': 0, 'error_message': str(msg)})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
@@ -690,7 +690,7 @@ def getCurrentBackupSchedules(request):
|
|||||||
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -713,7 +713,7 @@ def scheduleDelete(request):
|
|||||||
final_json = json.dumps({'status': 1, 'error_message': "None"})
|
final_json = json.dumps({'status': 1, 'error_message': "None"})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_json = json.dumps({'status': 0, 'error_message': str(msg)})
|
final_json = json.dumps({'status': 0, 'error_message': str(msg)})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
@@ -741,6 +741,6 @@ def restoreRemoteBackups(request):
|
|||||||
destinations.append('s3:s3.amazonaws.com/%s' % (items))
|
destinations.append('s3:s3.amazonaws.com/%s' % (items))
|
||||||
|
|
||||||
return defRenderer(request, 'IncBackups/restoreRemoteBackups.html', {'websiteList': websitesName, 'destinations': destinations})
|
return defRenderer(request, 'IncBackups/restoreRemoteBackups.html', {'websiteList': websitesName, 'destinations': destinations})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
@@ -82,14 +82,14 @@ class SSHServer(multi.Thread):
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
try:
|
try:
|
||||||
self.recvData()
|
self.recvData()
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
print(str(msg))
|
print((str(msg)))
|
||||||
|
|
||||||
|
|
||||||
class WebTerminalServer(WebSocket):
|
class WebTerminalServer(WebSocket):
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.shortcuts import render, redirect, HttpResponse
|
from django.shortcuts import render, redirect, HttpResponse
|
||||||
from plogical.acl import ACLManager
|
from plogical.acl import ACLManager
|
||||||
@@ -49,7 +49,7 @@ def terminal(request):
|
|||||||
newFWRule.save()
|
newFWRule.save()
|
||||||
|
|
||||||
return render(request, 'WebTerminal/WebTerminal.html', {'verifyPath': verifyPath, 'password': password})
|
return render(request, 'WebTerminal/WebTerminal.html', {'verifyPath': verifyPath, 'password': password})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ def restart(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
import json
|
import json
|
||||||
|
|||||||
32
api/views.py
32
api/views.py
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
import json
|
import json
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
@@ -46,7 +46,7 @@ def verifyConn(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'verifyConn': 0, 'error_message': str(msg)}
|
data_ret = {'verifyConn': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -107,7 +107,7 @@ def getUserInfo(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -150,7 +150,7 @@ def changeUserPassAPI(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'changeStatus': 0, 'error_message': str(msg)}
|
data_ret = {'changeStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -195,7 +195,7 @@ def changePackageAPI(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'changePackage': 0, 'error_message': str(msg)}
|
data_ret = {'changePackage': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -240,7 +240,7 @@ def deleteWebsite(request):
|
|||||||
wm = WebsiteManager()
|
wm = WebsiteManager()
|
||||||
return wm.submitWebsiteDeletion(admin.pk, data)
|
return wm.submitWebsiteDeletion(admin.pk, data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'websiteDeleteStatus': 0, 'error_message': str(msg)}
|
data_ret = {'websiteDeleteStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -271,7 +271,7 @@ def submitWebsiteStatus(request):
|
|||||||
wm = WebsiteManager()
|
wm = WebsiteManager()
|
||||||
return wm.submitWebsiteStatus(admin.pk, json.loads(request.body))
|
return wm.submitWebsiteStatus(admin.pk, json.loads(request.body))
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'websiteStatus': 0, 'error_message': str(msg)}
|
data_ret = {'websiteStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -295,7 +295,7 @@ def loginAPI(request):
|
|||||||
else:
|
else:
|
||||||
return HttpResponse("Invalid Credentials.")
|
return HttpResponse("Invalid Credentials.")
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data = {'userID': 0, 'loginStatus': 0, 'error_message': str(msg)}
|
data = {'userID': 0, 'loginStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -338,7 +338,7 @@ def fetchSSHkey(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data = {'status' : 0, 'pubKeyStatus': 0,'error_message': str(msg)}
|
data = {'status' : 0, 'pubKeyStatus': 0,'error_message': str(msg)}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -390,7 +390,7 @@ def remoteTransfer(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data = {'transferStatus': 0,'error_message': str(msg)}
|
data = {'transferStatus': 0,'error_message': str(msg)}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -440,7 +440,7 @@ def fetchAccountsFromRemoteServer(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data = {'fetchStatus': 0,'error_message': str(msg)}
|
data = {'fetchStatus': 0,'error_message': str(msg)}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -481,7 +481,7 @@ def FetchRemoteTransferStatus(request):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data = {'fetchStatus': 0,'error_message': str(msg)}
|
data = {'fetchStatus': 0,'error_message': str(msg)}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -528,7 +528,7 @@ def cancelRemoteTransfer(request):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data = {'cancelStatus': 1, 'error_message': str(msg)}
|
data = {'cancelStatus': 1, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -572,7 +572,7 @@ def cyberPanelVersion(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {
|
data_ret = {
|
||||||
"getVersion": 0,
|
"getVersion": 0,
|
||||||
'error_message': str(msg)
|
'error_message': str(msg)
|
||||||
@@ -590,7 +590,7 @@ def runAWSBackups(request):
|
|||||||
if os.path.exists(randomFile):
|
if os.path.exists(randomFile):
|
||||||
s3 = S3Backups(request, None, 'runAWSBackups')
|
s3 = S3Backups(request, None, 'runAWSBackups')
|
||||||
s3.start()
|
s3.start()
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg) + ' [API.runAWSBackups]')
|
logging.writeToFile(str(msg) + ' [API.runAWSBackups]')
|
||||||
|
|
||||||
|
|
||||||
@@ -620,7 +620,7 @@ def submitUserCreation(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'changeStatus': 0, 'error_message': str(msg)}
|
data_ret = {'changeStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from .models import DBUsers
|
from .models import DBUsers
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class BackupManager:
|
|||||||
try:
|
try:
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
return render(request, 'backup/index.html', currentACL)
|
return render(request, 'backup/index.html', currentACL)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def backupSite(self, request = None, userID = None, data = None):
|
def backupSite(self, request = None, userID = None, data = None):
|
||||||
@@ -45,7 +45,7 @@ class BackupManager:
|
|||||||
|
|
||||||
websitesName = ACLManager.findAllSites(currentACL, userID)
|
websitesName = ACLManager.findAllSites(currentACL, userID)
|
||||||
return render(request, 'backup/backup.html', {'websiteList': websitesName})
|
return render(request, 'backup/backup.html', {'websiteList': websitesName})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def restoreSite(self, request = None, userID = None, data = None):
|
def restoreSite(self, request = None, userID = None, data = None):
|
||||||
@@ -73,7 +73,7 @@ class BackupManager:
|
|||||||
|
|
||||||
return render(request, 'backup/restore.html', {'backups': all_files})
|
return render(request, 'backup/restore.html', {'backups': all_files})
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def getCurrentBackups(self, userID = None, data = None):
|
def getCurrentBackups(self, userID = None, data = None):
|
||||||
@@ -120,7 +120,7 @@ class BackupManager:
|
|||||||
json_data = json_data + ']'
|
json_data = json_data + ']'
|
||||||
final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'fetchStatus': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'fetchStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -157,7 +157,7 @@ class BackupManager:
|
|||||||
final_json = json.dumps({'status': 1, 'metaStatus': 1, 'error_message': "None", 'tempStorage': tempStoragePath})
|
final_json = json.dumps({'status': 1, 'metaStatus': 1, 'error_message': "None", 'tempStorage': tempStoragePath})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
final_dic = {'status': 0, 'metaStatus': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'metaStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
@@ -240,7 +240,7 @@ class BackupManager:
|
|||||||
final_json = json.dumps({'backupStatus': 0, 'error_message': "None", "status": 0, "abort": 0})
|
final_json = json.dumps({'backupStatus': 0, 'error_message': "None", "status": 0, "abort": 0})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'backupStatus': 0, 'error_message': str(msg)}
|
final_dic = {'backupStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [backupStatus]")
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [backupStatus]")
|
||||||
@@ -259,13 +259,13 @@ class BackupManager:
|
|||||||
try:
|
try:
|
||||||
backupOb = Backups.objects.get(fileName=fileName)
|
backupOb = Backups.objects.get(fileName=fileName)
|
||||||
backupOb.delete()
|
backupOb.delete()
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [cancelBackupCreation]")
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [cancelBackupCreation]")
|
||||||
|
|
||||||
final_json = json.dumps({'abortStatus': 1, 'error_message': "None", "status": 0})
|
final_json = json.dumps({'abortStatus': 1, 'error_message': "None", "status": 0})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'abortStatus': 0, 'error_message': str(msg)}
|
final_dic = {'abortStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -291,7 +291,7 @@ class BackupManager:
|
|||||||
|
|
||||||
final_json = json.dumps({'status': 1, 'deleteStatus': 1, 'error_message': "None"})
|
final_json = json.dumps({'status': 1, 'deleteStatus': 1, 'error_message': "None"})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'deleteStatus': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'deleteStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
|
|
||||||
@@ -321,7 +321,7 @@ class BackupManager:
|
|||||||
final_dic = {'restoreStatus': 1, 'error_message': "None"}
|
final_dic = {'restoreStatus': 1, 'error_message': "None"}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'restoreStatus': 0, 'error_message': str(msg)}
|
final_dic = {'restoreStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -368,7 +368,7 @@ class BackupManager:
|
|||||||
'running': 'Running..'})
|
'running': 'Running..'})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
status = "Just Started"
|
status = "Just Started"
|
||||||
final_json = json.dumps(
|
final_json = json.dumps(
|
||||||
@@ -381,7 +381,7 @@ class BackupManager:
|
|||||||
'abort': 1})
|
'abort': 1})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'restoreStatus': 0, 'error_message': str(msg)}
|
final_dic = {'restoreStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -395,7 +395,7 @@ class BackupManager:
|
|||||||
|
|
||||||
return render(request, 'backup/backupDestinations.html', {})
|
return render(request, 'backup/backupDestinations.html', {})
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def submitDestinationCreation(self, userID = None, data = None):
|
def submitDestinationCreation(self, userID = None, data = None):
|
||||||
@@ -457,7 +457,7 @@ class BackupManager:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'destStatus': 0, 'error_message': str(msg)}
|
final_dic = {'destStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -492,7 +492,7 @@ class BackupManager:
|
|||||||
final_json = json.dumps({'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
final_json = json.dumps({'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'fetchStatus': 0, 'error_message': str(msg)}
|
final_dic = {'fetchStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -520,7 +520,7 @@ class BackupManager:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'connStatus': 1, 'error_message': str(msg)}
|
final_dic = {'connStatus': 1, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -573,7 +573,7 @@ class BackupManager:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'delStatus': 1, 'error_message': str(msg)}
|
final_dic = {'delStatus': 1, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -600,7 +600,7 @@ class BackupManager:
|
|||||||
|
|
||||||
return render(request, 'backup/backupSchedule.html', {'destinations': destinations})
|
return render(request, 'backup/backupSchedule.html', {'destinations': destinations})
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def getCurrentBackupSchedules(self, userID = None, data = None):
|
def getCurrentBackupSchedules(self, userID = None, data = None):
|
||||||
@@ -631,7 +631,7 @@ class BackupManager:
|
|||||||
final_json = json.dumps({'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
final_json = json.dumps({'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'fetchStatus': 0, 'error_message': str(msg)}
|
final_dic = {'fetchStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -741,7 +741,7 @@ class BackupManager:
|
|||||||
final_json = json.dumps({'scheduleStatus': 1, 'error_message': "None"})
|
final_json = json.dumps({'scheduleStatus': 1, 'error_message': "None"})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_json = json.dumps({'scheduleStatus': 0, 'error_message': str(msg)})
|
final_json = json.dumps({'scheduleStatus': 0, 'error_message': str(msg)})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
@@ -802,7 +802,7 @@ class BackupManager:
|
|||||||
final_json = json.dumps({'delStatus': 1, 'error_message': "None"})
|
final_json = json.dumps({'delStatus': 1, 'error_message': "None"})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_json = json.dumps({'delStatus': 0, 'error_message': str(msg)})
|
final_json = json.dumps({'delStatus': 0, 'error_message': str(msg)})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
@@ -815,7 +815,7 @@ class BackupManager:
|
|||||||
|
|
||||||
return render(request, 'backup/remoteBackups.html')
|
return render(request, 'backup/remoteBackups.html')
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def submitRemoteBackups(self, userID = None, data = None):
|
def submitRemoteBackups(self, userID = None, data = None):
|
||||||
@@ -858,7 +858,7 @@ class BackupManager:
|
|||||||
return HttpResponse(data_ret)
|
return HttpResponse(data_ret)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0,
|
data_ret = {'status': 0,
|
||||||
'error_message': "Not able to fetch version of remote server. Error Message: " + str(
|
'error_message': "Not able to fetch version of remote server. Error Message: " + str(
|
||||||
msg),
|
msg),
|
||||||
@@ -930,14 +930,14 @@ class BackupManager:
|
|||||||
data['error_message'], "dir": "Null"}
|
data['error_message'], "dir": "Null"}
|
||||||
data_ret = json.dumps(data_ret)
|
data_ret = json.dumps(data_ret)
|
||||||
return HttpResponse(data_ret)
|
return HttpResponse(data_ret)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0,
|
data_ret = {'status': 0,
|
||||||
'error_message': "Not able to fetch accounts from remote server. Error Message: " + str(
|
'error_message': "Not able to fetch accounts from remote server. Error Message: " + str(
|
||||||
msg), "dir": "Null"}
|
msg), "dir": "Null"}
|
||||||
data_ret = json.dumps(data_ret)
|
data_ret = json.dumps(data_ret)
|
||||||
return HttpResponse(data_ret)
|
return HttpResponse(data_ret)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_json = json.dumps({'status': 0, 'error_message': str(msg)})
|
final_json = json.dumps({'status': 0, 'error_message': str(msg)})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
@@ -995,13 +995,13 @@ class BackupManager:
|
|||||||
data['error_message']})
|
data['error_message']})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_json = json.dumps({'remoteTransferStatus': 0,
|
final_json = json.dumps({'remoteTransferStatus': 0,
|
||||||
'error_message': "Can not initiate remote transfer. Error message: " +
|
'error_message': "Can not initiate remote transfer. Error message: " +
|
||||||
str(msg)})
|
str(msg)})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_json = json.dumps({'remoteTransferStatus': 0, 'error_message': str(msg)})
|
final_json = json.dumps({'remoteTransferStatus': 0, 'error_message': str(msg)})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
@@ -1045,7 +1045,7 @@ class BackupManager:
|
|||||||
'backupsSent': 0}
|
'backupsSent': 0}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data = {'remoteTransferStatus': 0, 'error_message': str(msg), 'backupsSent': 0}
|
data = {'remoteTransferStatus': 0, 'error_message': str(msg), 'backupsSent': 0}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -1075,7 +1075,7 @@ class BackupManager:
|
|||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data = {'remoteRestoreStatus': 0, 'error_message': str(msg)}
|
data = {'remoteRestoreStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -1122,7 +1122,7 @@ class BackupManager:
|
|||||||
"complete": 0}
|
"complete": 0}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data = {'remoteTransferStatus': 0, 'error_message': str(msg), "status": "None", "complete": 0}
|
data = {'remoteTransferStatus': 0, 'error_message': str(msg), "status": "None", "complete": 0}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -1168,7 +1168,7 @@ class BackupManager:
|
|||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data = {'cancelStatus': 0, 'error_message': str(msg)}
|
data = {'cancelStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data)
|
json_data = json.dumps(data)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
import json
|
import json
|
||||||
@@ -61,7 +61,7 @@ def submitBackupCreation(request):
|
|||||||
|
|
||||||
return coreResult
|
return coreResult
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
|
|
||||||
|
|
||||||
@@ -337,5 +337,5 @@ def localInitiate(request):
|
|||||||
if os.path.exists(randomFile):
|
if os.path.exists(randomFile):
|
||||||
wm = BackupManager()
|
wm = BackupManager()
|
||||||
return wm.submitBackupCreation(1, json.loads(request.body))
|
return wm.submitBackupCreation(1, json.loads(request.body))
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.shortcuts import render,redirect
|
from django.shortcuts import render,redirect
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
@@ -199,7 +199,7 @@ def upgradeStatus(request):
|
|||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
final_dic = {'upgradeStatus': 0, 'error_message': str(msg)}
|
final_dic = {'upgradeStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -217,6 +217,6 @@ def upgradeVersion(request):
|
|||||||
vers.build = latest['build']
|
vers.build = latest['build']
|
||||||
vers.save()
|
vers.save()
|
||||||
return HttpResponse("Version upgrade OK.")
|
return HttpResponse("Version upgrade OK.")
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
@@ -24,5 +24,5 @@ class cliLogger:
|
|||||||
|
|
||||||
return lastFewLines
|
return lastFewLines
|
||||||
|
|
||||||
except subprocess.CalledProcessError,msg:
|
except subprocess.CalledProcessError as msg:
|
||||||
return "File was empty"
|
return "File was empty"
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class cyberPanel:
|
|||||||
data = json.dumps({'success': operationStatus,
|
data = json.dumps({'success': operationStatus,
|
||||||
'errorMessage': errorMessage
|
'errorMessage': errorMessage
|
||||||
})
|
})
|
||||||
print data
|
print(data)
|
||||||
|
|
||||||
## Website Functions
|
## Website Functions
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ class cyberPanel:
|
|||||||
else:
|
else:
|
||||||
self.printStatus(0, result[1])
|
self.printStatus(0, result[1])
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ class cyberPanel:
|
|||||||
else:
|
else:
|
||||||
self.printStatus(0, result[1])
|
self.printStatus(0, result[1])
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -77,9 +77,9 @@ class cyberPanel:
|
|||||||
vhost.deleteVirtualHostConfigurations(domainName)
|
vhost.deleteVirtualHostConfigurations(domainName)
|
||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def deleteChild(self, childDomain):
|
def deleteChild(self, childDomain):
|
||||||
try:
|
try:
|
||||||
@@ -91,9 +91,9 @@ class cyberPanel:
|
|||||||
else:
|
else:
|
||||||
self.printStatus(0, result[1])
|
self.printStatus(0, result[1])
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def listWebsitesJson(self):
|
def listWebsitesJson(self):
|
||||||
try:
|
try:
|
||||||
@@ -122,11 +122,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
json_data = json_data + ']'
|
json_data = json_data + ']'
|
||||||
final_json = json.dumps(json_data)
|
final_json = json.dumps(json_data)
|
||||||
print final_json
|
print(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def listWebsitesPretty(self):
|
def listWebsitesPretty(self):
|
||||||
try:
|
try:
|
||||||
@@ -146,11 +146,11 @@ class cyberPanel:
|
|||||||
else:
|
else:
|
||||||
state = "Active"
|
state = "Active"
|
||||||
table.add_row([items.id, items.domain, ipAddress, items.package.packageName, items.admin.userName, state, items.adminEmail])
|
table.add_row([items.id, items.domain, ipAddress, items.package.packageName, items.admin.userName, state, items.adminEmail])
|
||||||
print table
|
print(table)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def changePHP(self, virtualHostName, phpVersion):
|
def changePHP(self, virtualHostName, phpVersion):
|
||||||
try:
|
try:
|
||||||
@@ -167,7 +167,7 @@ class cyberPanel:
|
|||||||
else:
|
else:
|
||||||
self.printStatus(0, result[1])
|
self.printStatus(0, result[1])
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ class cyberPanel:
|
|||||||
|
|
||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -218,11 +218,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
json_data = json_data + ']'
|
json_data = json_data + ']'
|
||||||
final_json = json.dumps(json_data)
|
final_json = json.dumps(json_data)
|
||||||
print final_json
|
print(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def listDNSPretty(self, virtualHostName):
|
def listDNSPretty(self, virtualHostName):
|
||||||
try:
|
try:
|
||||||
@@ -237,11 +237,11 @@ class cyberPanel:
|
|||||||
else:
|
else:
|
||||||
content = items.content
|
content = items.content
|
||||||
table.add_row([items.id, items.type, items.name, content, items.prio, items.ttl])
|
table.add_row([items.id, items.type, items.name, content, items.prio, items.ttl])
|
||||||
print table
|
print(table)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def listDNSZonesJson(self):
|
def listDNSZonesJson(self):
|
||||||
try:
|
try:
|
||||||
@@ -264,11 +264,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
json_data = json_data + ']'
|
json_data = json_data + ']'
|
||||||
final_json = json.dumps(json_data)
|
final_json = json.dumps(json_data)
|
||||||
print final_json
|
print(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def listDNSZonesPretty(self):
|
def listDNSZonesPretty(self):
|
||||||
try:
|
try:
|
||||||
@@ -280,18 +280,18 @@ class cyberPanel:
|
|||||||
|
|
||||||
for items in records:
|
for items in records:
|
||||||
table.add_row([items.id, items.name])
|
table.add_row([items.id, items.name])
|
||||||
print table
|
print(table)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def createDNSZone(self, virtualHostName, owner):
|
def createDNSZone(self, virtualHostName, owner):
|
||||||
try:
|
try:
|
||||||
admin = Administrator.objects.get(userName=owner)
|
admin = Administrator.objects.get(userName=owner)
|
||||||
DNS.dnsTemplate(virtualHostName, admin)
|
DNS.dnsTemplate(virtualHostName, admin)
|
||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ class cyberPanel:
|
|||||||
zone = DNS.getZoneObject(virtualHostName)
|
zone = DNS.getZoneObject(virtualHostName)
|
||||||
DNS.createDNSRecord(zone, name, recordType, value, int(priority), int(ttl))
|
DNS.createDNSRecord(zone, name, recordType, value, int(priority), int(ttl))
|
||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -308,7 +308,7 @@ class cyberPanel:
|
|||||||
try:
|
try:
|
||||||
DNS.deleteDNSZone(virtualHostName)
|
DNS.deleteDNSZone(virtualHostName)
|
||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -316,7 +316,7 @@ class cyberPanel:
|
|||||||
try:
|
try:
|
||||||
DNS.deleteDNSRecord(recordID)
|
DNS.deleteDNSRecord(recordID)
|
||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -326,13 +326,13 @@ class cyberPanel:
|
|||||||
try:
|
try:
|
||||||
backupLogPath = "/usr/local/lscp/logs/backup_log."+time.strftime("%I-%M-%S-%a-%b-%Y")
|
backupLogPath = "/usr/local/lscp/logs/backup_log."+time.strftime("%I-%M-%S-%a-%b-%Y")
|
||||||
|
|
||||||
print 'Backup logs to be generated in %s' % (backupLogPath)
|
print('Backup logs to be generated in %s' % (backupLogPath))
|
||||||
|
|
||||||
backupSchedule.createLocalBackup(virtualHostName, backupLogPath)
|
backupSchedule.createLocalBackup(virtualHostName, backupLogPath)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def restoreBackup(self, fileName):
|
def restoreBackup(self, fileName):
|
||||||
try:
|
try:
|
||||||
@@ -351,19 +351,19 @@ class cyberPanel:
|
|||||||
data = json.loads(r.text)
|
data = json.loads(r.text)
|
||||||
|
|
||||||
if data['abort'] == 1 and data['running'] == "Error":
|
if data['abort'] == 1 and data['running'] == "Error":
|
||||||
print 'Failed to restore backup, Error message : ' + data['status'] + '\n'
|
print('Failed to restore backup, Error message : ' + data['status'] + '\n')
|
||||||
break
|
break
|
||||||
elif data['abort'] == 1 and data['running'] == "Completed":
|
elif data['abort'] == 1 and data['running'] == "Completed":
|
||||||
print '\n\n'
|
print('\n\n')
|
||||||
print 'Backup restore completed.\n'
|
print('Backup restore completed.\n')
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print 'Waiting for restore to complete. Current status: ' + data['status']
|
print('Waiting for restore to complete. Current status: ' + data['status'])
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
## Packages
|
## Packages
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ class cyberPanel:
|
|||||||
|
|
||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -391,7 +391,7 @@ class cyberPanel:
|
|||||||
delPack.delete()
|
delPack.delete()
|
||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -422,11 +422,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
json_data = json_data + ']'
|
json_data = json_data + ']'
|
||||||
final_json = json.dumps(json_data)
|
final_json = json.dumps(json_data)
|
||||||
print final_json
|
print(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def listPackagesPretty(self):
|
def listPackagesPretty(self):
|
||||||
try:
|
try:
|
||||||
@@ -438,11 +438,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
for items in records:
|
for items in records:
|
||||||
table.add_row([items.packageName, items.allowedDomains, items.diskSpace, items.bandwidth, items.ftpAccounts, items.dataBases, items.emailAccounts])
|
table.add_row([items.packageName, items.allowedDomains, items.diskSpace, items.bandwidth, items.ftpAccounts, items.dataBases, items.emailAccounts])
|
||||||
print table
|
print(table)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
|
|
||||||
## Database functions
|
## Database functions
|
||||||
@@ -455,7 +455,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -468,7 +468,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -494,11 +494,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
json_data = json_data + ']'
|
json_data = json_data + ']'
|
||||||
final_json = json.dumps(json_data)
|
final_json = json.dumps(json_data)
|
||||||
print final_json
|
print(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def listDatabasesPretty(self, virtualHostName):
|
def listDatabasesPretty(self, virtualHostName):
|
||||||
try:
|
try:
|
||||||
@@ -510,11 +510,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
for items in records:
|
for items in records:
|
||||||
table.add_row([items.id, items.dbName, items.dbUser])
|
table.add_row([items.id, items.dbName, items.dbUser])
|
||||||
print table
|
print(table)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
## Email functions
|
## Email functions
|
||||||
|
|
||||||
@@ -526,7 +526,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -538,7 +538,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -550,7 +550,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -575,11 +575,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
json_data = json_data + ']'
|
json_data = json_data + ']'
|
||||||
final_json = json.dumps(json_data)
|
final_json = json.dumps(json_data)
|
||||||
print final_json
|
print(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def listEmailsPretty(self, virtualHostName):
|
def listEmailsPretty(self, virtualHostName):
|
||||||
try:
|
try:
|
||||||
@@ -591,11 +591,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
for items in records:
|
for items in records:
|
||||||
table.add_row([items.email])
|
table.add_row([items.email])
|
||||||
print table
|
print(table)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
## FTP Functions
|
## FTP Functions
|
||||||
|
|
||||||
@@ -612,7 +612,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -624,7 +624,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -636,7 +636,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -662,11 +662,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
json_data = json_data + ']'
|
json_data = json_data + ']'
|
||||||
final_json = json.dumps(json_data)
|
final_json = json.dumps(json_data)
|
||||||
print final_json
|
print(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
def listFTPPretty(self, virtualHostName):
|
def listFTPPretty(self, virtualHostName):
|
||||||
try:
|
try:
|
||||||
@@ -678,11 +678,11 @@ class cyberPanel:
|
|||||||
|
|
||||||
for items in records:
|
for items in records:
|
||||||
table.add_row([items.id, items.user, items.dir])
|
table.add_row([items.id, items.user, items.dir])
|
||||||
print table
|
print(table)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
print 0
|
print(0)
|
||||||
|
|
||||||
## FTP Functions
|
## FTP Functions
|
||||||
|
|
||||||
@@ -709,7 +709,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -733,7 +733,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -757,7 +757,7 @@ class cyberPanel:
|
|||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
else:
|
else:
|
||||||
self.printStatus(1, result[1])
|
self.printStatus(1, result[1])
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -786,7 +786,7 @@ class cyberPanel:
|
|||||||
ProcessUtilities.restartLitespeed()
|
ProcessUtilities.restartLitespeed()
|
||||||
self.printStatus(1, 'None')
|
self.printStatus(1, 'None')
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
logger.writeforCLI(str(msg), "Error", stack()[0][3])
|
||||||
self.printStatus(0, str(msg))
|
self.printStatus(0, str(msg))
|
||||||
|
|
||||||
@@ -803,23 +803,23 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel createWebsite --package Detault --owner admin --domainName cyberpanel.net --email support@cyberpanel.net --php 5.6'
|
completeCommandExample = 'cyberpanel createWebsite --package Detault --owner admin --domainName cyberpanel.net --email support@cyberpanel.net --php 5.6'
|
||||||
|
|
||||||
if not args.package:
|
if not args.package:
|
||||||
print "\n\nPlease enter the package name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the package name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.owner:
|
if not args.owner:
|
||||||
print "\n\nPlease enter the owner name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the owner name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter the domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.email:
|
if not args.email:
|
||||||
print "\n\nPlease enter the email. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the email. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.php:
|
if not args.php:
|
||||||
print "\n\nPlease enter the PHP version such as 5.6 for PHP version 5.6. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the PHP version such as 5.6 for PHP version 5.6. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if args.ssl:
|
if args.ssl:
|
||||||
@@ -843,7 +843,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel deleteWebsite --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel deleteWebsite --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter the domain to delete. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the domain to delete. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.deleteWebsite(args.domainName)
|
cyberpanel.deleteWebsite(args.domainName)
|
||||||
@@ -853,19 +853,19 @@ def main():
|
|||||||
' --owner admin --php 5.6'
|
' --owner admin --php 5.6'
|
||||||
|
|
||||||
if not args.masterDomain:
|
if not args.masterDomain:
|
||||||
print "\n\nPlease enter Master domain. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter Master domain. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.childDomain:
|
if not args.childDomain:
|
||||||
print "\n\nPlease enter the Child Domain. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the Child Domain. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.owner:
|
if not args.owner:
|
||||||
print "\n\nPlease enter owner for this domain DNS records. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter owner for this domain DNS records. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.php:
|
if not args.php:
|
||||||
print "\n\nPlease enter required PHP version. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter required PHP version. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if args.ssl:
|
if args.ssl:
|
||||||
@@ -889,7 +889,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel deleteChild --childDomain cyberpanel.net'
|
completeCommandExample = 'cyberpanel deleteChild --childDomain cyberpanel.net'
|
||||||
|
|
||||||
if not args.childDomain:
|
if not args.childDomain:
|
||||||
print "\n\nPlease enter the child domain to delete. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the child domain to delete. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.deleteChild(args.childDomain)
|
cyberpanel.deleteChild(args.childDomain)
|
||||||
@@ -903,11 +903,11 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel changePHP --domainName cyberpanel.net --php 5.6'
|
completeCommandExample = 'cyberpanel changePHP --domainName cyberpanel.net --php 5.6'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter Domain. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter Domain. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.php:
|
if not args.php:
|
||||||
print "\n\nPlease enter required PHP version. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter required PHP version. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@@ -917,11 +917,11 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel changePackage --domainName cyberpanel.net --packageName CLI'
|
completeCommandExample = 'cyberpanel changePackage --domainName cyberpanel.net --packageName CLI'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter the Domain. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the Domain. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.packageName:
|
if not args.packageName:
|
||||||
print "\n\nPlease enter the package name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the package name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.changePackage(args.domainName, args.packageName)
|
cyberpanel.changePackage(args.domainName, args.packageName)
|
||||||
@@ -933,7 +933,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel listDNSJson --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel listDNSJson --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.listDNSJson(args.domainName)
|
cyberpanel.listDNSJson(args.domainName)
|
||||||
@@ -942,7 +942,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel listDNSPretty --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel listDNSPretty --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.listDNSPretty(args.domainName)
|
cyberpanel.listDNSPretty(args.domainName)
|
||||||
@@ -954,11 +954,11 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel createDNSZone --owner admin --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel createDNSZone --owner admin --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.owner:
|
if not args.owner:
|
||||||
print "\n\nPlease enter the owner name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the owner name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.createDNSZone(args.domainName, args.owner)
|
cyberpanel.createDNSZone(args.domainName, args.owner)
|
||||||
@@ -966,7 +966,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel deleteDNSZone --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel deleteDNSZone --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.deleteDNSZone(args.domainName)
|
cyberpanel.deleteDNSZone(args.domainName)
|
||||||
@@ -975,27 +975,27 @@ def main():
|
|||||||
' --recordType A --value 192.168.100.1 --priority 0 --ttl 3600'
|
' --recordType A --value 192.168.100.1 --priority 0 --ttl 3600'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.name:
|
if not args.name:
|
||||||
print "\n\nPlease enter the record name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the record name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.recordType:
|
if not args.recordType:
|
||||||
print "\n\nPlease enter the record type. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the record type. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.value:
|
if not args.value:
|
||||||
print "\n\nPlease enter the record value. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the record value. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.priority:
|
if not args.priority:
|
||||||
print "\n\nPlease enter the priority. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the priority. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.ttl:
|
if not args.ttl:
|
||||||
print "\n\nPlease enter the ttl. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the ttl. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.createDNSRecord(args.domainName, args.name, args.recordType, args.value, args.priority, args.ttl)
|
cyberpanel.createDNSRecord(args.domainName, args.name, args.recordType, args.value, args.priority, args.ttl)
|
||||||
@@ -1003,7 +1003,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel deleteDNSRecord --recordID 200'
|
completeCommandExample = 'cyberpanel deleteDNSRecord --recordID 200'
|
||||||
|
|
||||||
if not args.recordID:
|
if not args.recordID:
|
||||||
print "\n\nPlease enter the record ID to be deleted, you can find record ID by listing the current DNS records. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the record ID to be deleted, you can find record ID by listing the current DNS records. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.deleteDNSRecord(args.recordID)
|
cyberpanel.deleteDNSRecord(args.recordID)
|
||||||
@@ -1015,7 +1015,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel createBackup --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel createBackup --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the domain. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.createBackup(args.domainName)
|
cyberpanel.createBackup(args.domainName)
|
||||||
@@ -1024,7 +1024,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel restoreBackup --fileName /home/talkshosting.com/backup/backup-talksho-01-30-53-Fri-Jun-2018.tar.gz'
|
completeCommandExample = 'cyberpanel restoreBackup --fileName /home/talkshosting.com/backup/backup-talksho-01-30-53-Fri-Jun-2018.tar.gz'
|
||||||
|
|
||||||
if not args.fileName:
|
if not args.fileName:
|
||||||
print "\n\nPlease enter the file name or complete path to file. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the file name or complete path to file. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.restoreBackup(args.fileName)
|
cyberpanel.restoreBackup(args.fileName)
|
||||||
@@ -1037,33 +1037,33 @@ def main():
|
|||||||
' --dataBases 100 --ftpAccounts 100 --allowedDomains 100'
|
' --dataBases 100 --ftpAccounts 100 --allowedDomains 100'
|
||||||
|
|
||||||
if not args.owner:
|
if not args.owner:
|
||||||
print "\n\nPlease enter the owner name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the owner name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
if not args.packageName:
|
if not args.packageName:
|
||||||
print "\n\nPlease enter the package name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the package name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
if not args.diskSpace:
|
if not args.diskSpace:
|
||||||
print "\n\nPlease enter value for Disk Space. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter value for Disk Space. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.bandwidth:
|
if not args.bandwidth:
|
||||||
print "\n\nPlease enter value for Bandwidth. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter value for Bandwidth. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.emailAccounts:
|
if not args.emailAccounts:
|
||||||
print "\n\nPlease enter value for Email accounts. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter value for Email accounts. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.dataBases:
|
if not args.dataBases:
|
||||||
print "\n\nPlease enter value for Databases. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter value for Databases. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.ftpAccounts:
|
if not args.ftpAccounts:
|
||||||
print "\n\nPlease enter value for Ftp accounts. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter value for Ftp accounts. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.allowedDomains:
|
if not args.allowedDomains:
|
||||||
print "\n\nPlease enter value for Allowed Child Domains. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter value for Allowed Child Domains. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@@ -1073,7 +1073,7 @@ def main():
|
|||||||
elif args.function == "deletePackage":
|
elif args.function == "deletePackage":
|
||||||
completeCommandExample = 'cyberpanel deletePackage --packageName CLI'
|
completeCommandExample = 'cyberpanel deletePackage --packageName CLI'
|
||||||
if not args.packageName:
|
if not args.packageName:
|
||||||
print "\n\nPlease enter the package name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the package name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.deletePackage(args.packageName)
|
cyberpanel.deletePackage(args.packageName)
|
||||||
@@ -1090,24 +1090,24 @@ def main():
|
|||||||
'--dbUsername cyberpanel --dbPassword cyberpanel'
|
'--dbUsername cyberpanel --dbPassword cyberpanel'
|
||||||
|
|
||||||
if not args.databaseWebsite:
|
if not args.databaseWebsite:
|
||||||
print "\n\nPlease enter database website. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter database website. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
if not args.dbName:
|
if not args.dbName:
|
||||||
print "\n\nPlease enter the database name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the database name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
if not args.dbUsername:
|
if not args.dbUsername:
|
||||||
print "\n\nPlease enter the database username. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the database username. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.dbPassword:
|
if not args.dbPassword:
|
||||||
print "\n\nPlease enter the password for database. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the password for database. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.createDatabase(args.dbName, args.dbUsername, args.dbPassword, args.databaseWebsite)
|
cyberpanel.createDatabase(args.dbName, args.dbUsername, args.dbPassword, args.databaseWebsite)
|
||||||
elif args.function == "deleteDatabase":
|
elif args.function == "deleteDatabase":
|
||||||
completeCommandExample = 'cyberpanel deleteDatabase --dbName cyberpanel'
|
completeCommandExample = 'cyberpanel deleteDatabase --dbName cyberpanel'
|
||||||
if not args.dbName:
|
if not args.dbName:
|
||||||
print "\n\nPlease enter the database name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the database name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.deleteDatabase(args.dbName)
|
cyberpanel.deleteDatabase(args.dbName)
|
||||||
@@ -1116,14 +1116,14 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel listDatabasesJson --databaseWebsite cyberpanel.net'
|
completeCommandExample = 'cyberpanel listDatabasesJson --databaseWebsite cyberpanel.net'
|
||||||
|
|
||||||
if not args.databaseWebsite:
|
if not args.databaseWebsite:
|
||||||
print "\n\nPlease enter database website. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter database website. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
cyberpanel.listDatabasesJson(args.databaseWebsite)
|
cyberpanel.listDatabasesJson(args.databaseWebsite)
|
||||||
elif args.function == "listDatabasesPretty":
|
elif args.function == "listDatabasesPretty":
|
||||||
completeCommandExample = 'cyberpanel listDatabasesPretty --databaseWebsite cyberpanel.net'
|
completeCommandExample = 'cyberpanel listDatabasesPretty --databaseWebsite cyberpanel.net'
|
||||||
|
|
||||||
if not args.databaseWebsite:
|
if not args.databaseWebsite:
|
||||||
print "\n\nPlease enter database website. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter database website. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.listDatabasesPretty(args.databaseWebsite)
|
cyberpanel.listDatabasesPretty(args.databaseWebsite)
|
||||||
@@ -1136,14 +1136,14 @@ def main():
|
|||||||
'--password cyberpanel'
|
'--password cyberpanel'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
if not args.userName:
|
if not args.userName:
|
||||||
print "\n\nPlease enter the user name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the user name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.password:
|
if not args.password:
|
||||||
print "\n\nPlease enter the password for database. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the password for database. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.createEmail(args.domainName, args.userName, args.password)
|
cyberpanel.createEmail(args.domainName, args.userName, args.password)
|
||||||
@@ -1151,7 +1151,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel deleteEmail --email cyberpanel@cyberpanel.net'
|
completeCommandExample = 'cyberpanel deleteEmail --email cyberpanel@cyberpanel.net'
|
||||||
|
|
||||||
if not args.email:
|
if not args.email:
|
||||||
print "\n\nPlease enter the email. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the email. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.deleteEmail(args.email)
|
cyberpanel.deleteEmail(args.email)
|
||||||
@@ -1160,11 +1160,11 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel changeEmailPassword --email cyberpanel@cyberpanel.net --password cyberpanel'
|
completeCommandExample = 'cyberpanel changeEmailPassword --email cyberpanel@cyberpanel.net --password cyberpanel'
|
||||||
|
|
||||||
if not args.email:
|
if not args.email:
|
||||||
print "\n\nPlease enter email. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter email. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.password:
|
if not args.password:
|
||||||
print "\n\nPlease enter the password. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the password. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.changeEmailPassword(args.email, args.password)
|
cyberpanel.changeEmailPassword(args.email, args.password)
|
||||||
@@ -1172,7 +1172,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel listEmailsJson --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel listEmailsJson --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.listEmailsJson(args.domainName)
|
cyberpanel.listEmailsJson(args.domainName)
|
||||||
@@ -1180,7 +1180,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel listEmailsPretty --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel listEmailsPretty --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.listEmailsPretty(args.domainName)
|
cyberpanel.listEmailsPretty(args.domainName)
|
||||||
@@ -1193,18 +1193,18 @@ def main():
|
|||||||
'--password cyberpanel --owner admin'
|
'--password cyberpanel --owner admin'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
if not args.userName:
|
if not args.userName:
|
||||||
print "\n\nPlease enter the user name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the user name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.password:
|
if not args.password:
|
||||||
print "\n\nPlease enter the password for database. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the password for database. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.owner:
|
if not args.owner:
|
||||||
print "\n\nPlease enter the owner name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the owner name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.createFTPAccount(args.domainName, args.userName, args.password, args.owner)
|
cyberpanel.createFTPAccount(args.domainName, args.userName, args.password, args.owner)
|
||||||
@@ -1212,7 +1212,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel deleteFTPAccount --userName cyberpanel'
|
completeCommandExample = 'cyberpanel deleteFTPAccount --userName cyberpanel'
|
||||||
|
|
||||||
if not args.userName:
|
if not args.userName:
|
||||||
print "\n\nPlease enter the user name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the user name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.deleteFTPAccount(args.userName)
|
cyberpanel.deleteFTPAccount(args.userName)
|
||||||
@@ -1221,11 +1221,11 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel changeFTPPassword --userName cyberpanel --password cyberpanel'
|
completeCommandExample = 'cyberpanel changeFTPPassword --userName cyberpanel --password cyberpanel'
|
||||||
|
|
||||||
if not args.userName:
|
if not args.userName:
|
||||||
print "\n\nPlease enter the user name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the user name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
if not args.password:
|
if not args.password:
|
||||||
print "\n\nPlease enter the password for database. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter the password for database. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.changeFTPPassword(args.userName, args.password)
|
cyberpanel.changeFTPPassword(args.userName, args.password)
|
||||||
@@ -1233,7 +1233,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel listFTPJson --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel listFTPJson --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.listFTPJson(args.domainName)
|
cyberpanel.listFTPJson(args.domainName)
|
||||||
@@ -1241,7 +1241,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel listFTPPretty --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel listFTPPretty --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.listFTPPretty(args.domainName)
|
cyberpanel.listFTPPretty(args.domainName)
|
||||||
@@ -1251,7 +1251,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel issueSSL --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel issueSSL --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.issueSSL(args.domainName)
|
cyberpanel.issueSSL(args.domainName)
|
||||||
@@ -1259,7 +1259,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel hostNameSSL --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel hostNameSSL --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.issueSSLForHostName(args.domainName)
|
cyberpanel.issueSSLForHostName(args.domainName)
|
||||||
@@ -1268,7 +1268,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel mailServerSSL --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel mailServerSSL --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.issueSSLForMailServer(args.domainName)
|
cyberpanel.issueSSLForMailServer(args.domainName)
|
||||||
@@ -1277,7 +1277,7 @@ def main():
|
|||||||
completeCommandExample = 'cyberpanel issueSelfSignedSSL --domainName cyberpanel.net'
|
completeCommandExample = 'cyberpanel issueSelfSignedSSL --domainName cyberpanel.net'
|
||||||
|
|
||||||
if not args.domainName:
|
if not args.domainName:
|
||||||
print "\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n"
|
print("\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
cyberpanel.issueSelfSignedSSL(args.domainName)
|
cyberpanel.issueSelfSignedSSL(args.domainName)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from cloudManager import CloudManager
|
from cloudManager import CloudManager
|
||||||
import json
|
import json
|
||||||
@@ -307,6 +307,6 @@ def router(request):
|
|||||||
else:
|
else:
|
||||||
return cm.ajaxPre(0, 'This function is not available in your version of CyberPanel.')
|
return cm.ajaxPre(0, 'This function is not available in your version of CyberPanel.')
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
cm = CloudManager(None)
|
cm = CloudManager(None)
|
||||||
return cm.ajaxPre(0, str(msg))
|
return cm.ajaxPre(0, str(msg))
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ class Container:
|
|||||||
length = len(Container.users)
|
length = len(Container.users)
|
||||||
for items in Container.users:
|
for items in Container.users:
|
||||||
if (counter + 1) == length:
|
if (counter + 1) == length:
|
||||||
print items + ' ' + Container.packages[counter]
|
print(items + ' ' + Container.packages[counter])
|
||||||
else:
|
else:
|
||||||
print items + ' ' + Container.packages[counter] + ' '
|
print(items + ' ' + Container.packages[counter] + ' ')
|
||||||
counter = counter + 1
|
counter = counter + 1
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -33,12 +33,12 @@ class Container:
|
|||||||
length = len(Container.users)
|
length = len(Container.users)
|
||||||
for items in Container.packages:
|
for items in Container.packages:
|
||||||
if (counter + 1) == length:
|
if (counter + 1) == length:
|
||||||
print items
|
print(items)
|
||||||
else:
|
else:
|
||||||
print items + '\n'
|
print(items + '\n')
|
||||||
counter = counter + 1
|
counter = counter + 1
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -47,10 +47,10 @@ class Container:
|
|||||||
counter = 0
|
counter = 0
|
||||||
for items in Container.users:
|
for items in Container.users:
|
||||||
if items == user:
|
if items == user:
|
||||||
print Container.packages[counter]
|
print(Container.packages[counter])
|
||||||
return
|
return
|
||||||
counter = counter + 1
|
counter = counter + 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -59,10 +59,10 @@ class Container:
|
|||||||
counter = 0
|
counter = 0
|
||||||
for items in Container.packages:
|
for items in Container.packages:
|
||||||
if items == package:
|
if items == package:
|
||||||
print Container.users[counter]
|
print(Container.users[counter])
|
||||||
return
|
return
|
||||||
counter = counter + 1
|
counter = counter + 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -88,7 +88,7 @@ class Container:
|
|||||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
|
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
|
||||||
"Packages successfully installed.[200]\n", 1)
|
"Packages successfully installed.[200]\n", 1)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class ContainerManager(multi.Thread):
|
|||||||
self.addTrafficController()
|
self.addTrafficController()
|
||||||
elif self.function == 'removeLimits':
|
elif self.function == 'removeLimits':
|
||||||
self.removeLimits()
|
self.removeLimits()
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [ContainerManager.run]')
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [ContainerManager.run]')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -78,7 +78,7 @@ class ContainerManager(multi.Thread):
|
|||||||
ioConf = ioConf.replace('{net_cls}', str(net_cls))
|
ioConf = ioConf.replace('{net_cls}', str(net_cls))
|
||||||
|
|
||||||
return ioConf
|
return ioConf
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ class ContainerManager(multi.Thread):
|
|||||||
execPath = execPath + " --function submitContainerInstall"
|
execPath = execPath + " --function submitContainerInstall"
|
||||||
ProcessUtilities.outputExecutioner(execPath)
|
ProcessUtilities.outputExecutioner(execPath)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
||||||
|
|
||||||
def restartServices(self):
|
def restartServices(self):
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from websiteFunctions.models import Websites
|
from websiteFunctions.models import Websites
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.shortcuts import HttpResponse, redirect
|
from django.shortcuts import HttpResponse, redirect
|
||||||
from loginSystem.views import loadLoginPage
|
from loginSystem.views import loadLoginPage
|
||||||
@@ -42,7 +42,7 @@ def submitContainerInstall(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -117,7 +117,7 @@ def fetchWebsiteLimits(request):
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -264,7 +264,7 @@ def saveWebsiteLimits(request):
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -345,7 +345,7 @@ def getUsageData(request):
|
|||||||
final_json = json.dumps(finalData)
|
final_json = json.dumps(finalData)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg), 'cpu': 0, 'memory':0}
|
data_ret = {'status': 0, 'error_message': str(msg), 'cpu': 0, 'memory':0}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
import models
|
import models
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ class DatabaseManager:
|
|||||||
def loadDatabaseHome(self, request = None, userID = None):
|
def loadDatabaseHome(self, request = None, userID = None):
|
||||||
try:
|
try:
|
||||||
return render(request, 'databases/index.html')
|
return render(request, 'databases/index.html')
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def phpMyAdmin(self, request = None, userID = None):
|
def phpMyAdmin(self, request = None, userID = None):
|
||||||
try:
|
try:
|
||||||
return render(request, 'databases/phpMyAdmin.html')
|
return render(request, 'databases/phpMyAdmin.html')
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def createDatabase(self, request = None, userID = None):
|
def createDatabase(self, request = None, userID = None):
|
||||||
@@ -40,7 +40,7 @@ class DatabaseManager:
|
|||||||
websitesName = ACLManager.findAllSites(currentACL, userID)
|
websitesName = ACLManager.findAllSites(currentACL, userID)
|
||||||
|
|
||||||
return render(request, 'databases/createDatabase.html', {'websitesList': websitesName})
|
return render(request, 'databases/createDatabase.html', {'websitesList': websitesName})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def submitDBCreation(self, userID = None, data = None, rAPI = None):
|
def submitDBCreation(self, userID = None, data = None, rAPI = None):
|
||||||
@@ -76,7 +76,7 @@ class DatabaseManager:
|
|||||||
data_ret = {'status': 0, 'createDBStatus': 0, 'error_message': result[1]}
|
data_ret = {'status': 0, 'createDBStatus': 0, 'error_message': result[1]}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'createDBStatus': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'createDBStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -91,7 +91,7 @@ class DatabaseManager:
|
|||||||
websitesName = ACLManager.findAllSites(currentACL, userID)
|
websitesName = ACLManager.findAllSites(currentACL, userID)
|
||||||
|
|
||||||
return render(request, 'databases/deleteDatabase.html', {'websitesList': websitesName})
|
return render(request, 'databases/deleteDatabase.html', {'websitesList': websitesName})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ class DatabaseManager:
|
|||||||
final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
||||||
|
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
final_json = json.dumps({'status': 0, 'fetchStatus': 0, 'error_message': str(msg)})
|
final_json = json.dumps({'status': 0, 'fetchStatus': 0, 'error_message': str(msg)})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -163,7 +163,7 @@ class DatabaseManager:
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'deleteStatus': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'deleteStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -177,7 +177,7 @@ class DatabaseManager:
|
|||||||
websitesName = ACLManager.findAllSites(currentACL, userID)
|
websitesName = ACLManager.findAllSites(currentACL, userID)
|
||||||
|
|
||||||
return render(request, 'databases/listDataBases.html', {'websiteList': websitesName})
|
return render(request, 'databases/listDataBases.html', {'websiteList': websitesName})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def changePassword(self, userID = None, data = None):
|
def changePassword(self, userID = None, data = None):
|
||||||
@@ -210,7 +210,7 @@ class DatabaseManager:
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'changePasswordStatus': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'changePasswordStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -238,10 +238,10 @@ class DatabaseManager:
|
|||||||
for db in webs.databases_set.all():
|
for db in webs.databases_set.all():
|
||||||
mysqlUtilities.allowGlobalUserAccess(admin.userName, db.dbName)
|
mysqlUtilities.allowGlobalUserAccess(admin.userName, db.dbName)
|
||||||
|
|
||||||
print "1," + finalUserPassword
|
print("1," + finalUserPassword)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
print "0," + str(msg)
|
print("0," + str(msg))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from websiteFunctions.models import Websites
|
from websiteFunctions.models import Websites
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
import json
|
import json
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.shortcuts import redirect, HttpResponse
|
from django.shortcuts import redirect, HttpResponse
|
||||||
from loginSystem.views import loadLoginPage
|
from loginSystem.views import loadLoginPage
|
||||||
@@ -151,7 +151,7 @@ def setupPHPMYAdminSession(request):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'createDBStatus': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'createDBStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
import models
|
import models
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class DNSManager:
|
|||||||
try:
|
try:
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
return render(request, 'dns/index.html', {"type": admin.type})
|
return render(request, 'dns/index.html', {"type": admin.type})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def createNameserver(self, request = None, userID = None):
|
def createNameserver(self, request = None, userID = None):
|
||||||
@@ -40,7 +40,7 @@ class DNSManager:
|
|||||||
else:
|
else:
|
||||||
return render(request, "dns/createNameServer.html", {"status": 0})
|
return render(request, "dns/createNameServer.html", {"status": 0})
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def NSCreation(self, userID = None, data = None):
|
def NSCreation(self, userID = None, data = None):
|
||||||
@@ -94,7 +94,7 @@ class DNSManager:
|
|||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'NSCreation': 0, 'error_message': str(msg)}
|
final_dic = {'NSCreation': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -109,7 +109,7 @@ class DNSManager:
|
|||||||
return render(request, 'dns/createDNSZone.html', {"status": 1})
|
return render(request, 'dns/createDNSZone.html', {"status": 1})
|
||||||
else:
|
else:
|
||||||
return render(request, 'dns/createDNSZone.html', {"status": 0})
|
return render(request, 'dns/createDNSZone.html', {"status": 0})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def zoneCreation(self, userID = None, data = None):
|
def zoneCreation(self, userID = None, data = None):
|
||||||
@@ -142,7 +142,7 @@ class DNSManager:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'zoneCreation': 0, 'error_message': str(msg)}
|
final_dic = {'zoneCreation': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -161,7 +161,7 @@ class DNSManager:
|
|||||||
|
|
||||||
return render(request, 'dns/addDeleteDNSRecords.html', {"domainsList": domainsList, "status": 1})
|
return render(request, 'dns/addDeleteDNSRecords.html', {"domainsList": domainsList, "status": 1})
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def getCurrentRecordsForDomain(self, userID = None, data = None):
|
def getCurrentRecordsForDomain(self, userID = None, data = None):
|
||||||
@@ -233,7 +233,7 @@ class DNSManager:
|
|||||||
final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
final_json = json.dumps({'status': 1, 'fetchStatus': 1, 'error_message': "None", "data": json_data})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'fetchStatus': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'fetchStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -406,7 +406,7 @@ class DNSManager:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'add_status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'add_status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -436,7 +436,7 @@ class DNSManager:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'delete_status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'delete_status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -456,7 +456,7 @@ class DNSManager:
|
|||||||
|
|
||||||
return render(request, 'dns/deleteDNSZone.html', {"domainsList": domainsList, "status": 1})
|
return render(request, 'dns/deleteDNSZone.html', {"domainsList": domainsList, "status": 1})
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def submitZoneDeletion(self, userID = None, data = None):
|
def submitZoneDeletion(self, userID = None, data = None):
|
||||||
@@ -486,7 +486,7 @@ class DNSManager:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'delete_status': 0, 'error_message': str(msg)}
|
final_dic = {'delete_status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -529,7 +529,7 @@ class DNSManager:
|
|||||||
|
|
||||||
return render(request, 'dns/configureDefaultNameServers.html', data)
|
return render(request, 'dns/configureDefaultNameServers.html', data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
|
|
||||||
@@ -568,7 +568,7 @@ class DNSManager:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from loginSystem.models import Administrator
|
from loginSystem.models import Administrator
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
from loginSystem.views import loadLoginPage
|
from loginSystem.views import loadLoginPage
|
||||||
from dnsManager import DNSManager
|
from dnsManager import DNSManager
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/local/CyberCP/bin/python2
|
#!/usr/local/CyberCP/bin/python2
|
||||||
from __future__ import division
|
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
@@ -57,7 +57,7 @@ class ContainerManager(multi.Thread):
|
|||||||
elif self.function == 'restartGunicorn':
|
elif self.function == 'restartGunicorn':
|
||||||
command = 'sudo systemctl restart gunicorn.socket'
|
command = 'sudo systemctl restart gunicorn.socket'
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile( str(msg) + ' [ContainerManager.run]')
|
logging.CyberCPLogFileWriter.writeToFile( str(msg) + ' [ContainerManager.run]')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -68,7 +68,7 @@ class ContainerManager(multi.Thread):
|
|||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
return 1
|
return 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ class ContainerManager(multi.Thread):
|
|||||||
|
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
||||||
|
|
||||||
def createContainer(self, request=None, userID=None, data=None):
|
def createContainer(self, request=None, userID=None, data=None):
|
||||||
@@ -123,7 +123,7 @@ class ContainerManager(multi.Thread):
|
|||||||
for item in inspectImage['Config']['Env']:
|
for item in inspectImage['Config']['Env']:
|
||||||
if '=' in item:
|
if '=' in item:
|
||||||
splitedItem = item.split('=', 1)
|
splitedItem = item.split('=', 1)
|
||||||
print splitedItem
|
print(splitedItem)
|
||||||
envList[splitedItem[0]] = splitedItem[1]
|
envList[splitedItem[0]] = splitedItem[1]
|
||||||
else:
|
else:
|
||||||
envList[item] = ""
|
envList[item] = ""
|
||||||
@@ -142,7 +142,7 @@ class ContainerManager(multi.Thread):
|
|||||||
|
|
||||||
return render(request, 'dockerManager/runContainer.html', Data)
|
return render(request, 'dockerManager/runContainer.html', Data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def loadContainerHome(self, request=None, userID=None, data=None):
|
def loadContainerHome(self, request=None, userID=None, data=None):
|
||||||
@@ -239,7 +239,7 @@ class ContainerManager(multi.Thread):
|
|||||||
"unlistedContainers": unlistedContainers,
|
"unlistedContainers": unlistedContainers,
|
||||||
"adminNames": adminNames,
|
"adminNames": adminNames,
|
||||||
"showUnlistedContainer": showUnlistedContainer})
|
"showUnlistedContainer": showUnlistedContainer})
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def getContainerLogs(self, userID=None, data=None):
|
def getContainerLogs(self, userID=None, data=None):
|
||||||
@@ -262,7 +262,7 @@ class ContainerManager(multi.Thread):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'containerLogStatus': 0, 'containerLog': 'Error', 'error_message': str(msg)}
|
data_ret = {'containerLogStatus': 0, 'containerLog': 'Error', 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -290,7 +290,7 @@ class ContainerManager(multi.Thread):
|
|||||||
|
|
||||||
# Formatting envList for usage
|
# Formatting envList for usage
|
||||||
envDict = {}
|
envDict = {}
|
||||||
for key, value in envList.iteritems():
|
for key, value in envList.items():
|
||||||
if (value['name'] != '') or (value['value'] != ''):
|
if (value['name'] != '') or (value['value'] != ''):
|
||||||
envDict[value['name']] = value['value']
|
envDict[value['name']] = value['value']
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ class ContainerManager(multi.Thread):
|
|||||||
portConfig[item] = data[item]
|
portConfig[item] = data[item]
|
||||||
|
|
||||||
volumes = {}
|
volumes = {}
|
||||||
for index, volume in volList.iteritems():
|
for index, volume in volList.items():
|
||||||
volumes[volume['src']] = {'bind': volume['dest'],
|
volumes[volume['src']] = {'bind': volume['dest'],
|
||||||
'mode': 'rw'}
|
'mode': 'rw'}
|
||||||
|
|
||||||
@@ -325,7 +325,7 @@ class ContainerManager(multi.Thread):
|
|||||||
container = client.containers.create(**containerArgs)
|
container = client.containers.create(**containerArgs)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if "port is already allocated" in err: # We need to delete container if port is not available
|
if "port is already allocated" in err: # We need to delete container if port is not available
|
||||||
print "Deleting container"
|
print("Deleting container")
|
||||||
container.remove(force=True)
|
container.remove(force=True)
|
||||||
data_ret = {'createContainerStatus': 0, 'error_message': str(err)}
|
data_ret = {'createContainerStatus': 0, 'error_message': str(err)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
@@ -348,7 +348,7 @@ class ContainerManager(multi.Thread):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'createContainerStatus': 0, 'error_message': str(msg)}
|
data_ret = {'createContainerStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -376,7 +376,7 @@ class ContainerManager(multi.Thread):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
image = client.images.pull(image, tag=tag)
|
image = client.images.pull(image, tag=tag)
|
||||||
print image.id
|
print(image.id)
|
||||||
except docker.errors.APIError as msg:
|
except docker.errors.APIError as msg:
|
||||||
data_ret = {'installImageStatus': 0, 'error_message': str(msg)}
|
data_ret = {'installImageStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
@@ -387,7 +387,7 @@ class ContainerManager(multi.Thread):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'installImageStatus': 0, 'error_message': str(msg)}
|
data_ret = {'installImageStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -457,7 +457,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
if called:
|
if called:
|
||||||
return str(msg)
|
return str(msg)
|
||||||
else:
|
else:
|
||||||
@@ -477,7 +477,7 @@ class ContainerManager(multi.Thread):
|
|||||||
final_dic = {'listContainerStatus': 1, 'error_message': "None", "data": json_data}
|
final_dic = {'listContainerStatus': 1, 'error_message': "None", "data": json_data}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
dic = {'listContainerStatus': 0, 'error_message': str(msg)}
|
dic = {'listContainerStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -551,7 +551,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'containerActionStatus': 0, 'error_message': str(msg)}
|
data_ret = {'containerActionStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -581,7 +581,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'containerStatus': 0, 'error_message': str(msg)}
|
data_ret = {'containerStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -611,7 +611,7 @@ class ContainerManager(multi.Thread):
|
|||||||
response['Content-Disposition'] = 'attachment; filename="' + name + '.tar"'
|
response['Content-Disposition'] = 'attachment; filename="' + name + '.tar"'
|
||||||
return response
|
return response
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'containerStatus': 0, 'error_message': str(msg)}
|
data_ret = {'containerStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -647,7 +647,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'containerTopStatus': 0, 'error_message': str(msg)}
|
data_ret = {'containerTopStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -688,7 +688,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'assignContainerStatus': 0, 'error_message': str(msg)}
|
data_ret = {'assignContainerStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -714,7 +714,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
print json.dumps(matches)
|
print(json.dumps(matches))
|
||||||
|
|
||||||
for image in matches:
|
for image in matches:
|
||||||
if "/" in image['name']:
|
if "/" in image['name']:
|
||||||
@@ -726,7 +726,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'searchImageStatus': 0, 'error_message': str(msg)}
|
data_ret = {'searchImageStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -763,7 +763,7 @@ class ContainerManager(multi.Thread):
|
|||||||
getTag = tag.split(":")
|
getTag = tag.split(":")
|
||||||
if len(getTag) == 2:
|
if len(getTag) == 2:
|
||||||
tags.append(getTag[1])
|
tags.append(getTag[1])
|
||||||
print tags
|
print(tags)
|
||||||
if name in names:
|
if name in names:
|
||||||
images[name]['tags'].extend(tags)
|
images[name]['tags'].extend(tags)
|
||||||
else:
|
else:
|
||||||
@@ -776,7 +776,7 @@ class ContainerManager(multi.Thread):
|
|||||||
|
|
||||||
return render(request, 'dockerManager/images.html', {"images": images, "test": ''})
|
return render(request, 'dockerManager/images.html', {"images": images, "test": ''})
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def manageImages(self, request=None, userID=None, data=None):
|
def manageImages(self, request=None, userID=None, data=None):
|
||||||
@@ -810,7 +810,7 @@ class ContainerManager(multi.Thread):
|
|||||||
|
|
||||||
return render(request, 'dockerManager/manageImages.html', {"images": images})
|
return render(request, 'dockerManager/manageImages.html', {"images": images})
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return HttpResponse(str(msg))
|
return HttpResponse(str(msg))
|
||||||
|
|
||||||
def getImageHistory(self, userID=None, data=None):
|
def getImageHistory(self, userID=None, data=None):
|
||||||
@@ -836,7 +836,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'imageHistoryStatus': 0, 'error_message': str(msg)}
|
data_ret = {'imageHistoryStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -857,7 +857,7 @@ class ContainerManager(multi.Thread):
|
|||||||
action = client.images.prune()
|
action = client.images.prune()
|
||||||
else:
|
else:
|
||||||
action = client.images.remove(name)
|
action = client.images.remove(name)
|
||||||
print action
|
print(action)
|
||||||
except docker.errors.APIError as err:
|
except docker.errors.APIError as err:
|
||||||
data_ret = {'removeImageStatus': 0, 'error_message': str(err)}
|
data_ret = {'removeImageStatus': 0, 'error_message': str(err)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
@@ -871,7 +871,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'removeImageStatus': 0, 'error_message': str(msg)}
|
data_ret = {'removeImageStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -917,7 +917,7 @@ class ContainerManager(multi.Thread):
|
|||||||
con.save()
|
con.save()
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return str(msg)
|
return str(msg)
|
||||||
|
|
||||||
def saveContainerSettings(self, userID=None, data=None):
|
def saveContainerSettings(self, userID=None, data=None):
|
||||||
@@ -967,12 +967,12 @@ class ContainerManager(multi.Thread):
|
|||||||
if 'envConfirmation' in data and data['envConfirmation']:
|
if 'envConfirmation' in data and data['envConfirmation']:
|
||||||
# Formatting envList for usage
|
# Formatting envList for usage
|
||||||
envDict = {}
|
envDict = {}
|
||||||
for key, value in envList.iteritems():
|
for key, value in envList.items():
|
||||||
if (value['name'] != '') or (value['value'] != ''):
|
if (value['name'] != '') or (value['value'] != ''):
|
||||||
envDict[value['name']] = value['value']
|
envDict[value['name']] = value['value']
|
||||||
|
|
||||||
volumes = {}
|
volumes = {}
|
||||||
for index, volume in volList.iteritems():
|
for index, volume in volList.items():
|
||||||
if volume['src'] == '' or volume['dest'] == '':
|
if volume['src'] == '' or volume['dest'] == '':
|
||||||
continue
|
continue
|
||||||
volumes[volume['src']] = {'bind': volume['dest'],
|
volumes[volume['src']] = {'bind': volume['dest'],
|
||||||
@@ -1003,7 +1003,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'saveSettingsStatus': 0, 'error_message': str(msg)}
|
data_ret = {'saveSettingsStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -1053,7 +1053,7 @@ class ContainerManager(multi.Thread):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'recreateContainerStatus': 0, 'error_message': str(msg)}
|
data_ret = {'recreateContainerStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -1073,7 +1073,7 @@ class ContainerManager(multi.Thread):
|
|||||||
else:
|
else:
|
||||||
image2 = "library/" + image
|
image2 = "library/" + image
|
||||||
|
|
||||||
print image
|
print(image)
|
||||||
registryData = requests.get('https://registry.hub.docker.com/v2/repositories/' + image2 + '/tags',
|
registryData = requests.get('https://registry.hub.docker.com/v2/repositories/' + image2 + '/tags',
|
||||||
{'page': page}).json()
|
{'page': page}).json()
|
||||||
|
|
||||||
@@ -1084,7 +1084,7 @@ class ContainerManager(multi.Thread):
|
|||||||
data_ret = {'getTagsStatus': 1, 'list': tagList, 'next': registryData['next'], 'error_message': None}
|
data_ret = {'getTagsStatus': 1, 'list': tagList, 'next': registryData['next'], 'error_message': None}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'getTagsStatus': 0, 'error_message': str(msg)}
|
data_ret = {'getTagsStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -38,7 +38,7 @@ def preDockerRun(function):
|
|||||||
try:
|
try:
|
||||||
client = docker.from_env()
|
client = docker.from_env()
|
||||||
client.ping()
|
client.ping()
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
if isPost:
|
if isPost:
|
||||||
data_ret = {'status': 0, 'error_message': 'Docker daemon not running or not responsive'}
|
data_ret = {'status': 0, 'error_message': 'Docker daemon not running or not responsive'}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class DockerInstall:
|
|||||||
|
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, str(msg) + ' [404].', 1)
|
||||||
|
|
||||||
DockerInstall.submitInstallDocker()
|
DockerInstall.submitInstallDocker()
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from loginSystem.models import Administrator
|
from loginSystem.models import Administrator
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.shortcuts import render, redirect, HttpResponse
|
from django.shortcuts import render, redirect, HttpResponse
|
||||||
from loginSystem.models import Administrator
|
from loginSystem.models import Administrator
|
||||||
@@ -48,7 +48,7 @@ def installDocker(request):
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/local/CyberCP/bin/python2
|
#!/usr/local/CyberCP/bin/python2
|
||||||
from __future__ import absolute_import
|
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import csv
|
import csv
|
||||||
@@ -28,7 +28,7 @@ class emailMarketing(multi.Thread):
|
|||||||
self.verificationJob()
|
self.verificationJob()
|
||||||
elif self.function == 'startEmailJob':
|
elif self.function == 'startEmailJob':
|
||||||
self.startEmailJob()
|
self.startEmailJob()
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [emailMarketing.run]')
|
logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [emailMarketing.run]')
|
||||||
|
|
||||||
def createEmailList(self):
|
def createEmailList(self):
|
||||||
@@ -58,7 +58,7 @@ class emailMarketing(multi.Thread):
|
|||||||
newEmail.save()
|
newEmail.save()
|
||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], str(counter) + ' emails read.')
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], str(counter) + ' emails read.')
|
||||||
counter = counter + 1
|
counter = counter + 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
continue
|
continue
|
||||||
elif self.extraArgs['path'].endswith('.txt'):
|
elif self.extraArgs['path'].endswith('.txt'):
|
||||||
@@ -69,7 +69,7 @@ class emailMarketing(multi.Thread):
|
|||||||
if re.match('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', email) != None:
|
if re.match('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', email) != None:
|
||||||
try:
|
try:
|
||||||
getEmail = EmailsInList.objects.get(owner=newList, email=email)
|
getEmail = EmailsInList.objects.get(owner=newList, email=email)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
newEmail = EmailsInList(owner=newList, email=email, verificationStatus='NOT CHECKED',
|
newEmail = EmailsInList(owner=newList, email=email, verificationStatus='NOT CHECKED',
|
||||||
dateCreated=time.strftime("%I-%M-%S-%a-%b-%Y"))
|
dateCreated=time.strftime("%I-%M-%S-%a-%b-%Y"))
|
||||||
newEmail.save()
|
newEmail.save()
|
||||||
@@ -78,7 +78,7 @@ class emailMarketing(multi.Thread):
|
|||||||
emails = emailsList.readline()
|
emails = emailsList.readline()
|
||||||
|
|
||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], str(counter) + 'Successfully read all emails. [200]')
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], str(counter) + 'Successfully read all emails. [200]')
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], str(msg) +'. [404]')
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], str(msg) +'. [404]')
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -132,14 +132,14 @@ class emailMarketing(multi.Thread):
|
|||||||
|
|
||||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, str(counter) + ' emails verified so far..')
|
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, str(counter) + ' emails verified so far..')
|
||||||
counter = counter + 1
|
counter = counter + 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
items.verificationStatus = 'Verification Failed'
|
items.verificationStatus = 'Verification Failed'
|
||||||
items.save()
|
items.save()
|
||||||
counter = counter + 1
|
counter = counter + 1
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
|
|
||||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, str(counter) + ' emails successfully verified. [200]')
|
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, str(counter) + ' emails successfully verified. [200]')
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
verificationList = EmailLists.objects.get(listName=self.extraArgs['listName'])
|
verificationList = EmailLists.objects.get(listName=self.extraArgs['listName'])
|
||||||
domain = verificationList.owner.domain
|
domain = verificationList.owner.domain
|
||||||
tempStatusPath = '/home/cyberpanel/' + domain + "/" + self.extraArgs['listName']
|
tempStatusPath = '/home/cyberpanel/' + domain + "/" + self.extraArgs['listName']
|
||||||
@@ -235,7 +235,7 @@ class emailMarketing(multi.Thread):
|
|||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||||
'Successfully sent: ' + str(sent) + ' Failed: ' + str(
|
'Successfully sent: ' + str(sent) + ' Failed: ' + str(
|
||||||
failed))
|
failed))
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
failed = failed + 1
|
failed = failed + 1
|
||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||||
'Successfully sent: ' + str(
|
'Successfully sent: ' + str(
|
||||||
@@ -250,6 +250,6 @@ class emailMarketing(multi.Thread):
|
|||||||
|
|
||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||||
'Email job completed. [200]')
|
'Email job completed. [200]')
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], str(msg) + '. [404]')
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], str(msg) + '. [404]')
|
||||||
return 0
|
return 0
|
||||||
@@ -30,7 +30,7 @@ class EmailMarketingManager:
|
|||||||
return ACLManager.loadError()
|
return ACLManager.loadError()
|
||||||
|
|
||||||
return render(self.request, 'emailMarketing/emailMarketing.html')
|
return render(self.request, 'emailMarketing/emailMarketing.html')
|
||||||
except KeyError, msg:
|
except KeyError as msg:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
def fetchUsers(self):
|
def fetchUsers(self):
|
||||||
@@ -74,7 +74,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1, 'data': json_data}
|
data_ret = {"status": 1, 'data': json_data}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -103,7 +103,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1}
|
data_ret = {"status": 1}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -123,7 +123,7 @@ class EmailMarketingManager:
|
|||||||
return ACLManager.loadError()
|
return ACLManager.loadError()
|
||||||
|
|
||||||
return render(self.request, 'emailMarketing/createEmailList.html', {'domain': self.domain})
|
return render(self.request, 'emailMarketing/createEmailList.html', {'domain': self.domain})
|
||||||
except KeyError, msg:
|
except KeyError as msg:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
def submitEmailList(self):
|
def submitEmailList(self):
|
||||||
@@ -157,7 +157,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1, 'tempStatusPath': extraArgs['tempStatusPath']}
|
data_ret = {"status": 1, 'tempStatusPath': extraArgs['tempStatusPath']}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -178,7 +178,7 @@ class EmailMarketingManager:
|
|||||||
listNames = emACL.getEmailsLists(self.domain)
|
listNames = emACL.getEmailsLists(self.domain)
|
||||||
|
|
||||||
return render(self.request, 'emailMarketing/manageLists.html', {'listNames': listNames, 'domain': self.domain})
|
return render(self.request, 'emailMarketing/manageLists.html', {'listNames': listNames, 'domain': self.domain})
|
||||||
except KeyError, msg:
|
except KeyError as msg:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
def fetchEmails(self):
|
def fetchEmails(self):
|
||||||
@@ -251,7 +251,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1, 'data': json_data, 'pagination': pagination}
|
data_ret = {"status": 1, 'data': json_data, 'pagination': pagination}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -281,7 +281,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1}
|
data_ret = {"status": 1}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -314,7 +314,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1}
|
data_ret = {"status": 1}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -344,7 +344,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1}
|
data_ret = {"status": 1}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -370,7 +370,7 @@ class EmailMarketingManager:
|
|||||||
for items in emailLists:
|
for items in emailLists:
|
||||||
listNames.append(items.listName)
|
listNames.append(items.listName)
|
||||||
return render(self.request, 'emailMarketing/manageSMTPHosts.html', {'listNames': listNames, 'domain': self.domain})
|
return render(self.request, 'emailMarketing/manageSMTPHosts.html', {'listNames': listNames, 'domain': self.domain})
|
||||||
except KeyError, msg:
|
except KeyError as msg:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
def saveSMTPHost(self):
|
def saveSMTPHost(self):
|
||||||
@@ -420,7 +420,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1}
|
data_ret = {"status": 1}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -463,7 +463,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1, 'data': json_data}
|
data_ret = {"status": 1, 'data': json_data}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -515,7 +515,7 @@ class EmailMarketingManager:
|
|||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -529,7 +529,7 @@ class EmailMarketingManager:
|
|||||||
return ACLManager.loadErrorJson()
|
return ACLManager.loadErrorJson()
|
||||||
|
|
||||||
return render(self.request, 'emailMarketing/composeMessages.html')
|
return render(self.request, 'emailMarketing/composeMessages.html')
|
||||||
except KeyError, msg:
|
except KeyError as msg:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
def saveEmailTemplate(self):
|
def saveEmailTemplate(self):
|
||||||
@@ -557,7 +557,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1}
|
data_ret = {"status": 1}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -581,7 +581,7 @@ class EmailMarketingManager:
|
|||||||
Data['hostNames'] = hostNames
|
Data['hostNames'] = hostNames
|
||||||
Data['listNames'] = listNames
|
Data['listNames'] = listNames
|
||||||
return render(self.request, 'emailMarketing/sendEmails.html', Data)
|
return render(self.request, 'emailMarketing/sendEmails.html', Data)
|
||||||
except KeyError, msg:
|
except KeyError as msg:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
def templatePreview(self):
|
def templatePreview(self):
|
||||||
@@ -597,7 +597,7 @@ class EmailMarketingManager:
|
|||||||
return ACLManager.loadError()
|
return ACLManager.loadError()
|
||||||
|
|
||||||
return HttpResponse(template.emailMessage)
|
return HttpResponse(template.emailMessage)
|
||||||
except KeyError, msg:
|
except KeyError as msg:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
def fetchJobs(self):
|
def fetchJobs(self):
|
||||||
@@ -647,7 +647,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1, 'data': json_data}
|
data_ret = {"status": 1, 'data': json_data}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -689,7 +689,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1, 'tempStatusPath': extraArgs['tempStatusPath']}
|
data_ret = {"status": 1, 'tempStatusPath': extraArgs['tempStatusPath']}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -714,7 +714,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1}
|
data_ret = {"status": 1}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -734,7 +734,7 @@ class EmailMarketingManager:
|
|||||||
data_ret = {"status": 1}
|
data_ret = {"status": 1}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from websiteFunctions.models import Websites
|
from websiteFunctions.models import Websites
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
from loginSystem.views import loadLoginPage
|
from loginSystem.views import loadLoginPage
|
||||||
from emailMarketingManager import EmailMarketingManager
|
from emailMarketingManager import EmailMarketingManager
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from mailServer.models import Domains, EUsers
|
from mailServer.models import Domains, EUsers
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.shortcuts import render,redirect
|
from django.shortcuts import render,redirect
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
@@ -13,7 +13,7 @@ import json
|
|||||||
from .models import DomainLimits, EmailLimits
|
from .models import DomainLimits, EmailLimits
|
||||||
from math import ceil
|
from math import ceil
|
||||||
from postfixSenderPolicy.client import cacheClient
|
from postfixSenderPolicy.client import cacheClient
|
||||||
import thread
|
import _thread
|
||||||
from plogical.mailUtilities import mailUtilities
|
from plogical.mailUtilities import mailUtilities
|
||||||
from plogical.virtualHostUtilities import virtualHostUtilities
|
from plogical.virtualHostUtilities import virtualHostUtilities
|
||||||
from random import randint
|
from random import randint
|
||||||
@@ -67,12 +67,12 @@ def fetchPolicyServerStatus(request):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
@@ -115,12 +115,12 @@ def savePolicyServerStatus(request):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
@@ -174,7 +174,7 @@ def listDomains(request):
|
|||||||
|
|
||||||
return render(request,'emailPremium/listDomains.html',{"pagination":pagination, "installCheck": installCheck})
|
return render(request,'emailPremium/listDomains.html',{"pagination":pagination, "installCheck": installCheck})
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
return HttpResponse("See CyberCP main log file.")
|
return HttpResponse("See CyberCP main log file.")
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ def getFurtherDomains(request):
|
|||||||
status = data['page']
|
status = data['page']
|
||||||
pageNumber = int(status)
|
pageNumber = int(status)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
status = str(msg)
|
status = str(msg)
|
||||||
|
|
||||||
finalPageNumber = ((pageNumber * 10)) - 10
|
finalPageNumber = ((pageNumber * 10)) - 10
|
||||||
@@ -224,7 +224,7 @@ def getFurtherDomains(request):
|
|||||||
checker = 1
|
checker = 1
|
||||||
else:
|
else:
|
||||||
json_data = json_data +',' + json.dumps(dic)
|
json_data = json_data +',' + json.dumps(dic)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
try:
|
try:
|
||||||
domain = Domains.objects.get(domainOwner=items)
|
domain = Domains.objects.get(domainOwner=items)
|
||||||
except:
|
except:
|
||||||
@@ -249,13 +249,13 @@ def getFurtherDomains(request):
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
dic = {'listWebSiteStatus': 0, 'error_message': str(msg)}
|
dic = {'listWebSiteStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
dic = {'listWebSiteStatus': 0, 'error_message': str(msg)}
|
dic = {'listWebSiteStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -292,13 +292,13 @@ def enableDisableEmailLimits(request):
|
|||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
dic = {'statusa': 0, 'error_message': str(msg)}
|
dic = {'statusa': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -385,13 +385,13 @@ def changeDomainLimit(request):
|
|||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
dic = {'statusa': 0, 'error_message': str(msg)}
|
dic = {'statusa': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -435,7 +435,7 @@ def getFurtherEmail(request):
|
|||||||
checker = 1
|
checker = 1
|
||||||
else:
|
else:
|
||||||
json_data = json_data +',' + json.dumps(dic)
|
json_data = json_data +',' + json.dumps(dic)
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
|
|
||||||
json_data = json_data + ']'
|
json_data = json_data + ']'
|
||||||
@@ -445,13 +445,13 @@ def getFurtherEmail(request):
|
|||||||
|
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -484,12 +484,12 @@ def enableDisableIndividualEmailLimits(request):
|
|||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
dic = {'statusa': 0, 'error_message': str(msg)}
|
dic = {'statusa': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -558,13 +558,13 @@ def getEmailStats(request):
|
|||||||
|
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -597,12 +597,12 @@ def enableDisableIndividualEmailLogs(request):
|
|||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
dic = {'statusa': 0, 'error_message': str(msg)}
|
dic = {'statusa': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -668,13 +668,13 @@ def changeDomainEmailLimitsIndividual(request):
|
|||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
dic = {'statusa': 0, 'error_message': str(msg)}
|
dic = {'statusa': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -722,13 +722,13 @@ def getEmailLogs(request):
|
|||||||
|
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -757,12 +757,12 @@ def flushEmailLogs(request):
|
|||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
dic = {'status': 0, 'error_message': str(msg)}
|
dic = {'status': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
dic = {'statusa': 0, 'error_message': str(msg)}
|
dic = {'statusa': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(dic)
|
json_data = json.dumps(dic)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
@@ -807,7 +807,7 @@ def installSpamAssassin(request):
|
|||||||
|
|
||||||
final_json = json.dumps({'status': 1, 'error_message': "None"})
|
final_json = json.dumps({'status': 1, 'error_message': "None"})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -865,7 +865,7 @@ def installStatusSpamAssassin(request):
|
|||||||
'requestStatus': installStatus,
|
'requestStatus': installStatus,
|
||||||
})
|
})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
final_dic = {'abort':1,'installed':0, 'error_message': str(msg)}
|
final_dic = {'abort':1,'installed':0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -942,7 +942,7 @@ def fetchSpamAssassinSettings(request):
|
|||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
final_dic = {'fetchStatus': 0, 'error_message': str(msg)}
|
final_dic = {'fetchStatus': 0, 'error_message': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
@@ -1011,12 +1011,12 @@ def saveSpamAssassinConfigurations(request):
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
|
|
||||||
except BaseException,msg:
|
except BaseException as msg:
|
||||||
data_ret = {'saveStatus': 0, 'error_message': str(msg)}
|
data_ret = {'saveStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except KeyError,msg:
|
except KeyError as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||||
data_ret = {'saveStatus': 0, 'error_message': str(msg)}
|
data_ret = {'saveStatus': 0, 'error_message': str(msg)}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.shortcuts import render, HttpResponse
|
from django.shortcuts import render, HttpResponse
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from plogical.processUtilities import ProcessUtilities
|
|||||||
from websiteFunctions.models import Websites
|
from websiteFunctions.models import Websites
|
||||||
from random import randint
|
from random import randint
|
||||||
from django.core.files.storage import FileSystemStorage
|
from django.core.files.storage import FileSystemStorage
|
||||||
import HTMLParser
|
import html.parser
|
||||||
import os
|
import os
|
||||||
|
|
||||||
class FileManager:
|
class FileManager:
|
||||||
@@ -21,7 +21,7 @@ class FileManager:
|
|||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
def returnPathEnclosed(self, path):
|
def returnPathEnclosed(self, path):
|
||||||
htmlParser = HTMLParser.HTMLParser()
|
htmlParser = html.parser.HTMLParser()
|
||||||
path = htmlParser.unescape(path)
|
path = htmlParser.unescape(path)
|
||||||
return path
|
return path
|
||||||
return "'" + path + "'"
|
return "'" + path + "'"
|
||||||
@@ -55,7 +55,7 @@ class FileManager:
|
|||||||
for items in output:
|
for items in output:
|
||||||
try:
|
try:
|
||||||
currentFile = items.split(' ')
|
currentFile = items.split(' ')
|
||||||
currentFile = filter(lambda a: a != '', currentFile)
|
currentFile = [a for a in currentFile if a != '']
|
||||||
if currentFile[-1] == '.' or currentFile[-1] == '..' or currentFile[0] == 'total':
|
if currentFile[-1] == '.' or currentFile[-1] == '..' or currentFile[0] == 'total':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -72,13 +72,13 @@ class FileManager:
|
|||||||
finalData[str(counter)] = [currentFile[-1], currentFile[-1], lastModified, size, currentFile[0],
|
finalData[str(counter)] = [currentFile[-1], currentFile[-1], lastModified, size, currentFile[0],
|
||||||
dirCheck]
|
dirCheck]
|
||||||
counter = counter + 1
|
counter = counter + 1
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
|
|
||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def list(self):
|
def list(self):
|
||||||
@@ -97,7 +97,7 @@ class FileManager:
|
|||||||
for items in output:
|
for items in output:
|
||||||
try:
|
try:
|
||||||
currentFile = items.split(' ')
|
currentFile = items.split(' ')
|
||||||
currentFile = filter(lambda a: a != '', currentFile)
|
currentFile = [a for a in currentFile if a != '']
|
||||||
|
|
||||||
if currentFile[-1] == '.' or currentFile[-1] == '..' or currentFile[0] == 'total':
|
if currentFile[-1] == '.' or currentFile[-1] == '..' or currentFile[0] == 'total':
|
||||||
continue
|
continue
|
||||||
@@ -119,7 +119,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def createNewFile(self):
|
def createNewFile(self):
|
||||||
@@ -142,7 +142,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def createNewFolder(self):
|
def createNewFolder(self):
|
||||||
@@ -160,7 +160,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def deleteFolderOrFile(self):
|
def deleteFolderOrFile(self):
|
||||||
@@ -178,7 +178,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
@@ -212,7 +212,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def move(self):
|
def move(self):
|
||||||
@@ -238,7 +238,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def rename(self):
|
def rename(self):
|
||||||
@@ -261,7 +261,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def readFileContents(self):
|
def readFileContents(self):
|
||||||
@@ -278,7 +278,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def writeFileContents(self):
|
def writeFileContents(self):
|
||||||
@@ -313,7 +313,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def upload(self):
|
def upload(self):
|
||||||
@@ -345,7 +345,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def extract(self):
|
def extract(self):
|
||||||
@@ -372,7 +372,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def compress(self):
|
def compress(self):
|
||||||
@@ -405,7 +405,7 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
|
|
||||||
def changePermissions(self):
|
def changePermissions(self):
|
||||||
@@ -429,5 +429,5 @@ class FileManager:
|
|||||||
json_data = json.dumps(finalData)
|
json_data = json.dumps(finalData)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
except BaseException, msg:
|
except BaseException as msg:
|
||||||
return self.ajaxPre(0, str(msg))
|
return self.ajaxPre(0, str(msg))
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user