From c008db812a12e956fb42d88bef896485764fcd67 Mon Sep 17 00:00:00 2001 From: Hassan Hashmi <75794688+habbi-hb@users.noreply.github.com> Date: Fri, 27 May 2022 14:41:56 +0500 Subject: [PATCH] wpmanager --- plogical/applicationInstaller.py | 174 +++++++++++- plogical/phpUtilities.py | 29 ++ .../websiteFunctions/websiteFunctions.js | 265 ++++++++++++++++++ .../websiteFunctions/WPsiteHome.html | 203 +++++++++----- websiteFunctions/urls.py | 4 + websiteFunctions/views.py | 72 ++++- websiteFunctions/website.py | 100 ++++++- 7 files changed, 779 insertions(+), 68 deletions(-) diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 8c4741121..a2439c477 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -16,7 +16,7 @@ import threading as multi from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging import plogical.CyberCPLogFileWriter as logging import subprocess -from websiteFunctions.models import ChildDomains, Websites, WPSites +from websiteFunctions.models import ChildDomains, Websites, WPSites, WPStaging from plogical import randomPassword from plogical.mysqlUtilities import mysqlUtilities from databases.models import Databases @@ -74,6 +74,8 @@ class ApplicationInstaller(multi.Thread): self.DeletePlugins() elif self.installApp == 'ChangeStatusThemes': self.ChangeStatusThemes() + elif self.installApp == 'CreateStagingNow': + self.CreateStagingNow() except BaseException as msg: logging.writeToFile(str(msg) + ' [ApplicationInstaller.run]') @@ -1880,6 +1882,176 @@ $parameters = array( stdoutput = ProcessUtilities.outputExecutioner(command) + except BaseException as msg: + logging.CyberCPLogFileWriter.writeToFile("Error WP ChangeStatusThemes ....... %s" % str(msg)) + return 0 + + def CreateStagingNow(self): + try: + from websiteFunctions.website import WebsiteManager + import json + tempStatusPath = self.data['tempStatusPath'] + statusFile = open(tempStatusPath, 'w') + statusFile.writelines('Creating Website...,15') + + statusFile.close() + + wpobj = WPSites.objects.get(pk=self.data['WPid']) + + DataToPass = {} + + currentTemp = self.extraArgs['tempStatusPath'] + DataToPass['domainName'] = self.data['StagingDomain'] + DataToPass['adminEmail'] = wpobj.owner.adminEmail + DataToPass['phpSelection'] = wpobj.owner.phpSelection + DataToPass['websiteOwner'] = wpobj.owner.admin.userName + DataToPass['package'] = 'Default' + DataToPass['ssl'] = 1 + DataToPass['dkimCheck'] = 0 + DataToPass['openBasedir'] = 0 + DataToPass['mailDomain'] = 0 + UserID = self.data['adminID'] + + ab = WebsiteManager() + coreResult = ab.submitWebsiteCreation(UserID, DataToPass) + coreResult1 = json.loads((coreResult).content) + logging.CyberCPLogFileWriter.writeToFile("Creating website result....%s" % coreResult1) + reutrntempath = coreResult1['tempStatusPath'] + while (1): + lastLine = open(reutrntempath, 'r').read() + + if lastLine.find('[200]') > -1: + break + elif lastLine.find('[404]') > -1: + statusFile = open(currentTemp, 'w') + statusFile.writelines('Failed to Create Website: error: %s[404]' % lastLine) + statusFile.close() + return 0 + else: + statusFile = open(currentTemp, 'w') + statusFile.writelines('Creating Website....,20') + statusFile.close() + time.sleep(2) + + statusFile = open(tempStatusPath, 'w') + statusFile.writelines('Installing WordPress....') + statusFile.close() + + ####No crreating DataBAse............. + + statusFile = open(tempStatusPath, 'w') + statusFile.writelines('Creating DataBase....,30') + statusFile.close() + website = Websites.objects.get(domain=self.data['StagingDomain']) + + dbNameRestore, dbUser, dbPassword = self.dbCreation(tempStatusPath, website) + + statusFile = open(tempStatusPath, 'w') + statusFile.writelines('Creating Staging....,50') + statusFile.close() + + + masterDomain= wpobj.owner.domain + domain = self.data['StagingDomain'] + + path= wpobj.path + + Vhuser = website.externalApp + PHPVersion = website.phpSelection + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + command = '%s -d error_reporting=0 /usr/bin/wp core config --dbname=%s --dbuser=%s --dbpass=%s --dbhost=%s:%s --path=%s' % ( + FinalPHPPath, dbNameRestore, dbUser, dbPassword, ApplicationInstaller.LOCALHOST, ApplicationInstaller.PORT, path) + ProcessUtilities.executioner(command, website.externalApp) + + try: + masterPath = '/home/%s/public_html/%s' % (masterDomain, path) + replaceDomain = '%s/%s' % (masterDomain, path) + except: + masterPath = '/home/%s/public_html' % (masterDomain) + replaceDomain = masterDomain + + ### Get table prefix of master site + + command = '%s -d error_reporting=0 /usr/bin/wp config get table_prefix --allow-root --skip-plugins --skip-themes --path=%s' % ( + FinalPHPPath, masterPath) + TablePrefix = ProcessUtilities.outputExecutioner(command).rstrip('\n') + + ### Set table prefix + + command = '%s -d error_reporting=0 /usr/bin/wp config set table_prefix %s --path=%s' % ( + FinalPHPPath, TablePrefix, path) + ProcessUtilities.executioner(command, website.externalApp) + + ## Exporting and importing database + + command = '%s -d error_reporting=0 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=%s db export %s/dbexport-stage.sql' % ( + FinalPHPPath, masterPath, path) + ProcessUtilities.executioner(command) + + ## Import + + command = '%s -d error_reporting=0 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=%s --quiet db import %s/dbexport-stage.sql' % ( + FinalPHPPath, path, path) + ProcessUtilities.executioner(command) + + try: + command = 'rm -f %s/dbexport-stage.sql' % (path) + ProcessUtilities.executioner(command) + except: + pass + + ## Sync WP-Content Folder + + command = '%s -d error_reporting=0 /usr/bin/wp theme path --skip-plugins --skip-themes --allow-root --path=%s' % (FinalPHPPath, masterPath) + WpContentPath = ProcessUtilities.outputExecutioner(command).splitlines()[-1].replace('themes', '') + + command = 'cp -R %s %s/' % (WpContentPath, path) + ProcessUtilities.executioner(command) + + ## Copy htaccess + + command = 'cp -f %s/.htaccess %s/' % (WpContentPath.replace('/wp-content/', ''), path) + ProcessUtilities.executioner(command) + + ## Search and replace url + + command = '%s -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --allow-root --path=%s "%s" "%s"' % (FinalPHPPath, path, replaceDomain, domain) + ProcessUtilities.executioner(command) + + command = '%s -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --allow-root --path=%s "www.%s" "%s"' % (FinalPHPPath, path, domain, domain) + ProcessUtilities.executioner(command) + + command = '%s -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --allow-root --path=%s "https://%s" "http://%s"' % ( + FinalPHPPath, path, domain, domain) + ProcessUtilities.executioner(command) + + + from filemanager.filemanager import FileManager + + fm = FileManager(None, None) + fm.fixPermissions(masterDomain) + + from plogical.installUtilities import installUtilities + installUtilities.reStartLiteSpeed() + + + + wpsite = WPSites(owner=website, title=self.data['StagingName'], + path ="/home/%s/public_html"%(self.extraArgs['StagingDomain']), + FinalURL='%s' % (self.data['StagingDomain'])) + wpsite.save() + + WPStaging(wpsite=wpsite, owner=wpobj).save() + statusFile = open(currentTemp, 'w') + statusFile.writelines('statging Created..,[200]') + statusFile.close() + + + + + except BaseException as msg: logging.CyberCPLogFileWriter.writeToFile("Error WP ChangeStatusThemes ....... %s" % str(msg)) return 0 diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index 3e15258bf..3ab9f2f50 100755 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -10,6 +10,9 @@ import os from plogical.mailUtilities import mailUtilities from plogical.processUtilities import ProcessUtilities +import json +from django.urls import reverse + class phpUtilities: installLogPath = "/home/cyberpanel/phpExtensionRequestLog" @@ -182,6 +185,32 @@ class phpUtilities: print("0,"+str(msg)) + @staticmethod + def GetStagingInJson(stagings): + try: + + json_data = "[" + checker = 0 + counter = 1 + + for staging in stagings: + dic = { 'id': staging.wpsite.id ,'name': staging.wpsite.title, 'Domain': staging.wpsite.owner.domain, 'path': staging.wpsite.path, + #'url': reverse('WPHome', args=[staging.wpsite.owner.ProjectOwner.ProjectOwner.id, staging.wpsite.owner.ProjectOwner.id, staging.wpsite.id]), + 'deleteURL': '%s?ID=%s&DeleteID=%s' % (reverse('WPHome'), staging.owner.id, staging.id) + } + if checker == 0: + json_data = json_data + json.dumps(dic) + checker = 1 + else: + json_data = json_data + ',' + json.dumps(dic) + counter = counter + 1 + + json_data = json_data + ']' + return json_data + except BaseException as msg: + return msg + + def main(): diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 39ab651da..7e090f7ba 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -422,6 +422,12 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $compile, $ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $window) { $scope.wordpresshomeloading = true; + $scope.stagingDetailsForm = false; + $scope.installationProgress = true; + $scope.errorMessageBox = true; + $scope.success = true; + $scope.couldNotConnect = true; + $scope.goBackDisable = true; $(document).ready(function () { var checkstatus = document.getElementById("wordpresshome"); if (checkstatus !== null) { @@ -1004,6 +1010,197 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo AppendToTable('#ThemeBody', temp) } + $scope.CreateStagingNow = function () { + + $scope.wordpresshomeloading = false; + $scope.stagingDetailsForm = true; + $scope.installationProgress = false; + $scope.errorMessageBox = true; + $scope.success = true; + $scope.couldNotConnect = true; + $scope.goBackDisable = true; + + + $scope.currentStatus = "Starting creation Staging.."; + var data = { + StagingName: $('#stagingName').val(), + StagingDomain: $('#stagingDomain').val(), + WPid: $('#WPid').html(), + } + var url = "/websites/CreateStagingNow"; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + + if (response.data.status === 1) { + statusFile = response.data.tempStatusPath; + getCreationStatus(); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.wordpresshomeloading = true; + alert(response) + + } + }; + + function getCreationStatus() { + + url = "/websites/installWordpressStatus"; + + var data = { + statusFile: statusFile + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + + + if (response.data.abort === 1) { + + if (response.data.installStatus === 1) { + + + $scope.wordpresshomeloading = true; + $scope.stagingDetailsForm = true; + $scope.installationProgress = false; + $scope.errorMessageBox = true; + $scope.success = false; + $scope.couldNotConnect = true; + $scope.goBackDisable = false; + + $("#installProgress").css("width", "100%"); + $scope.installPercentage = "100"; + $scope.currentStatus = response.data.currentStatus; + $timeout.cancel(); + + } else { + + $scope.wordpresshomeloading = true; + $scope.stagingDetailsForm = true; + $scope.installationProgress = false; + $scope.errorMessageBox = false; + $scope.success = true; + $scope.couldNotConnect = true; + $scope.goBackDisable = false; + + $scope.errorMessage = response.data.error_message; + + $("#installProgress").css("width", "0%"); + $scope.installPercentage = "0"; + $scope.goBackDisable = false; + + } + + } else { + $("#installProgress").css("width", response.data.installationProgress + "%"); + $scope.installPercentage = response.data.installationProgress; + $scope.currentStatus = response.data.currentStatus; + $timeout(getCreationStatus, 1000); + } + + } + + function cantLoadInitialDatas(response) { + + $scope.wordpresshomeloading = true; + $scope.stagingDetailsForm = true; + $scope.installationProgress = false; + $scope.errorMessageBox = true; + $scope.success = true; + $scope.couldNotConnect = false; + $scope.goBackDisable = false; + + } + + + } + + $scope.goBack = function () { + $scope.wordpresshomeloading = true; + $scope.stagingDetailsForm = false; + $scope.installationProgress = true; + $scope.errorMessageBox = true; + $scope.success = true; + $scope.couldNotConnect = true; + $scope.goBackDisable = true; + $("#installProgress").css("width", "0%"); + }; + + $scope.fetchstaging = function () { + $scope.wordpresshomeloading = false; + + var url = "/websites/fetchstaging"; + + var data = { + WPid: $('#WPid').html(), + } + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + wordpresshomeloading = true; + + if (response.data.status === 1) { + + // $('#ThemeBody').html(''); + // var themes = JSON.parse(response.data.themes); + // themes.forEach(AddThemes); + + $('#StagingBody').html(''); + var staging = JSON.parse(response.data.wpsites); + staging.forEach(AddStagings); + + } else { + alert("Error data.error_message:" + response.data.error_message) + + } + + } + + function cantLoadInitialDatas(response) { + alert("Error"+response) + + } + + }; + + $scope.autoLogin = function () { var url = "/websites/DeleteThemes"; //window.open("/wpmanager/" + $('#HostingCompanyID').html() + "/manage/" + server + "/" + wordpress + "/AutoLogin"); @@ -1011,8 +1208,76 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo window.open("/websites/AutoLogin?WordPressID="+sub.id); } + $scope.SaveUpdateConfig =function () { + var data = { + AutomaticUpdates: $('#AutomaticUpdates').find(":selected").text(), + Plugins: $('#Plugins').find(":selected").text(), + Themes: $('#Themes').find(":selected").text(), + WPid: $('#WPid').html(), + } + + $scope.wordpresshomeloading = false; + + var url = "/websites/SaveUpdateConfig"; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.wordpresshomeloading = true; + + if (response.data.status === 1) { + new PNotify({ + title: 'Success!', + text: 'Update Configurations Sucessfully!.', + type: 'success' + }); + $("#autoUpdateConfig").modal('hide'); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + new PNotify({ + title: 'Operation Failed!', + text: response, + type: 'error' + }); + + } + }; + }); +function AddStagings(value, index, array) { + var FinalMarkup = '' + for (let x in value) { + if (x === 'name') { + FinalMarkup = FinalMarkup + '' + value[x] + ''; + } else if (x !== 'url' && x !== 'deleteURL' && x !== 'id') { + FinalMarkup = FinalMarkup + '' + value[x] + ""; + } + } + FinalMarkup = FinalMarkup + '' + + ' ' + FinalMarkup = FinalMarkup + '' + AppendToTable('#StagingBody', FinalMarkup); +} + var PluginsList = []; diff --git a/websiteFunctions/templates/websiteFunctions/WPsiteHome.html b/websiteFunctions/templates/websiteFunctions/WPsiteHome.html index 71c75cae8..3eb4a101d 100644 --- a/websiteFunctions/templates/websiteFunctions/WPsiteHome.html +++ b/websiteFunctions/templates/websiteFunctions/WPsiteHome.html @@ -61,75 +61,69 @@ diff --git a/websiteFunctions/urls.py b/websiteFunctions/urls.py index 513be2345..23d8efa3a 100755 --- a/websiteFunctions/urls.py +++ b/websiteFunctions/urls.py @@ -35,6 +35,10 @@ urlpatterns = [ url(r'^UpdateThemes', views.UpdateThemes, name='UpdateThemes'), url(r'^DeleteThemes', views.DeleteThemes, name='DeleteThemes'), url(r'^StatusThemes', views.StatusThemes, name='StatusThemes'), + url(r'^CreateStagingNow', views.CreateStagingNow, name='CreateStagingNow'), + url(r'^fetchstaging', views.fetchstaging, name='fetchstaging'), + url(r'^SaveUpdateConfig', views.SaveUpdateConfig, name='SaveUpdateConfig'), + diff --git a/websiteFunctions/views.py b/websiteFunctions/views.py index 1229736b3..e776e60a5 100755 --- a/websiteFunctions/views.py +++ b/websiteFunctions/views.py @@ -50,8 +50,9 @@ def WPHome(request): userID = request.session['userID'] WPid = request.GET.get('ID') + DeleteID = request.GET.get('DeleteID') wm = WebsiteManager() - return wm.WPHome(request, userID, WPid) + return wm.WPHome(request, userID, WPid, DeleteID) except KeyError: return redirect(loadLoginPage) def AutoLogin(request): @@ -89,6 +90,9 @@ def Addnewplugin(request): except KeyError: return redirect(loadLoginPage) + + + def SearchOnkeyupPlugin(request): try: userID = request.session['userID'] @@ -243,6 +247,50 @@ def GetCurrentPlugins(request): wm = WebsiteManager() coreResult = wm.GetCurrentPlugins(userID, json.loads(request.body)) + # coreResult = wm.GetCsurrentPlugins(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + +def fetchstaging(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.fetchstaging(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + +def SaveUpdateConfig(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.SaveUpdateConfig(userID, json.loads(request.body)) result = pluginManager.postWebsiteCreation(request, coreResult) if result != 200: @@ -431,6 +479,28 @@ def StatusThemes(request): return redirect(loadLoginPage) +def CreateStagingNow(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.CreateStagingNow(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + def modifyWebsite(request): try: diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 306fd1e39..f5223d15b 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -12,7 +12,7 @@ django.setup() import json from plogical.acl import ACLManager import plogical.CyberCPLogFileWriter as logging -from websiteFunctions.models import Websites, ChildDomains, GitLogs, wpplugins, WPSites +from websiteFunctions.models import Websites, ChildDomains, GitLogs, wpplugins, WPSites, WPStaging from plogical.virtualHostUtilities import virtualHostUtilities import subprocess import shlex @@ -113,13 +113,23 @@ class WebsiteManager: {"wpsite": tata['wpsites']}) return proc.render() - def WPHome(self, request=None, userID=None, WPid=None): + def WPHome(self, request=None, userID=None, WPid=None, DeleteID=None): Data = {} currentACL = ACLManager.loadedACL(userID) WPobj = WPSites.objects.get(pk=WPid) Data['wpsite'] = WPobj + try: + DeleteID = request.GET.get('DeleteID', None) + + if DeleteID != None: + wstagingDelete = WPStaging.objects.get(pk=DeleteID) + wstagingDelete.delete() + + except BaseException as msg: + + da= str(msg) proc = httpProc(request, 'websiteFunctions/WPsiteHome.html', Data, 'createWebsite') @@ -548,6 +558,63 @@ class WebsiteManager: return HttpResponse(json_data) + def fetchstaging(self, userID=None, data=None): + try: + + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + WPManagerID = data['WPid'] + wpsite = WPSites.objects.get(pk=WPManagerID) + + + from plogical.phpUtilities import phpUtilities + + + json_data = phpUtilities.GetStagingInJson(wpsite.wpstaging_set.all().order_by('-id')) + + + data_ret = {'status': 1, 'error_message': 'None', 'wpsites': json_data} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + + + except BaseException as msg: + data_ret = {'status': 0, 'installStatus': 0, 'error_message': str(msg)} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + + + + def SaveUpdateConfig(self, userID=None, data=None): + try: + + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + WPManagerID = data['WPid'] + Plugins = data['Plugins'] + Themes = data['Themes'] + AutomaticUpdates = data['AutomaticUpdates'] + + wpsite = WPSites.objects.get(pk=WPManagerID) + + wpsite.AutoUpdates = AutomaticUpdates + wpsite.PluginUpdates = Plugins + wpsite.ThemeUpdates = Themes + wpsite.save() + + data_ret = {'status': 1, 'error_message': 'None',} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + + + except BaseException as msg: + data_ret = {'status': 0, 'installStatus': 0, 'error_message': str(msg)} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + + def UpdatePlugins(self, userID=None, data=None): try: @@ -828,6 +895,35 @@ class WebsiteManager: return HttpResponse(json_data) + def CreateStagingNow(self, userID=None, data=None): + try: + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + extraArgs = {} + extraArgs['adminID'] = admin.pk + extraArgs['StagingDomain'] = data['StagingDomain'] + extraArgs['StagingName'] = data['StagingName'] + extraArgs['WPid'] = data['WPid'] + extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999)) + + background = ApplicationInstaller('CreateStagingNow', extraArgs) + background.start() + + time.sleep(2) + + data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None', + 'tempStatusPath': extraArgs['tempStatusPath']} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + + + except BaseException as msg: + data_ret = {'status': 0, 'installStatus': 0, 'error_message': str(msg)} + json_data = json.dumps(data_ret) + return HttpResponse(json_data) + + def UpdateWPSettings(self, userID=None, data=None):