diff --git a/baseTemplate/static/baseTemplate/newBase.js b/baseTemplate/static/baseTemplate/newBase.js new file mode 100644 index 000000000..64aff3a2e --- /dev/null +++ b/baseTemplate/static/baseTemplate/newBase.js @@ -0,0 +1,155 @@ +let icon1 = document.getElementById("icon1"); +let menu1 = document.getElementById("menu1"); +const showMenu1 = (flag) => { + if (flag) { + icon1.classList.toggle("rotate-180"); + menu1.classList.toggle("hidden"); + } +}; +let icon2 = document.getElementById("icon2"); +let menu2 = document.getElementById("menu2"); + +const showMenu2 = (flag) => { + if (flag) { + icon2.classList.toggle("rotate-180"); + menu2.classList.toggle("hidden"); + } +}; +let icon3 = document.getElementById("icon3"); +let menu3 = document.getElementById("menu3"); + +const showMenu3 = (flag) => { + if (flag) { + icon3.classList.toggle("rotate-180"); + menu3.classList.toggle("hidden"); + } +}; + +function getCookie(name) { + var cookieValue = null; + if (document.cookie && document.cookie !== '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = jQuery.trim(cookies[i]); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) === (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; +} + +var newapp =angular.module('cybercpV2',[]); + +newapp.config(['$interpolateProvider', function ($interpolateProvider) { + $interpolateProvider.startSymbol('{$'); + $interpolateProvider.endSymbol('$}'); +}]); +newapp.controller('dashboardV2', function ($scope, $http, $timeout) { +alert('dashboardV2'); + function getStuff() { + + + url = "/base/getSystemStatus"; + + $http.get(url).then(ListInitialData, cantLoadInitialData); + + + function ListInitialData(response) { + + console.log(response.data); + + $("#redcircle").removeClass(); + $("#greencircle").removeClass(); + $("#pinkcircle").removeClass(); + + + $scope.cpuUsage = response.data.cpuUsage; + $scope.ramUsage = response.data.ramUsage; + $scope.diskUsage = response.data.diskUsage; + + $scope.RequestProcessing = response.data.RequestProcessing; + $scope.TotalRequests = response.data.TotalRequests; + + $scope.MAXCONN = response.data.MAXCONN; + $scope.MAXSSL = response.data.MAXSSL; + $scope.Avail = response.data.Avail; + $scope.AvailSSL = response.data.AvailSSL; + + + $("#redcircle").addClass("c100"); + $("#redcircle").addClass("p" + $scope.cpuUsage); + $("#redcircle").addClass("red"); + + $("#greencircle").addClass("c100"); + $("#greencircle").addClass("p" + $scope.ramUsage); + $("#greencircle").addClass("green"); + + + $("#pinkcircle").addClass("c100"); + $("#pinkcircle").addClass("p" + $scope.diskUsage); + $("#pinkcircle").addClass("red"); + + + // home page cpu,ram and disk update. + var rotationMultiplier = 3.6; + // For each div that its id ends with "circle", do the following. + $("div[id$='circle']").each(function () { + // Save all of its classes in an array. + var classList = $(this).attr('class').split(/\s+/); + // Iterate over the array + for (var i = 0; i < classList.length; i++) { + /* If there's about a percentage class, take the actual percentage and apply the + css transformations in all occurences of the specified percentage class, + even for the divs without an id ending with "circle" */ + if (classList[i].match("^p" + $scope.cpuUsage)) { + var rotationPercentage = $scope.cpuUsage; + var rotationDegrees = rotationMultiplier * rotationPercentage; + $('.c100.p' + rotationPercentage + ' .bar').css({ + '-webkit-transform': 'rotate(' + rotationDegrees + 'deg)', + '-moz-transform': 'rotate(' + rotationDegrees + 'deg)', + '-ms-transform': 'rotate(' + rotationDegrees + 'deg)', + '-o-transform': 'rotate(' + rotationDegrees + 'deg)', + 'transform': 'rotate(' + rotationDegrees + 'deg)' + }); + } else if (classList[i].match("^p" + $scope.ramUsage)) { + var rotationPercentage = response.data.ramUsage; + ; + var rotationDegrees = rotationMultiplier * rotationPercentage; + $('.c100.p' + rotationPercentage + ' .bar').css({ + '-webkit-transform': 'rotate(' + rotationDegrees + 'deg)', + '-moz-transform': 'rotate(' + rotationDegrees + 'deg)', + '-ms-transform': 'rotate(' + rotationDegrees + 'deg)', + '-o-transform': 'rotate(' + rotationDegrees + 'deg)', + 'transform': 'rotate(' + rotationDegrees + 'deg)' + }); + } else if (classList[i].match("^p" + $scope.diskUsage)) { + var rotationPercentage = response.data.diskUsage; + ; + var rotationDegrees = rotationMultiplier * rotationPercentage; + $('.c100.p' + rotationPercentage + ' .bar').css({ + '-webkit-transform': 'rotate(' + rotationDegrees + 'deg)', + '-moz-transform': 'rotate(' + rotationDegrees + 'deg)', + '-ms-transform': 'rotate(' + rotationDegrees + 'deg)', + '-o-transform': 'rotate(' + rotationDegrees + 'deg)', + 'transform': 'rotate(' + rotationDegrees + 'deg)' + }); + } + } + }); + + + } + + function cantLoadInitialData(response) { + console.log("not good"); + } + + $timeout(getStuff, 2000); + + } + getStuff(); +}); + diff --git a/baseTemplate/static/baseTemplate/newImage/community.png b/baseTemplate/static/baseTemplate/newImage/community.png new file mode 100644 index 000000000..95d2a7b6e Binary files /dev/null and b/baseTemplate/static/baseTemplate/newImage/community.png differ diff --git a/baseTemplate/static/baseTemplate/newImage/cyberlogo.png b/baseTemplate/static/baseTemplate/newImage/cyberlogo.png new file mode 100644 index 000000000..492c8a0d4 Binary files /dev/null and b/baseTemplate/static/baseTemplate/newImage/cyberlogo.png differ diff --git a/baseTemplate/static/baseTemplate/newImage/logout.png b/baseTemplate/static/baseTemplate/newImage/logout.png new file mode 100644 index 000000000..320415aae Binary files /dev/null and b/baseTemplate/static/baseTemplate/newImage/logout.png differ diff --git a/baseTemplate/static/baseTemplate/newImage/support.png b/baseTemplate/static/baseTemplate/newImage/support.png new file mode 100644 index 000000000..bc321d78c Binary files /dev/null and b/baseTemplate/static/baseTemplate/newImage/support.png differ diff --git a/baseTemplate/static/baseTemplate/newImage/youtube.png b/baseTemplate/static/baseTemplate/newImage/youtube.png new file mode 100644 index 000000000..8d1de3516 Binary files /dev/null and b/baseTemplate/static/baseTemplate/newImage/youtube.png differ diff --git a/baseTemplate/templates/baseTemplate/example.html b/baseTemplate/templates/baseTemplate/example.html new file mode 100644 index 000000000..eeecf00ac --- /dev/null +++ b/baseTemplate/templates/baseTemplate/example.html @@ -0,0 +1,649 @@ +{% extends "baseTemplate/newBase.html" %} +{% load i18n %} +{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %} +{% block newContent %} + +
+ +
+
+ + + +
+ + +
+ + +
+ +
+ +
+
+
+

Users

+
+
+ + + +
+
+
+
    +
  • +
    +
    + + + + +
    +
    +

    View Profile

    +
    +
    +
  • +
  • +
    +
    + + + + +
    +
    +

    List Users

    +
    +
    +
  • +
  • +
    +
    + + + + + + +
    +
    +

    Create Users

    +
    +
    +
  • +
  • +
    +
    + + + + + + +
    +
    +

    Modify Users

    +
    +
    +
  • +
  • +
    +
    + + + + + + + + + + +
    +
    +

    Delete Users

    +
    +
    +
  • +
+
+
+ +
+ +
+
+
+

Websites

+
+
+ + + +
+
+
+ +
+
+ +
+ +
+
+
+

Packages

+
+
+ + + +
+
+
+
    +
  • +
    +
    + + + +
    +
    +

    Create Package

    +
    +
    +
  • +
  • +
    +
    + + + + +
    +
    +

    List Package

    +
    +
    +
  • +
  • +
    +
    + + + + + + +
    +
    +

    Modify Package

    +
    +
    +
  • +
  • +
    +
    + + + + + + + + + + + + +
    +
    +

    Delete Package

    +
    +
    +
  • +
+
+
+ +
+ +
+
+
+

Database

+
+
+ + + +
+
+
+
    +
  • +
    +
    + + + + + +
    +
    +

    Create Database

    +
    +
    +
  • +
  • +
    +
    + + + + +
    +
    +

    List Database

    +
    +
    +
  • +
  • +
    +
    + + + + + + + + + + + + +
    +
    +

    Delete Database

    +
    +
    +
  • +
  • +
    +
    + + + + +
    +
    +

    PHPMYADMIN

    +
    +
    +
  • +
+
+
+ +
+ +
+
+
+

DNS

+
+
+ + + +
+
+
+
    +
  • +
    +
    + + + + +
    +
    +

    Create NameServer

    +
    +
    +
  • +
  • +
    +
    + + + + +
    +
    +

    Create DNS Zone

    +
    +
    +
  • +
  • +
    +
    + + + + + + + + + + + +
    +
    +

    Delete Zone

    +
    +
    +
  • +
  • +
    +
    + + + +
    +
    +

    Add/Delete Record

    +
    +
    +
  • +
+
+
+ +
+ + + +
+
+ +
+
+

General Information

+
+
+

Current User

+

Cpd

+
+
+
+

Primary Domain

+

Cyberpanel.com

+
+
+
+

Home Directory

+

/home/cpd

+
+
+
+

Last Login

+

65.108.159.129

+
+
+
+
+ + + + {#
#} + {#
#} + {#

Resources

#} + {#
#} + {#
#} + {#

CPU Usage

#} + {#
#} + {#
#} + {#

RAM Usage

#} + {#
#} + {#
#} + {#

DISK Usage

#} + {#
#} + {# #} + {#
#} + +
    +
  • + +
    + {% trans "CPU Usage" %} + {$ cpuUsage $}% +
    +
    +
    +
    +
    +
  • +
  • + {$ ramUsage $}% +
    + {% trans "RAM Usage" %} +
    +
    +
    +
    +
  • +
  • +
    + {% trans "Disk Usage" %} + {$ diskUsage $}% +
    +
    +
    +
    {$ diskUsage $}%
    +
    +
    +
  • +
+ +
+
+ +
+
+{% endblock %} \ No newline at end of file diff --git a/baseTemplate/templates/baseTemplate/index.html b/baseTemplate/templates/baseTemplate/index.html index bf51910ee..f09190c14 100755 --- a/baseTemplate/templates/baseTemplate/index.html +++ b/baseTemplate/templates/baseTemplate/index.html @@ -301,7 +301,10 @@
+{% endblock %} diff --git a/websiteFunctions/templates/websiteFunctions/listWebsiteV2.html b/websiteFunctions/templates/websiteFunctions/listWebsiteV2.html new file mode 100644 index 000000000..313d31f6d --- /dev/null +++ b/websiteFunctions/templates/websiteFunctions/listWebsiteV2.html @@ -0,0 +1,104 @@ +{% extends "baseTemplate/newBase.html" %} +{% load i18n %} +{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %} +{% block newContent %} + + {% load static %} + +
+
+
+

List Website

+

On this page you can launch,list,modify and + delete websites + from your server

+
+
+ +
+
+ +
+
+
+
+ + + +
+ +
+
+ +
+ +
+
+ +
+
+
+
+
+
Owner
+
IP Address
+
Disk Usage
+
Package
+
SSL
+
State
+
+
+
+
+

+
+
+ +
+
+
+
+
+
+
+{% endblock %} diff --git a/websiteFunctions/templates/websiteFunctions/listWebsites.html b/websiteFunctions/templates/websiteFunctions/listWebsites.html index d7ec49e5e..39c8f15d3 100755 --- a/websiteFunctions/templates/websiteFunctions/listWebsites.html +++ b/websiteFunctions/templates/websiteFunctions/listWebsites.html @@ -127,6 +127,9 @@

+ + +
diff --git a/websiteFunctions/urls.py b/websiteFunctions/urls.py index 442309232..412eb7b50 100755 --- a/websiteFunctions/urls.py +++ b/websiteFunctions/urls.py @@ -6,13 +6,16 @@ url(r'^createWebsite$', views.createWebsite, name='createWebsite'), url(r'^listWebsites$', views.listWebsites, name='listWebsites'), url(r'^listChildDomains$', views.listChildDomains, name='listChildDomains'), + url(r'^listChildDomainsV2$', views.listChildDomainsV2, name='listChildDomainsV2'), url(r'^modifyWebsite$', views.modifyWebsite, name='modifyWebsite'), url(r'^deleteWebsite$', views.deleteWebsite, name='deleteWebsite'), url(r'^siteState$', views.siteState, name='siteState'), + url(r'^createWebsiteV2$', views.createWebsiteV2, name='createWebsiteV2'), + url(r'^listWebsitesV2$', views.listWebsitesV2, name='listWebsitesV2'), - ## url(r'^CreateNewDomain$', views.CreateNewDomain, name='CreateNewDomain'), + url(r'^CreateNewDomainV2$', views.CreateNewDomainV2, name='CreateNewDomainV2'), ### WordPress url(r'^createWordpress$', views.WPCreate, name='createWordpress'), diff --git a/websiteFunctions/views.py b/websiteFunctions/views.py index 2b66c47e5..ef7b0e727 100755 --- a/websiteFunctions/views.py +++ b/websiteFunctions/views.py @@ -1,19 +1,19 @@ # -*- coding: utf-8 -*- -from django.shortcuts import redirect +import json from django.http import HttpResponse +from django.shortcuts import redirect +from django.views.decorators.csrf import csrf_exempt + +import plogical.CyberCPLogFileWriter as logging from loginSystem.models import Administrator from loginSystem.views import loadLoginPage -import json -import plogical.CyberCPLogFileWriter as logging - - from plogical.httpProc import httpProc from websiteFunctions.models import wpplugins -from websiteFunctions.website import WebsiteManager from websiteFunctions.pluginManager import pluginManager -from django.views.decorators.csrf import csrf_exempt +from websiteFunctions.website import WebsiteManager + def loadWebsitesHome(request): val = request.session['userID'] @@ -22,6 +22,7 @@ def loadWebsitesHome(request): {"type": admin.type}) return proc.render() + def createWebsite(request): try: userID = request.session['userID'] @@ -29,14 +30,26 @@ def createWebsite(request): return wm.createWebsite(request, userID) except KeyError: return redirect(loadLoginPage) + + +def createWebsiteV2(request): + try: + userID = request.session['userID'] + wm = WebsiteManager() + return wm.createWebsiteV2(request, userID) + except KeyError: + return redirect(loadLoginPage) + + def WPCreate(request): try: userID = request.session['userID'] wm = WebsiteManager() - return wm.WPCreate(request, userID,) + return wm.WPCreate(request, userID, ) except KeyError: return redirect(loadLoginPage) + def ListWPSites(request): try: userID = request.session['userID'] @@ -46,6 +59,7 @@ def ListWPSites(request): except KeyError: return redirect(loadLoginPage) + def WPHome(request): try: userID = request.session['userID'] @@ -56,6 +70,8 @@ def WPHome(request): return wm.WPHome(request, userID, WPid, DeleteID) except KeyError: return redirect(loadLoginPage) + + def RestoreHome(request): try: userID = request.session['userID'] @@ -77,6 +93,7 @@ def RemoteBackupConfig(request): except KeyError: return redirect(loadLoginPage) + def BackupfileConfig(request): try: userID = request.session['userID'] @@ -88,6 +105,7 @@ def BackupfileConfig(request): except KeyError: return redirect(loadLoginPage) + def AddRemoteBackupsite(request): try: userID = request.session['userID'] @@ -95,18 +113,20 @@ def AddRemoteBackupsite(request): ID = request.GET.get('ID') DeleteSiteID = request.GET.get('DeleteID') wm = WebsiteManager() - return wm.AddRemoteBackupsite(request, userID, ID,DeleteSiteID ) + return wm.AddRemoteBackupsite(request, userID, ID, DeleteSiteID) except KeyError: return redirect(loadLoginPage) + def WordpressPricing(request): try: userID = request.session['userID'] wm = WebsiteManager() - return wm.WordpressPricing(request, userID,) + return wm.WordpressPricing(request, userID, ) except KeyError: return redirect(loadLoginPage) + def RestoreBackups(request): try: userID = request.session['userID'] @@ -117,6 +137,7 @@ def RestoreBackups(request): except KeyError: return redirect(loadLoginPage) + def AutoLogin(request): try: userID = request.session['userID'] @@ -125,6 +146,8 @@ def AutoLogin(request): except KeyError: return redirect(loadLoginPage) + + def ConfigurePlugins(request): try: userID = request.session['userID'] @@ -136,13 +159,14 @@ def ConfigurePlugins(request): jobobj.delete() Deleted = 1 except BaseException as msg: - logging.CyberCPLogFileWriter.writeToFile("DeleteFileID ....... %s....msg.....%s" % (DeleteFileID,msg)) + logging.CyberCPLogFileWriter.writeToFile("DeleteFileID ....... %s....msg.....%s" % (DeleteFileID, msg)) Deleted = 0 wm = WebsiteManager() return wm.ConfigurePlugins(request, userID) except KeyError: return redirect(loadLoginPage) + def Addnewplugin(request): try: userID = request.session['userID'] @@ -152,15 +176,13 @@ def Addnewplugin(request): return redirect(loadLoginPage) - - def SearchOnkeyupPlugin(request): try: userID = request.session['userID'] result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -182,7 +204,7 @@ def AddNewpluginAjax(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -215,7 +237,7 @@ def deletesPlgin(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -237,7 +259,7 @@ def Addplugineidt(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -259,7 +281,7 @@ def submitWorpressCreation(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -281,7 +303,7 @@ def FetchWPdata(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -303,7 +325,7 @@ def GetCurrentPlugins(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -326,7 +348,7 @@ def fetchstaging(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -341,13 +363,14 @@ def fetchstaging(request): except KeyError: return redirect(loadLoginPage) + def fetchDatabase(request): try: userID = request.session['userID'] result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -362,6 +385,7 @@ def fetchDatabase(request): except KeyError: return redirect(loadLoginPage) + def SaveUpdateConfig(request): try: userID = request.session['userID'] @@ -383,27 +407,29 @@ def SaveUpdateConfig(request): except KeyError: return redirect(loadLoginPage) + def DeploytoProduction(request): try: userID = request.session['userID'] - #result = pluginManager.preWebsiteCreation(request) + # result = pluginManager.preWebsiteCreation(request) - #if result != 200: + # if result != 200: # return result wm = WebsiteManager() return wm.DeploytoProduction(userID, json.loads(request.body)) - #result = pluginManager.postWebsiteCreation(request, coreResult) - #if result != 200: + # result = pluginManager.postWebsiteCreation(request, coreResult) + # if result != 200: # return result - #return coreResult + # return coreResult except KeyError: return redirect(loadLoginPage) + def WPCreateBackup(request): try: userID = request.session['userID'] @@ -426,7 +452,6 @@ def WPCreateBackup(request): return redirect(loadLoginPage) - def RestoreWPbackupNow(request): try: userID = request.session['userID'] @@ -469,6 +494,7 @@ def SaveBackupConfig(request): except KeyError: return redirect(loadLoginPage) + def SaveBackupSchedule(request): try: userID = request.session['userID'] @@ -489,6 +515,7 @@ def SaveBackupSchedule(request): except KeyError: return redirect(loadLoginPage) + def AddWPsiteforRemoteBackup(request): try: userID = request.session['userID'] @@ -596,14 +623,13 @@ def dataintegrity(request): return redirect(loadLoginPage) - def GetCurrentThemes(request): try: userID = request.session['userID'] result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -625,7 +651,7 @@ def UpdateWPSettings(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -647,7 +673,7 @@ def UpdatePlugins(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -669,7 +695,7 @@ def UpdateThemes(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -691,7 +717,7 @@ def DeletePlugins(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -713,7 +739,7 @@ def DeleteThemes(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -735,7 +761,7 @@ def ChangeStatus(request): result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -795,7 +821,6 @@ def CreateStagingNow(request): return redirect(loadLoginPage) - def modifyWebsite(request): try: userID = request.session['userID'] @@ -807,6 +832,7 @@ def modifyWebsite(request): except KeyError: return redirect(loadLoginPage) + def deleteWebsite(request): try: userID = request.session['userID'] @@ -815,6 +841,7 @@ def deleteWebsite(request): except KeyError: return redirect(loadLoginPage) + def CreateNewDomain(request): try: userID = request.session['userID'] @@ -823,6 +850,14 @@ def CreateNewDomain(request): except KeyError: return redirect(loadLoginPage) +def CreateNewDomainV2(request): + try: + userID = request.session['userID'] + wm = WebsiteManager() + return wm.CreateNewDomainV2(request, userID) + except KeyError: + return redirect(loadLoginPage) + def siteState(request): try: userID = request.session['userID'] @@ -831,6 +866,7 @@ def siteState(request): except KeyError: return redirect(loadLoginPage) + def listWebsites(request): try: userID = request.session['userID'] @@ -839,6 +875,16 @@ def listWebsites(request): except KeyError: return redirect(loadLoginPage) + +def listWebsitesV2(request): + try: + userID = request.session['userID'] + wm = WebsiteManager() + return wm.listWebsitesV2(request, userID) + except KeyError: + return redirect(loadLoginPage) + + def listChildDomains(request): try: userID = request.session['userID'] @@ -847,13 +893,22 @@ def listChildDomains(request): except KeyError: return redirect(loadLoginPage) +def listChildDomainsV2(request): + try: + userID = request.session['userID'] + wm = WebsiteManager() + return wm.listChildDomainsV2(request, userID) + except KeyError: + return redirect(loadLoginPage) + + def submitWebsiteCreation(request): try: userID = request.session['userID'] result = pluginManager.preWebsiteCreation(request) - if result != 200: + if result != 200: return result wm = WebsiteManager() @@ -868,6 +923,7 @@ def submitWebsiteCreation(request): except KeyError: return redirect(loadLoginPage) + def submitDomainCreation(request): try: userID = request.session['userID'] @@ -887,6 +943,7 @@ def submitDomainCreation(request): except KeyError: return redirect(loadLoginPage) + def fetchDomains(request): try: userID = request.session['userID'] @@ -895,6 +952,7 @@ def fetchDomains(request): except KeyError: return redirect(loadLoginPage) + def searchWebsites(request): try: userID = request.session['userID'] @@ -903,6 +961,7 @@ def searchWebsites(request): except KeyError: return redirect(loadLoginPage) + def searchChilds(request): try: userID = request.session['userID'] @@ -911,6 +970,7 @@ def searchChilds(request): except KeyError: return redirect(loadLoginPage) + def getFurtherAccounts(request): try: userID = request.session['userID'] @@ -919,6 +979,7 @@ def getFurtherAccounts(request): except KeyError: return redirect(loadLoginPage) + def fetchWebsitesList(request): try: userID = request.session['userID'] @@ -927,6 +988,7 @@ def fetchWebsitesList(request): except KeyError: return redirect(loadLoginPage) + def fetchChildDomainsMain(request): try: userID = request.session['userID'] @@ -935,6 +997,7 @@ def fetchChildDomainsMain(request): except KeyError: return redirect(loadLoginPage) + def submitWebsiteDeletion(request): try: userID = request.session['userID'] @@ -954,6 +1017,7 @@ def submitWebsiteDeletion(request): except KeyError: return redirect(loadLoginPage) + def submitDomainDeletion(request): try: @@ -975,6 +1039,7 @@ def submitDomainDeletion(request): except KeyError: return redirect(loadLoginPage) + def convertDomainToSite(request): try: @@ -985,6 +1050,7 @@ def convertDomainToSite(request): except KeyError: return redirect(loadLoginPage) + def submitWebsiteStatus(request): try: @@ -1006,6 +1072,7 @@ def submitWebsiteStatus(request): except KeyError: return redirect(loadLoginPage) + def submitWebsiteModify(request): try: @@ -1016,6 +1083,7 @@ def submitWebsiteModify(request): except KeyError: return redirect(loadLoginPage) + def saveWebsiteChanges(request): try: @@ -1037,6 +1105,7 @@ def saveWebsiteChanges(request): except KeyError: return redirect(loadLoginPage) + def domain(request, domain): try: @@ -1061,6 +1130,7 @@ def domain(request, domain): except KeyError: return redirect(loadLoginPage) + def launchChild(request, domain, childDomain): try: userID = request.session['userID'] @@ -1069,6 +1139,7 @@ def launchChild(request, domain, childDomain): except KeyError: return redirect(loadLoginPage) + def getDataFromLogFile(request): try: userID = request.session['userID'] @@ -1077,6 +1148,7 @@ def getDataFromLogFile(request): except KeyError: return redirect(loadLoginPage) + def fetchErrorLogs(request): try: userID = request.session['userID'] @@ -1085,6 +1157,7 @@ def fetchErrorLogs(request): except KeyError: return redirect(loadLoginPage) + def getDataFromConfigFile(request): try: userID = request.session['userID'] @@ -1093,6 +1166,7 @@ def getDataFromConfigFile(request): except KeyError: return redirect(loadLoginPage) + def saveConfigsToFile(request): try: @@ -1114,6 +1188,7 @@ def saveConfigsToFile(request): except KeyError: return redirect(loadLoginPage) + def getRewriteRules(request): try: userID = request.session['userID'] @@ -1122,6 +1197,7 @@ def getRewriteRules(request): except KeyError: return redirect(loadLoginPage) + def saveRewriteRules(request): try: @@ -1143,6 +1219,7 @@ def saveRewriteRules(request): except KeyError: return redirect(loadLoginPage) + def saveSSL(request): try: @@ -1164,6 +1241,7 @@ def saveSSL(request): except KeyError: return redirect(loadLoginPage) + def changePHP(request): try: @@ -1185,6 +1263,7 @@ def changePHP(request): except KeyError: return redirect(loadLoginPage) + def listCron(request): try: userID = request.session['userID'] @@ -1193,6 +1272,7 @@ def listCron(request): except KeyError: return redirect(loadLoginPage) + def getWebsiteCron(request): try: userID = request.session['userID'] @@ -1201,6 +1281,7 @@ def getWebsiteCron(request): except KeyError: return redirect(loadLoginPage) + def getCronbyLine(request): try: userID = request.session['userID'] @@ -1209,6 +1290,7 @@ def getCronbyLine(request): except KeyError: return redirect(loadLoginPage) + def saveCronChanges(request): try: userID = request.session['userID'] @@ -1217,6 +1299,7 @@ def saveCronChanges(request): except KeyError: return redirect(loadLoginPage) + def remCronbyLine(request): try: userID = request.session['userID'] @@ -1236,6 +1319,7 @@ def remCronbyLine(request): except KeyError: return redirect(loadLoginPage) + def addNewCron(request): try: userID = request.session['userID'] @@ -1255,6 +1339,7 @@ def addNewCron(request): except KeyError: return redirect(loadLoginPage) + def domainAlias(request, domain): try: userID = request.session['userID'] @@ -1263,6 +1348,7 @@ def domainAlias(request, domain): except KeyError: return redirect(loadLoginPage) + def submitAliasCreation(request): try: userID = request.session['userID'] @@ -1282,6 +1368,7 @@ def submitAliasCreation(request): except KeyError: return redirect(loadLoginPage) + def issueAliasSSL(request): try: userID = request.session['userID'] @@ -1290,6 +1377,7 @@ def issueAliasSSL(request): except KeyError: return redirect(loadLoginPage) + def delateAlias(request): try: userID = request.session['userID'] @@ -1309,6 +1397,7 @@ def delateAlias(request): except KeyError: return redirect(loadLoginPage) + def changeOpenBasedir(request): try: @@ -1330,6 +1419,7 @@ def changeOpenBasedir(request): except KeyError: return redirect(loadLoginPage) + def wordpressInstall(request, domain): try: userID = request.session['userID'] @@ -1338,6 +1428,7 @@ def wordpressInstall(request, domain): except KeyError: return redirect(loadLoginPage) + def installWordpress(request): try: userID = request.session['userID'] @@ -1346,6 +1437,7 @@ def installWordpress(request): except KeyError: return redirect(loadLoginPage) + def installWordpressStatus(request): try: userID = request.session['userID'] @@ -1354,6 +1446,7 @@ def installWordpressStatus(request): except KeyError: return redirect(loadLoginPage) + def joomlaInstall(request, domain): try: userID = request.session['userID'] @@ -1362,6 +1455,7 @@ def joomlaInstall(request, domain): except KeyError: return redirect(loadLoginPage) + def installJoomla(request): try: userID = request.session['userID'] @@ -1370,6 +1464,7 @@ def installJoomla(request): except KeyError: return redirect(loadLoginPage) + def setupGit(request, domain): try: userID = request.session['userID'] @@ -1378,6 +1473,7 @@ def setupGit(request, domain): except KeyError: return redirect(loadLoginPage) + def setupGitRepo(request): try: userID = request.session['userID'] @@ -1386,6 +1482,7 @@ def setupGitRepo(request): except KeyError: return redirect(loadLoginPage) + @csrf_exempt def gitNotify(request, domain): try: @@ -1394,6 +1491,7 @@ def gitNotify(request, domain): except KeyError: return redirect(loadLoginPage) + def detachRepo(request): try: userID = request.session['userID'] @@ -1402,6 +1500,7 @@ def detachRepo(request): except KeyError: return redirect(loadLoginPage) + def changeBranch(request): try: userID = request.session['userID'] @@ -1410,6 +1509,7 @@ def changeBranch(request): except KeyError: return redirect(loadLoginPage) + def installPrestaShop(request, domain): try: userID = request.session['userID'] @@ -1418,6 +1518,7 @@ def installPrestaShop(request, domain): except KeyError: return redirect(loadLoginPage) + def installMagento(request, domain): try: userID = request.session['userID'] @@ -1426,6 +1527,7 @@ def installMagento(request, domain): except KeyError: return redirect(loadLoginPage) + def magentoInstall(request): try: userID = request.session['userID'] @@ -1434,6 +1536,7 @@ def magentoInstall(request): except KeyError: return redirect(loadLoginPage) + def installMautic(request, domain): try: userID = request.session['userID'] @@ -1442,6 +1545,7 @@ def installMautic(request, domain): except KeyError: return redirect(loadLoginPage) + def mauticInstall(request): try: userID = request.session['userID'] @@ -1450,6 +1554,7 @@ def mauticInstall(request): except KeyError: return redirect(loadLoginPage) + def prestaShopInstall(request): try: userID = request.session['userID'] @@ -1458,6 +1563,7 @@ def prestaShopInstall(request): except KeyError: return redirect(loadLoginPage) + def sshAccess(request, domain): try: userID = request.session['userID'] @@ -1502,6 +1608,7 @@ def syncToMaster(request, domain, childDomain): except KeyError: return redirect(loadLoginPage) + def startSync(request): try: userID = request.session['userID'] @@ -1528,6 +1635,7 @@ def manageGIT(request, domain): except KeyError: return redirect(loadLoginPage) + def fetchFolderDetails(request): try: userID = request.session['userID'] @@ -1536,6 +1644,7 @@ def fetchFolderDetails(request): except KeyError: return redirect(loadLoginPage) + def initRepo(request): try: userID = request.session['userID'] @@ -1544,6 +1653,7 @@ def initRepo(request): except KeyError: return redirect(loadLoginPage) + def setupRemote(request): try: userID = request.session['userID'] @@ -1552,6 +1662,7 @@ def setupRemote(request): except KeyError: return redirect(loadLoginPage) + def changeGitBranch(request): try: userID = request.session['userID'] @@ -1560,6 +1671,7 @@ def changeGitBranch(request): except KeyError: return redirect(loadLoginPage) + def createNewBranch(request): try: userID = request.session['userID'] @@ -1568,6 +1680,7 @@ def createNewBranch(request): except KeyError: return redirect(loadLoginPage) + def commitChanges(request): try: userID = request.session['userID'] @@ -1576,6 +1689,7 @@ def commitChanges(request): except KeyError: return redirect(loadLoginPage) + def gitPull(request): try: userID = request.session['userID'] @@ -1584,6 +1698,7 @@ def gitPull(request): except KeyError: return redirect(loadLoginPage) + def gitPush(request): try: userID = request.session['userID'] @@ -1592,6 +1707,7 @@ def gitPush(request): except KeyError: return redirect(loadLoginPage) + def attachRepoGIT(request): try: userID = request.session['userID'] @@ -1600,6 +1716,7 @@ def attachRepoGIT(request): except KeyError: return redirect(loadLoginPage) + def removeTracking(request): try: userID = request.session['userID'] @@ -1608,6 +1725,7 @@ def removeTracking(request): except KeyError: return redirect(loadLoginPage) + def fetchGitignore(request): try: userID = request.session['userID'] @@ -1616,6 +1734,7 @@ def fetchGitignore(request): except KeyError: return redirect(loadLoginPage) + def saveGitIgnore(request): try: userID = request.session['userID'] @@ -1624,6 +1743,7 @@ def saveGitIgnore(request): except KeyError: return redirect(loadLoginPage) + def fetchCommits(request): try: userID = request.session['userID'] @@ -1632,6 +1752,7 @@ def fetchCommits(request): except KeyError: return redirect(loadLoginPage) + def fetchFiles(request): try: userID = request.session['userID'] @@ -1640,6 +1761,7 @@ def fetchFiles(request): except KeyError: return redirect(loadLoginPage) + def fetchChangesInFile(request): try: userID = request.session['userID'] @@ -1648,6 +1770,7 @@ def fetchChangesInFile(request): except KeyError: return redirect(loadLoginPage) + def saveGitConfigurations(request): try: userID = request.session['userID'] @@ -1656,6 +1779,7 @@ def saveGitConfigurations(request): except KeyError: return redirect(loadLoginPage) + def fetchGitLogs(request): try: userID = request.session['userID'] @@ -1664,6 +1788,7 @@ def fetchGitLogs(request): except KeyError: return redirect(loadLoginPage) + def getSSHConfigs(request): try: userID = request.session['userID'] @@ -1672,6 +1797,7 @@ def getSSHConfigs(request): except KeyError: return redirect(loadLoginPage) + def deleteSSHKey(request): try: userID = request.session['userID'] @@ -1680,6 +1806,7 @@ def deleteSSHKey(request): except KeyError: return redirect(loadLoginPage) + def addSSHKey(request): try: userID = request.session['userID'] @@ -1688,6 +1815,7 @@ def addSSHKey(request): except KeyError: return redirect(loadLoginPage) + @csrf_exempt def webhook(request, domain): try: @@ -1714,6 +1842,7 @@ def getSwitchStatus(request): except KeyError: return redirect(loadLoginPage) + def switchServer(request): try: userID = request.session['userID'] @@ -1722,6 +1851,7 @@ def switchServer(request): except KeyError: return redirect(loadLoginPage) + def statusFunc(request): try: userID = request.session['userID'] @@ -1733,6 +1863,7 @@ def statusFunc(request): except KeyError: return redirect(loadLoginPage) + def tuneSettings(request): try: userID = request.session['userID'] @@ -1742,6 +1873,7 @@ def tuneSettings(request): except KeyError: return redirect(loadLoginPage) + def saveApacheConfigsToFile(request): try: userID = request.session['userID'] diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 69f197b45..5d0e67a11 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -82,6 +82,37 @@ def createWebsite(self, request=None, userID=None, data=None): Data, 'createWebsite') return proc.render() + + def createWebsiteV2(self, request=None, userID=None, data=None): + + url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission" + data = { + "name": "all", + "IP": ACLManager.GetServerIP() + } + + import requests + response = requests.post(url, data=json.dumps(data)) + Status = response.json()['status'] + + test_domain_status = 0 + + if (Status == 1) or ProcessUtilities.decideServer() == ProcessUtilities.ent: + test_domain_status = 1 + + currentACL = ACLManager.loadedACL(userID) + adminNames = ACLManager.loadAllUsers(userID) + packagesName = ACLManager.loadPackages(userID, currentACL) + phps = PHPManager.findPHPVersions() + + rnpss = randomPassword.generate_pass(10) + + Data = {'packageList': packagesName, "owernList": adminNames, 'phps': phps, 'Randam_String': rnpss.lower(), + 'test_domain_data': test_domain_status} + proc = httpProc(request, 'websiteFunctions/createWebsiteV2.html', + Data, 'createWebsite') + return proc.render() + def WPCreate(self, request=None, userID=None, data=None): url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission" data = { @@ -716,6 +747,30 @@ def CreateNewDomain(self, request=None, userID=None, data=None): {'websiteList': websitesName, 'phps': PHPManager.findPHPVersions(), 'Randam_String': rnpss, 'test_domain_data':test_domain_status}) return proc.render() + def CreateNewDomainV2(self, request=None, userID=None, data=None): + currentACL = ACLManager.loadedACL(userID) + websitesName = ACLManager.findAllSites(currentACL, userID) + + url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission" + data = { + "name": "all", + "IP": ACLManager.GetServerIP() + } + + import requests + response = requests.post(url, data=json.dumps(data)) + Status = response.json()['status'] + + test_domain_status = 0 + + if (Status == 1) or ProcessUtilities.decideServer() == ProcessUtilities.ent: + test_domain_status = 1 + + rnpss = randomPassword.generate_pass(10) + proc = httpProc(request, 'websiteFunctions/createDomainV2.html', + {'websiteList': websitesName, 'phps': PHPManager.findPHPVersions(), 'Randam_String': rnpss, 'test_domain_data':test_domain_status}) + return proc.render() + def siteState(self, request=None, userID=None, data=None): currentACL = ACLManager.loadedACL(userID) @@ -732,6 +787,13 @@ def listWebsites(self, request=None, userID=None, data=None): {"pagination": pagination}) return proc.render() + def listWebsitesV2(self, request=None, userID=None, data=None): + currentACL = ACLManager.loadedACL(userID) + pagination = self.websitePagination(currentACL, userID) + proc = httpProc(request, 'websiteFunctions/listWebsiteV2.html', + {"pagination": pagination}) + return proc.render() + def listChildDomains(self, request=None, userID=None, data=None): currentACL = ACLManager.loadedACL(userID) adminNames = ACLManager.loadAllUsers(userID) @@ -743,6 +805,17 @@ def listChildDomains(self, request=None, userID=None, data=None): Data) return proc.render() + def listChildDomainsV2(self, request=None, userID=None, data=None): + currentACL = ACLManager.loadedACL(userID) + adminNames = ACLManager.loadAllUsers(userID) + packagesName = ACLManager.loadPackages(userID, currentACL) + phps = PHPManager.findPHPVersions() + + Data = {'packageList': packagesName, "owernList": adminNames, 'phps': phps} + proc = httpProc(request, 'websiteFunctions/listChildDomainsV2.html', + Data) + return proc.render() + def listCron(self, request=None, userID=None, data=None): currentACL = ACLManager.loadedACL(userID) admin = Administrator.objects.get(pk=userID)