From 6e6aa0485062fb650d28c6255c056b7daef5fbb3 Mon Sep 17 00:00:00 2001 From: habi Date: Tue, 24 May 2022 11:16:49 +0500 Subject: [PATCH] tab3 --- CyberCP/settings.py | 2 +- .../templates/baseTemplate/index.html | 2 +- plogical/acl.py | 26 + plogical/applicationInstaller.py | 162 ++++- websiteFunctions/models.py | 6 +- .../websiteFunctions/websiteFunctions.js | 637 +++++++++++++++++- .../websiteFunctions/WPsiteHome.html | 416 ++++++++++++ .../websiteFunctions/WPsitesList.html | 95 +++ websiteFunctions/urls.py | 18 + websiteFunctions/views.py | 248 +++++++ websiteFunctions/website.py | 590 +++++++++++++++- 11 files changed, 2193 insertions(+), 9 deletions(-) create mode 100644 websiteFunctions/templates/websiteFunctions/WPsiteHome.html create mode 100644 websiteFunctions/templates/websiteFunctions/WPsitesList.html diff --git a/CyberCP/settings.py b/CyberCP/settings.py index ef8b84ed8..f20c69b48 100755 --- a/CyberCP/settings.py +++ b/CyberCP/settings.py @@ -24,7 +24,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = 'xr%j*p!*$0d%(-(e%@-*hyoz4$f%y77coq0u)6pwmjg4)q&19f' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = True ALLOWED_HOSTS = ['*'] diff --git a/baseTemplate/templates/baseTemplate/index.html b/baseTemplate/templates/baseTemplate/index.html index c97c617b4..b7309d3f8 100755 --- a/baseTemplate/templates/baseTemplate/index.html +++ b/baseTemplate/templates/baseTemplate/index.html @@ -405,7 +405,7 @@ title="{% trans 'Create Worpress' %}">{% trans "Create Worpress" %} {% endif %} -
  • {% trans "List Worpress" %}
  • -1: + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp theme deactivate %s --skip-plugins --skip-themes --path=%s' % ( + Vhuser, FinalPHPPath, Theme, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + else: + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp theme activate %s --skip-plugins --skip-themes --path=%s' % ( + Vhuser, FinalPHPPath, Theme, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + + except BaseException as msg: + logging.CyberCPLogFileWriter.writeToFile("Error WP ChangeStatusThemes ....... %s" % str(msg)) + return 0 + + + def main(): parser = argparse.ArgumentParser(description='CyberPanel Application Installer') parser.add_argument('function', help='Specify a function to call!') diff --git a/websiteFunctions/models.py b/websiteFunctions/models.py index 9f58f118d..21f0a6308 100755 --- a/websiteFunctions/models.py +++ b/websiteFunctions/models.py @@ -116,4 +116,8 @@ class WPSites(models.Model): PluginUpdates = models.CharField(max_length=15, default='Disabled') ThemeUpdates = models.CharField(max_length=15, default='Disabled') date = models.DateTimeField(default=datetime.now) - WPLockState = models.IntegerField(default=1) \ No newline at end of file + WPLockState = models.IntegerField(default=1) + +class WPStaging(models.Model): + owner = models.ForeignKey(WPSites, on_delete=models.CASCADE) + wpsite = models.ForeignKey(WPSites, on_delete=models.CASCADE, related_name='actual_wpsite') \ No newline at end of file diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 12fadf451..39ab651da 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -1,8 +1,6 @@ /** * Created by usman on 7/26/17. */ - - function getCookie(name) { var cookieValue = null; var t = document.cookie; @@ -244,7 +242,7 @@ app.controller('WPAddNewPlugin', function ($scope, $http, $timeout, $window, $co }); -app.controller('createWordpress', function ($scope, $http, $timeout, $window) { +app.controller('createWordpress', function ($scope, $http, $timeout, $compile, $window) { $scope.webSiteCreationLoading = true; $scope.installationDetailsForm = false; $scope.installationProgress = true; @@ -319,6 +317,7 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $window) { } + function cantLoadInitialDatas(response) { alert("Error..." + response) @@ -336,7 +335,8 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $window) { $scope.goBackDisable = true; $("#installProgress").css("width", "0%"); }; - function getCreationStatus() { + + function getCreationStatus() { url = "/websites/installWordpressStatus"; @@ -417,9 +417,638 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $window) { } +}); + + +app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $window) { + $scope.wordpresshomeloading = true; + $(document).ready(function () { + var checkstatus = document.getElementById("wordpresshome"); + if (checkstatus !== null) { + $scope.LoadWPdata(); + + } + }); + + + $scope.LoadWPdata = function () { + + $scope.wordpresshomeloading = false; + + var url = "/websites/FetchWPdata"; + + var data = { + WPid: $('#WPid').html(), + } + + console.log(data); + 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) { + $('#WPVersion').text(response.data.ret_data.version); + if (response.data.ret_data.lscache === 1) { + $('#lscache').prop('checked', true); + } + if (response.data.ret_data.debugging === 1) { + $('#debugging').prop('checked', true); + } + if (response.data.ret_data.searchIndex === 1) { + $('#searchIndex').prop('checked', true); + } + if (response.data.ret_data.maintenanceMode === 1) { + $('#maintenanceMode').prop('checked', true); + } + + } else { + alert("Error:" + response.data.error_message) + + } + + } + + function cantLoadInitialDatas(response) { + + $scope.webSiteCreationLoading = true; + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.errorMessageBox = true; + $scope.success = true; + $scope.couldNotConnect = false; + $scope.goBackDisable = false; + + } + + + }; + + $scope.UpdateWPSettings = function (setting) { + + $scope.wordpresshomeloading = false; + + var settingValue = 0; + + if ($('#' + setting).is(":checked")) { + settingValue = 1; + } + + var url = "/websites/UpdateWPSettings"; + + var data = { + WPid: $('#WPid').html(), + setting: setting, + settingValue: settingValue + + + } + + + 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: 'Successfully Updated!.', + type: 'success' + }); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.wordpresshomeloading = true; + alert(response) + + } + + + }; + + + $scope.GetCurrentPlugins = function () { + + $scope.wordpresshomeloading = false; + + var url = "/websites/GetCurrentPlugins"; + + 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) { + $('#PluginBody').html(''); + var plugins = JSON.parse(response.data.plugins); + plugins.forEach(AddPlugins); + + } else { + alert("Error:" + response.data.error_message) + + } + + } + + function cantLoadInitialDatas(response) { + + $scope.webSiteCreationLoading = true; + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.errorMessageBox = true; + $scope.success = true; + $scope.couldNotConnect = false; + $scope.goBackDisable = false; + + } + + + }; + + + $scope.GetCurrentThemes = function () { + + $scope.wordpresshomeloading = false; + + var url = "/websites/GetCurrentThemes"; + + 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); + + } else { + alert("Error:" + response.data.error_message) + + } + + } + + function cantLoadInitialDatas(response) { + + $scope.webSiteCreationLoading = true; + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.errorMessageBox = true; + $scope.success = true; + $scope.couldNotConnect = false; + $scope.goBackDisable = false; + + } + + + }; + + $scope.UpdatePlugins = function (plugin) { + + var data = { + plugin: plugin, + pluginarray: PluginsList, + WPid: $('#WPid').html(), + } + + $scope.wordpresshomeloading = false; + + var url = "/websites/UpdatePlugins"; + + 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: 'Updating Plugins in Background!.', + type: 'success' + }); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.wordpresshomeloading = true; + alert(response) + + } + + + }; + + $scope.DeletePlugins = function (plugin) { + var data = { + plugin: plugin, + pluginarray: PluginsList, + WPid: $('#WPid').html(), + } + + $scope.wordpresshomeloading = false; + + var url = "/websites/DeletePlugins"; + + 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: 'Deleting Plugin in Background!', + type: 'success' + }); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.wordpresshomeloading = true; + alert(response) + + } + + } + + $scope.ChangeStatus = function (plugin) { + var data = { + plugin: plugin, + WPid: $('#WPid').html(), + } + + $scope.wordpresshomeloading = false; + + var url = "/websites/ChangeStatus"; + + 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: 'Changed Plugin state Successfully !.', + type: 'success' + }); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.wordpresshomeloading = true; + alert(response) + + } + + } + + function AddPlugins(value, index, array) { + var FinalMarkup = '' + FinalMarkup = FinalMarkup + ''; + for (let x in value) { + if (x === 'status') { + if (value[x] === 'inactive') { + FinalMarkup = FinalMarkup + '
    '; + } else { + FinalMarkup = FinalMarkup + '
    '; + } + } else if (x === 'update') { + if (value[x] === 'none') { + FinalMarkup = FinalMarkup + 'Upto Date'; + } else { + FinalMarkup = FinalMarkup + ''; + } + } else { + FinalMarkup = FinalMarkup + '' + value[x] + ""; + } + } + FinalMarkup = FinalMarkup + '' + FinalMarkup = FinalMarkup + '' + var temp = $compile(FinalMarkup)($scope) + AppendToTable('#PluginBody', temp) + } + + $scope.UpdateThemes = function (theme) { + + + var data = { + Theme: theme, + Themearray: ThemesList, + WPid: $('#WPid').html(), + } + + $scope.wordpresshomeloading = false; + + var url = "/websites/UpdateThemes"; + + 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: 'Updating Theme in background !.', + type: 'success' + }); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.wordpresshomeloading = true; + alert(response) + + } + + + }; + + $scope.DeleteThemes = function (theme) { + var data = { + Theme: theme, + Themearray: ThemesList, + WPid: $('#WPid').html(), + } + + $scope.wordpresshomeloading = false; + + var url = "/websites/DeleteThemes"; + + 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: 'Deleting Theme in Background!.', + type: 'success' + }); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.wordpresshomeloading = true; + alert(response) + + } + }; + + $scope.ChangeStatusThemes = function (theme) { + var data = { + theme: theme, + WPid: $('#WPid').html(), + } + + $scope.wordpresshomeloading = false; + + var url = "/websites/StatusThemes"; + + 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: 'Change Theme state in Bsckground!.', + type: 'success' + }); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.wordpresshomeloading = true; + alert(response) + + } + + }; + + + function AddThemes(value, index, array) { + var FinalMarkup = '' + FinalMarkup = FinalMarkup + ''; + for (let x in value) { + if (x === 'status') { + if (value[x] === 'inactive') { + FinalMarkup = FinalMarkup + '
    '; + } else { + FinalMarkup = FinalMarkup + '
    '; + } + } else if (x === 'update') { + if (value[x] === 'none') { + FinalMarkup = FinalMarkup + 'Upto Date'; + } else { + FinalMarkup = FinalMarkup + ''; + } + } else { + FinalMarkup = FinalMarkup + '' + value[x] + ""; + } + } + FinalMarkup = FinalMarkup + '' + FinalMarkup = FinalMarkup + '' + var temp = $compile(FinalMarkup)($scope) + AppendToTable('#ThemeBody', temp) + } + + $scope.autoLogin = function () { + var url = "/websites/DeleteThemes"; + //window.open("/wpmanager/" + $('#HostingCompanyID').html() + "/manage/" + server + "/" + wordpress + "/AutoLogin"); + var WPid = $('#WPid').html(); + window.open("/websites/AutoLogin?WordPressID="+sub.id); + } }); +var PluginsList = []; + + +function AddPluginToArray(cBox, name) { + if (cBox.checked) { + PluginsList.push(name); + alert(PluginsList); + } else { + const index = PluginsList.indexOf(name); + if (index > -1) { + PluginsList.splice(index, 1); + } + alert(PluginsList); + } +} + +var ThemesList = []; + +function AddThemeToArray(cBox, name) { + if (cBox.checked) { + ThemesList.push(name); + alert(ThemesList); + } else { + const index = ThemesList.indexOf(name); + if (index > -1) { + ThemesList.splice(index, 1); + } + alert(ThemesList); + } +} + + +function AppendToTable(table, markup) { + $(table).append(markup); +} + /* Java script code to create account */ app.controller('createWebsite', function ($scope, $http, $timeout, $window) { diff --git a/websiteFunctions/templates/websiteFunctions/WPsiteHome.html b/websiteFunctions/templates/websiteFunctions/WPsiteHome.html new file mode 100644 index 000000000..71c75cae8 --- /dev/null +++ b/websiteFunctions/templates/websiteFunctions/WPsiteHome.html @@ -0,0 +1,416 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Websites Hosted - CyberPanel" %}{% endblock %} +{% block content %} + + {% load static %} + {% get_current_language as LANGUAGE_CODE %} + + + + + +
    + +
    +
    +
    +
    +
    +
    +
    + + + {{ wpsite.FinalURL }} + +
    +
    + + + Manage Application + + + + Autoupdate Configurations + + +
    +
    +
    + + +

    {{ wpsite.title }}

    +

    ({{ wpsite.path }}) +

    + + +
    +
    + +
    +
    + +
    +
    +
    +
    WordPress Version
    +

    +
    +
    +
    PHP
    +

    {{ wpsite.owner.phpSelection }}

    +
    +
    +
    LSCache
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    Debugging
    +
    + + +
    +
    +
    +
    Search Engine Indexing
    +
    + + +
    +
    +
    +
    Maintenance mode
    +
    + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + + + + + + + + + + + + + +
    + {% comment %}
    + + +
    {% endcomment %} +
    PluginStateUpdatesVersionDelete
    +
    +
    +
    + +
    +
    + +
    +
    +
    + + + + + + + + + + + + + +
    + {% comment %}
    + + +
    {% endcomment %} +
    ThemeStateUpdatesVersionDelete
    +
    +
    +

    Howdy, I'm in Section 4.

    +
    + + +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    +
    + + +
    + +{% endblock %} diff --git a/websiteFunctions/templates/websiteFunctions/WPsitesList.html b/websiteFunctions/templates/websiteFunctions/WPsitesList.html new file mode 100644 index 000000000..e8f739571 --- /dev/null +++ b/websiteFunctions/templates/websiteFunctions/WPsitesList.html @@ -0,0 +1,95 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Websites Hosted - CyberPanel" %}{% endblock %} +{% block content %} + + {% load static %} + {% get_current_language as LANGUAGE_CODE %} + + + + +
    + +
    +

    {% trans "List WordPress Websites" %} + {% trans "Create WordPress Website" %} +

    + +

    {% trans "On this page you can launch, list, modify and delete websites from your server." %}

    +
    + + + + + + + + + + + + + + + + {% for sub in wpsite %} + + + + + + + + + + {% endfor %} + + + + + +
    + +{% endblock %} diff --git a/websiteFunctions/urls.py b/websiteFunctions/urls.py index cf6169120..513be2345 100755 --- a/websiteFunctions/urls.py +++ b/websiteFunctions/urls.py @@ -18,15 +18,33 @@ urlpatterns = [ ### WordPress url(r'^createWordpress$', views.WPCreate, name='createWordpress'), + url(r'^ListWPSites$', views.ListWPSites, name='ListWPSites'), + url(r'^WPHome$', views.WPHome, name='WPHome'), + url(r'^AutoLogin$', views.AutoLogin, name='AutoLogin'), + ###WordPress Ajax url(r'^submitWorpressCreation', views.submitWorpressCreation, name='submitWorpressCreation'), + url(r'^FetchWPdata', views.FetchWPdata, name='FetchWPdata'), + url(r'^GetCurrentPlugins', views.GetCurrentPlugins, name='GetCurrentPlugins'), + url(r'^GetCurrentThemes', views.GetCurrentThemes, name='GetCurrentThemes'), + url(r'^UpdateWPSettings', views.UpdateWPSettings, name='UpdateWPSettings'), + url(r'^UpdatePlugins', views.UpdatePlugins, name='UpdatePlugins'), + url(r'^DeletePlugins', views.DeletePlugins, name='DeletePlugins'), + url(r'^ChangeStatus', views.ChangeStatus, name='ChangeStatus'), + url(r'^UpdateThemes', views.UpdateThemes, name='UpdateThemes'), + url(r'^DeleteThemes', views.DeleteThemes, name='DeleteThemes'), + url(r'^StatusThemes', views.StatusThemes, name='StatusThemes'), + + #### AddPlugin url(r'^ConfigurePlugins$', views.ConfigurePlugins, name='ConfigurePlugins'), url(r'^Addnewplugin$', views.Addnewplugin, name='Addnewplugin'), url(r'^EidtPlugin$', views.EidtPlugin, name='EidtPlugin'), + + ## AddPlugin Ajax url(r'^SearchOnkeyupPlugin$', views.SearchOnkeyupPlugin, name='SearchOnkeyupPlugin'), url(r'^AddNewpluginAjax$', views.AddNewpluginAjax, name='AddNewpluginAjax'), diff --git a/websiteFunctions/views.py b/websiteFunctions/views.py index b7c98cd26..1229736b3 100755 --- a/websiteFunctions/views.py +++ b/websiteFunctions/views.py @@ -36,6 +36,33 @@ def WPCreate(request): return wm.WPCreate(request, userID) except KeyError: return redirect(loadLoginPage) + +def ListWPSites(request): + try: + userID = request.session['userID'] + wm = WebsiteManager() + return wm.ListWPSites(request, userID) + except KeyError: + return redirect(loadLoginPage) + +def WPHome(request): + try: + userID = request.session['userID'] + + WPid = request.GET.get('ID') + wm = WebsiteManager() + return wm.WPHome(request, userID, WPid) + except KeyError: + return redirect(loadLoginPage) +def AutoLogin(request): + try: + userID = request.session['userID'] + + WPid = request.GET.get('ID') + wm = WebsiteManager() + return wm.AutoLogin(request, userID, WPid) + except KeyError: + return redirect(loadLoginPage) def ConfigurePlugins(request): try: userID = request.session['userID'] @@ -183,6 +210,227 @@ def submitWorpressCreation(request): return redirect(loadLoginPage) +def FetchWPdata(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.FetchWPdata(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + +def GetCurrentPlugins(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.GetCurrentPlugins(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + + +def GetCurrentThemes(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.GetCurrentThemes(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + +def UpdateWPSettings(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.UpdateWPSettings(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + +def UpdatePlugins(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.UpdatePlugins(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + +def UpdateThemes(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.UpdateThemes(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + +def DeletePlugins(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.DeletePlugins(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + +def DeleteThemes(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.DeleteThemes(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + +def ChangeStatus(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.ChangeStatus(userID, json.loads(request.body)) + + result = pluginManager.postWebsiteCreation(request, coreResult) + if result != 200: + return result + + return coreResult + + except KeyError: + return redirect(loadLoginPage) + + +def StatusThemes(request): + try: + userID = request.session['userID'] + + result = pluginManager.preWebsiteCreation(request) + + if result != 200: + return result + + wm = WebsiteManager() + coreResult = wm.ChangeStatusThemes(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 cac8adc65..306fd1e39 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 +from websiteFunctions.models import Websites, ChildDomains, GitLogs, wpplugins, WPSites from plogical.virtualHostUtilities import virtualHostUtilities import subprocess import shlex @@ -91,6 +91,63 @@ class WebsiteManager: Data, 'createWebsite') return proc.render() + def ListWPSites(self, request=None, userID=None, data=None): + currentACL = ACLManager.loadedACL(userID) + + userobj = Administrator.objects.get(pk=userID) + webobjs = Websites.objects.all() + tata = {} + tata['wp']=[] + tata['wpsites']=[] + tata['wp'] = WPSites.objects.all() + + for sub in tata['wp']: + tata['wpsites'].append({'id': sub.id, + 'title': sub.title, + 'url': sub.FinalURL + }) + + + + proc = httpProc(request, 'websiteFunctions/WPsitesList.html', + {"wpsite": tata['wpsites']}) + return proc.render() + + def WPHome(self, request=None, userID=None, WPid=None): + Data = {} + currentACL = ACLManager.loadedACL(userID) + WPobj = WPSites.objects.get(pk=WPid) + + Data['wpsite'] = WPobj + + + proc = httpProc(request, 'websiteFunctions/WPsiteHome.html', + Data, 'createWebsite') + return proc.render() + + def AutoLogin(self, request=None, userID=None, WPid=None): + pass + # data = {} + # currentACL = ACLManager.loadedACL(userID) + # WPobj = WPSites.objects.get(pk=WPid) + # + # data['wpsite'] = WPobj + # + # if data['wpsite'].FinalURL.endswith('/'): + # FinalURL = data['wpsite'].FinalURL[:-1] + # else: + # FinalURL = data['wpsite'].FinalURL + # + # data['url'] = 'https://%s' % (FinalURL) + # data['userName'] = 'autologin' + # data['password'] = message + # + # proc = httpProc(request, 'websiteFunctions/WPsiteHome.html', + # Data, 'createWebsite') + # return proc.render() + + + def ConfigurePlugins(self, request=None, userID=None, data=None): DataPass ={} @@ -344,6 +401,537 @@ class WebsiteManager: return proc.render() + def FetchWPdata(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) + path = wpsite.path + + Webobj= Websites.objects.get(pk=wpsite.owner_id) + + Vhuser = Webobj.externalApp + PHPVersion = Webobj.phpSelection + + + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp core version --skip-plugins --skip-themes --path=%s' % (Vhuser, FinalPHPPath, path) + version = ProcessUtilities.outputExecutioner(command) + + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin status litespeed-cache --skip-plugins --skip-themes --path=%s' % (Vhuser, FinalPHPPath, path) + lscachee = ProcessUtilities.outputExecutioner(command) + + if lscachee.find('Status: Active') > -1: + lscache = 1 + else: + lscache = 0 + + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config list --skip-plugins --skip-themes --path=%s' % (Vhuser, FinalPHPPath, path) + stdout = ProcessUtilities.outputExecutioner(command) + debugging = 0 + for items in stdout.split('\n'): + if items.find('WP_DEBUG true constant') > -1: + debugging = 1 + break + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp option get blog_public --skip-plugins --skip-themes --path=%s' %(Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + searchindex = int(stdoutput.splitlines()[-1]) + + + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp maintenance-mode status --skip-plugins --skip-themes --path=%s' %(Vhuser, FinalPHPPath, path) + maintenanceMod = ProcessUtilities.outputExecutioner(command) + + result = maintenanceMod.splitlines()[-1] + if result.find('not active') > -1: + maintenanceMode = 0 + else: + maintenanceMode = 1 + + fb ={ + 'version': version.rstrip('\n'), + 'lscache': lscache, + 'debugging': debugging, + 'searchIndex': searchindex, + 'maintenanceMode': maintenanceMode + + } + + data_ret = {'status': 1, 'error_message': 'None', 'ret_data':fb} + 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 GetCurrentPlugins(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) + path = wpsite.path + + Webobj= Websites.objects.get(pk=wpsite.owner_id) + + Vhuser = Webobj.externalApp + PHPVersion = Webobj.phpSelection + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin list --skip-plugins --skip-themes --format=json --path=%s' % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + json_data = stdoutput.splitlines()[-1] + + + + data_ret = {'status': 1, 'error_message': 'None', 'plugins': 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 GetCurrentThemes(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) + path = wpsite.path + + Webobj= Websites.objects.get(pk=wpsite.owner_id) + + Vhuser = Webobj.externalApp + PHPVersion = Webobj.phpSelection + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + + + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp theme list --skip-plugins --skip-themes --format=json --path=%s' % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + json_data = stdoutput.splitlines()[-1] + + + + data_ret = {'status': 1, 'error_message': 'None', 'themes': 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 UpdatePlugins(self, userID=None, data=None): + try: + + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + WPManagerID = data['WPid'] + plugin = data['plugin'] + pluginarray = data['pluginarray'] + wpsite = WPSites.objects.get(pk=WPManagerID) + path = wpsite.path + + Webobj= Websites.objects.get(pk=wpsite.owner_id) + + Vhuser = Webobj.externalApp + PHPVersion = Webobj.phpSelection + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + extraArgs = {} + extraArgs['adminID'] = admin.pk + extraArgs['plugin'] = plugin + extraArgs['pluginarray'] = pluginarray + extraArgs['FinalPHPPath'] = FinalPHPPath + extraArgs['path'] = path + extraArgs['Vhuser'] = Vhuser + + background = ApplicationInstaller('UpdateWPPlugin', extraArgs) + background.start() + + + time.sleep(2) + + + 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 UpdateThemes(self, userID=None, data=None): + try: + + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + + WPManagerID = data['WPid'] + Theme = data['Theme'] + Themearray = data['Themearray'] + wpsite = WPSites.objects.get(pk=WPManagerID) + path = wpsite.path + + Webobj= Websites.objects.get(pk=wpsite.owner_id) + + Vhuser = Webobj.externalApp + PHPVersion = Webobj.phpSelection + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + + + extraArgs = {} + extraArgs['adminID'] = admin.pk + extraArgs['Theme'] = Theme + extraArgs['Themearray'] = Themearray + extraArgs['FinalPHPPath'] = FinalPHPPath + extraArgs['path'] = path + extraArgs['Vhuser'] = Vhuser + + + + background = ApplicationInstaller('UpdateWPTheme', extraArgs) + background.start() + + time.sleep(2) + + + + + + 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 DeletePlugins(self, userID=None, data=None): + try: + + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + WPManagerID = data['WPid'] + plugin = data['plugin'] + pluginarray = data['pluginarray'] + wpsite = WPSites.objects.get(pk=WPManagerID) + path = wpsite.path + + Webobj= Websites.objects.get(pk=wpsite.owner_id) + + Vhuser = Webobj.externalApp + PHPVersion = Webobj.phpSelection + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + extraArgs = {} + extraArgs['adminID'] = admin.pk + extraArgs['plugin'] = plugin + extraArgs['pluginarray'] = pluginarray + extraArgs['FinalPHPPath'] = FinalPHPPath + extraArgs['path'] = path + extraArgs['Vhuser'] = Vhuser + + background = ApplicationInstaller('DeletePlugins', extraArgs) + background.start() + + + time.sleep(2) + + 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 DeleteThemes(self, userID=None, data=None): + try: + + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + WPManagerID = data['WPid'] + Theme = data['Theme'] + Themearray = data['Themearray'] + wpsite = WPSites.objects.get(pk=WPManagerID) + path = wpsite.path + + Webobj= Websites.objects.get(pk=wpsite.owner_id) + + Vhuser = Webobj.externalApp + PHPVersion = Webobj.phpSelection + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + + + extraArgs = {} + extraArgs['adminID'] = admin.pk + extraArgs['Theme'] = Theme + extraArgs['Themearray'] = Themearray + extraArgs['FinalPHPPath'] = FinalPHPPath + extraArgs['path'] = path + extraArgs['Vhuser'] = Vhuser + + + + background = ApplicationInstaller('DeleteThemes', extraArgs) + background.start() + + + 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 ChangeStatus(self, userID=None, data=None): + try: + + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + WPManagerID = data['WPid'] + plugin = data['plugin'] + wpsite = WPSites.objects.get(pk=WPManagerID) + path = wpsite.path + + Webobj= Websites.objects.get(pk=wpsite.owner_id) + + Vhuser = Webobj.externalApp + PHPVersion = Webobj.phpSelection + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin status %s --skip-plugins --skip-themes --path=%s' % (Vhuser, FinalPHPPath, plugin, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + if stdoutput.find('Status: Active') > -1: + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin deactivate %s --skip-plugins --skip-themes --path=%s' % (Vhuser, FinalPHPPath, plugin, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + time.sleep(3) + + else: + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin activate %s --skip-plugins --skip-themes --path=%s' % (Vhuser, FinalPHPPath, plugin, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + time.sleep(3) + + + + 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 ChangeStatusThemes(self, userID=None, data=None): + try: + # logging.CyberCPLogFileWriter.writeToFile("Error WP ChangeStatusThemes ....... %s") + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + WPManagerID = data['WPid'] + Theme = data['theme'] + wpsite = WPSites.objects.get(pk=WPManagerID) + path = wpsite.path + + Webobj= Websites.objects.get(pk=wpsite.owner_id) + + Vhuser = Webobj.externalApp + PHPVersion = Webobj.phpSelection + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + + + extraArgs = {} + extraArgs['adminID'] = admin.pk + extraArgs['Theme'] = Theme + extraArgs['FinalPHPPath'] = FinalPHPPath + extraArgs['path'] = path + extraArgs['Vhuser'] = Vhuser + + + + background = ApplicationInstaller('ChangeStatusThemes', extraArgs) + background.start() + + + + + 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 UpdateWPSettings(self, userID=None, data=None): + try: + + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + WPManagerID = data['WPid'] + setting = data['setting'] + settingValue = data['settingValue'] + wpsite = WPSites.objects.get(pk=WPManagerID) + path = wpsite.path + + Webobj= Websites.objects.get(pk=wpsite.owner_id) + + Vhuser = Webobj.externalApp + PHPVersion = Webobj.phpSelection + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) + + + + if setting == 'lscache': + if settingValue: + + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin install litespeed-cache --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin activate litespeed-cache --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + + else: + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp plugin deactivate litespeed-cache --path=%s --skip-plugins --skip-themes' % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + elif setting == 'debugging': + + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp litespeed-purge all --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + if settingValue: + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp config set WP_DEBUG true --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + logging.CyberCPLogFileWriter.writeToFile("Debugging mk true 1 output:" + str(stdoutput)) + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config list --skip-plugins --skip-themes --path=%s' % ( + Vhuser, FinalPHPPath, path) + stdout = ProcessUtilities.outputExecutioner(command) + logging.CyberCPLogFileWriter.writeToFile("Debugging output:" + str(stdout)) + + + else: + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp config set WP_DEBUG false --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + logging.CyberCPLogFileWriter.writeToFile("Debugging mk false 0 output:" + str(stdoutput)) + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config list --skip-plugins --skip-themes --path=%s' % ( + Vhuser, FinalPHPPath, path) + stdout = ProcessUtilities.outputExecutioner(command) + logging.CyberCPLogFileWriter.writeToFile("Debugging output:" + str(stdout)) + + elif setting == 'searchIndex': + + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp litespeed-purge all --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + if settingValue: + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp option update blog_public 1 --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + + else: + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp option update blog_public 0 --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + elif setting == 'maintenanceMode': + + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp litespeed-purge all --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + if settingValue: + + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp maintenance-mode activate --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + + else: + command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp maintenance-mode deactivate --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path) + stdoutput = ProcessUtilities.outputExecutioner(command) + + 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 submitWorpressCreation(self, userID=None, data=None): try: currentACL = ACLManager.loadedACL(userID)