From 0d853a094328ff716c259c66ce0101b14f638610 Mon Sep 17 00:00:00 2001 From: Zarak Khan Date: Wed, 28 Feb 2024 11:16:09 +0500 Subject: [PATCH] Create Lists --- IncBackups/static/IncBackups/IncBackupsV2.js | 11 +- .../IncBackups/ConfigureV2BackupV2.html | 115 +++ .../IncBackups/CreateV2BackupV2.html | 6 +- .../IncBackups/ScheduleV2BackupV2.html | 4 +- .../IncBackups/backupScheduleV2.html | 337 ++++++- .../templates/IncBackups/createBackupV2.html | 177 +++- .../IncBackups/restoreRemoteBackups.html | 4 +- .../backup/backupDestinationsV2.html | 2 +- backup/templates/backup/backupV2.html | 2 +- backup/templates/backup/remoteBackupsV2.html | 2 +- backup/templates/backup/restoreV2.html | 2 +- emailMarketing/emailMarketingManager.py | 62 ++ .../static/emailMarketing/emailMarketingV2.js | 887 ++++++++++++++++++ .../emailMarketing/composeMessagesV2.html | 10 +- .../emailMarketing/manageListsV2.html | 4 +- .../emailMarketing/manageSMTPHostsV2.html | 6 +- .../emailMarketing/sendEmailsV2.html | 220 +++++ emailMarketing/urls.py | 5 +- emailMarketing/views.py | 27 + .../static/emailPremium/emailPremiumV2.js | 2 +- .../emailPremium/EmailDebuggerV2.html | 2 +- ftp/templates/ftp/createFTPAccountV2.html | 2 +- .../mailServer/changeEmailPasswordV2.html | 2 +- .../templates/mailServer/dkimManagerV2.html | 11 +- .../templates/mailServer/listEmailsV2.html | 141 ++- .../websiteFunctions/websiteFunctionsV2.js | 365 +++++++ .../WPConfigurePluginsV2.html | 2 +- .../websiteFunctions/WPsiteHomeV2.html | 2 +- .../websiteFunctions/manageGITV2.html | 56 +- .../websiteFunctions/setupStagingV2.html | 71 ++ .../websiteFunctions/sshAccessV2.html | 103 ++ .../templates/websiteFunctions/websiteV2.html | 22 +- websiteFunctions/views.py | 18 + websiteFunctions/website.py | 32 + websitesv2/urls.py | 2 + 35 files changed, 2636 insertions(+), 80 deletions(-) create mode 100644 emailMarketing/templates/emailMarketing/sendEmailsV2.html create mode 100644 websiteFunctions/templates/websiteFunctions/setupStagingV2.html create mode 100644 websiteFunctions/templates/websiteFunctions/sshAccessV2.html diff --git a/IncBackups/static/IncBackups/IncBackupsV2.js b/IncBackups/static/IncBackups/IncBackupsV2.js index 2eb04a2f5..ab6ebc539 100644 --- a/IncBackups/static/IncBackups/IncBackupsV2.js +++ b/IncBackups/static/IncBackups/IncBackupsV2.js @@ -252,18 +252,21 @@ newapp.controller('CreateV2BackupV2', function ($scope, $http, $timeout, $compil newapp.controller('ConfigureV2BackupV2', function ($scope, $http, $timeout) { $scope.cyberpanelLoading = true; $scope.selectbackuptype = function () { + var backuptype = $scope.v2backuptype; + // Reset cyberpanelLoading to false initially $scope.cyberpanelLoading = false; - var backuptype = $scope.v2backuptype if (backuptype === 'GDrive') { + // Show GdriveModal $scope.cyberpanelLoading = true; - $('#GdriveModal').modal('show'); + document.getElementById('GDrive').classList.remove('hidden'); // Show the modal } else if (backuptype === 'SFTP') { + // Show SFTPModal (if you have defined it similarly) $scope.cyberpanelLoading = true; - $('#SFTPModal').modal('show'); + // Add logic to show SFTPModal if needed } - } + }; $scope.setupAccount = function () { diff --git a/IncBackups/templates/IncBackups/ConfigureV2BackupV2.html b/IncBackups/templates/IncBackups/ConfigureV2BackupV2.html index 4ef96894f..87cb07690 100644 --- a/IncBackups/templates/IncBackups/ConfigureV2BackupV2.html +++ b/IncBackups/templates/IncBackups/ConfigureV2BackupV2.html @@ -38,6 +38,121 @@ + + + + {#
#} {#
#} {#
-
+
-
+
-
+
-
+
-
+
-
+
+ {% trans "EDIT" %} + + + {% endblock %} diff --git a/IncBackups/templates/IncBackups/createBackupV2.html b/IncBackups/templates/IncBackups/createBackupV2.html index af868d9ca..1ee1b98f0 100644 --- a/IncBackups/templates/IncBackups/createBackupV2.html +++ b/IncBackups/templates/IncBackups/createBackupV2.html @@ -127,7 +127,94 @@ - Restore + {# {% trans " Restore Points" %}#} + {# #} + {# #} @@ -137,4 +224,92 @@
+ {% trans " Restore Points" %} + + {% endblock %} diff --git a/IncBackups/templates/IncBackups/restoreRemoteBackups.html b/IncBackups/templates/IncBackups/restoreRemoteBackups.html index 46472111f..6ac901658 100755 --- a/IncBackups/templates/IncBackups/restoreRemoteBackups.html +++ b/IncBackups/templates/IncBackups/restoreRemoteBackups.html @@ -23,7 +23,7 @@

{% trans "Backup Website" %} + src="{% static 'images/loading.gif' %}">

@@ -109,7 +109,7 @@ Restore diff --git a/backup/templates/backup/backupDestinationsV2.html b/backup/templates/backup/backupDestinationsV2.html index 2b2ed29fc..fa391fd4d 100644 --- a/backup/templates/backup/backupDestinationsV2.html +++ b/backup/templates/backup/backupDestinationsV2.html @@ -18,7 +18,7 @@

On this page you can set up your Backup destinations. (SFTP)

-
+

Set up Backup Destinations.

diff --git a/backup/templates/backup/backupV2.html b/backup/templates/backup/backupV2.html index a9b4309a3..6046e83ae 100644 --- a/backup/templates/backup/backupV2.html +++ b/backup/templates/backup/backupV2.html @@ -15,7 +15,7 @@

This page can be used to Backup your websites

-
+

Backup Website

diff --git a/backup/templates/backup/remoteBackupsV2.html b/backup/templates/backup/remoteBackupsV2.html index ac9a5a50d..012643b4b 100644 --- a/backup/templates/backup/remoteBackupsV2.html +++ b/backup/templates/backup/remoteBackupsV2.html @@ -16,7 +16,7 @@

This feature can import website(s) from remote server

-
+

Remote Backups

diff --git a/backup/templates/backup/restoreV2.html b/backup/templates/backup/restoreV2.html index 592a74c44..06dad572b 100644 --- a/backup/templates/backup/restoreV2.html +++ b/backup/templates/backup/restoreV2.html @@ -17,7 +17,7 @@

This page can be used to restore your websites, Backup should be generated from CyberPanel Backup generation tool, it will detect all Backups under /home/backup.

-
+

Restore Website

diff --git a/emailMarketing/emailMarketingManager.py b/emailMarketing/emailMarketingManager.py index dc4b63f87..07005bab2 100755 --- a/emailMarketing/emailMarketingManager.py +++ b/emailMarketing/emailMarketingManager.py @@ -197,6 +197,29 @@ class EmailMarketingManager: except KeyError as msg: return redirect(loadLoginPage) + def manageListsV2(self): + try: + userID = self.request.session['userID'] + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1: + pass + else: + return ACLManager.loadError() + + if emACL.checkIfEMEnabled(admin.userName) == 0: + return ACLManager.loadError() + + listNames = emACL.getEmailsLists(self.domain) + + proc = httpProc(self.request, 'emailMarketing/manageListsV2.html', + {'listNames': listNames, 'domain': self.domain}) + return proc.render() + + except KeyError as msg: + return redirect(loadLoginPage) + def configureVerify(self): try: @@ -721,6 +744,20 @@ class EmailMarketingManager: except KeyError as msg: return redirect(loadLoginPage) + def composeEmailMessageV2(self): + try: + userID = self.request.session['userID'] + admin = Administrator.objects.get(pk=userID) + + if emACL.checkIfEMEnabled(admin.userName) == 0: + return ACLManager.loadErrorJson() + + proc = httpProc(self.request, 'emailMarketing/composeMessagesV2.html', + None) + return proc.render() + except KeyError as msg: + return redirect(loadLoginPage) + def saveEmailTemplate(self): try: userID = self.request.session['userID'] @@ -780,6 +817,31 @@ class EmailMarketingManager: except KeyError as msg: return redirect(loadLoginPage) + def sendEmailsV2(self): + try: + userID = self.request.session['userID'] + admin = Administrator.objects.get(pk=userID) + + if emACL.checkIfEMEnabled(admin.userName) == 0: + return ACLManager.loadErrorJson() + + currentACL = ACLManager.loadedACL(userID) + templateNames = emACL.allTemplates(currentACL, admin) + hostNames = emACL.allSMTPHosts(currentACL, admin) + listNames = emACL.allEmailsLists(currentACL, admin) + + Data = {} + Data['templateNames'] = templateNames + Data['hostNames'] = hostNames + Data['listNames'] = listNames + + proc = httpProc(self.request, 'emailMarketing/sendEmailsV2.html', + Data) + return proc.render() + + except KeyError as msg: + return redirect(loadLoginPage) + def templatePreview(self): try: userID = self.request.session['userID'] diff --git a/emailMarketing/static/emailMarketing/emailMarketingV2.js b/emailMarketing/static/emailMarketing/emailMarketingV2.js index 140be4b10..4d0046f89 100644 --- a/emailMarketing/static/emailMarketing/emailMarketingV2.js +++ b/emailMarketing/static/emailMarketing/emailMarketingV2.js @@ -2,6 +2,22 @@ var emailListURL = "/emailMarketing/" + $("#domainNamePageV2").text() + "/emailL $("#emailListsV2").attr("href", emailListURL); $("#emailListsChildV2").attr("href", emailListURL); +var manageListsURL = "/emailMarketing/" + $("#domainNamePageV2").text() + "/manageListsV2"; +$("#manageListsV2").attr("href", manageListsURL); +$("#manageListsChildV2").attr("href", manageListsURL); + +var sendEmailsURL = "/emailMarketing/sendEmailsV2"; +$("#sendEmailsPageV2").attr("href", sendEmailsURL); +$("#sendEmailsPageChildV2").attr("href", sendEmailsURL); + +var composeEmailURL = "/emailMarketing/composeEmailMessageV2"; +$("#composeEmailsV2").attr("href", composeEmailURL); +$("#composeEmailsChildV2").attr("href", composeEmailURL); + +var smtpHostsURL = "/emailMarketing/" + $("#domainNamePageV2").text() + "/manageSMTPV2"; +$("#manageSMTPHostsV2").attr("href", smtpHostsURL); +$("#manageSMTPHostsChildV2").attr("href", smtpHostsURL); + newapp.controller('createEmailListV2', function ($scope, $http, $timeout) { $scope.installationDetailsForm = false; @@ -391,5 +407,876 @@ newapp.controller('manageSMTPHostsCTRLV2', function ($scope, $http) { } + }; +}); +newapp.controller('manageEmailListsV2', function ($scope, $http, $timeout) { + + $scope.installationDetailsForm = true; + $scope.installationProgress = true; + $scope.cyberPanelLoading = true; + $scope.goBackDisable = true; + $scope.verificationStatus = true; + + var statusFile; + var path; + + + $scope.goBack = function () { + $scope.installationDetailsForm = false; + $scope.installationProgress = true; + $scope.cyberPanelLoading = true; + $scope.goBackDisable = true; + $("#installProgress").css("width", "0%"); + }; + + $scope.createEmailList = function () { + + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.cyberPanelLoading = false; + $scope.goBackDisable = true; + $scope.currentStatus = "Starting to load email addresses.."; + + + url = "/emailMarketing/submitEmailList"; + + var data = { + domain: $("#domainNamePage").text(), + path: $scope.path, + listName: $scope.listName + }; + + 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; + getInstallStatus(); + } else { + + $scope.installationDetailsForm = true; + $scope.cyberPanelLoading = true; + $scope.goBackDisable = false; + + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + } + + }; + + function getInstallStatus() { + + url = "/websites/installWordpressStatus"; + + var data = { + statusFile: statusFile, + domainName: $("#domainNamePage").text() + }; + + 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.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.cyberPanelLoading = true; + $scope.goBackDisable = false; + $scope.currentStatus = 'Emails successfully loaded.'; + $timeout.cancel(); + + } else { + + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.cyberPanelLoading = true; + $scope.goBackDisable = false; + $scope.currentStatus = response.data.error_message; + + + } + + } else { + $scope.installPercentage = response.data.installationProgress; + $scope.currentStatus = response.data.currentStatus; + + $timeout(getInstallStatus, 1000); + } + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + + } + + + } + + + /// + + $scope.currentRecords = true; + + $scope.recordstoShow = 50; + var globalPage; + + $scope.fetchRecords = function () { + $scope.fetchEmails(globalPage); + }; + + $scope.fetchEmails = function (page) { + globalPage = page; + listVerificationStatus(); + + $scope.cyberPanelLoading = false; + + url = "/emailMarketing/fetchEmails"; + + var data = { + 'listName': $scope.listName, + 'recordstoShow': $scope.recordstoShow, + 'page': page + + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.cyberPanelLoading = true; + + if (response.data.status === 1) { + $scope.currentRecords = false; + $scope.records = JSON.parse(response.data.data); + $scope.pagination = response.data.pagination; + $scope.verificationButton = false; + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + } + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = false; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + } + + }; + + $scope.deleteList = function () { + + $scope.cyberPanelLoading = false; + + url = "/emailMarketing/deleteList"; + + var data = { + listName: $scope.listName + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.cyberPanelLoading = true; + if (response.data.status === 1) { + new PNotify({ + title: 'Success!', + text: 'Emails Successfully Deleted.', + type: 'success' + }); + } else { + + $scope.cyberPanelLoading = false; + + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + } + + }; + + $scope.showAddEmails = function () { + $scope.installationDetailsForm = false; + $scope.verificationStatus = true; + }; + + // List Verification + + $scope.startVerification = function () { + + $scope.currentStatusVerification = 'Email verification job started..'; + $scope.installationDetailsForm = true; + $scope.verificationStatus = false; + $scope.verificationButton = true; + $scope.cyberPanelLoading = false; + + url = "/emailMarketing/emailVerificationJob"; + + var data = { + listName: $scope.listName + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + + if (response.data.status === 1) { + listVerificationStatus(); + $scope.verificationButton = true; + } else { + + $scope.cyberPanelLoading = true; + $scope.verificationButton = false; + + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + $scope.verificationButton = false; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + } + + + }; + + var globalCounter = 0; + + function listVerificationStatus() { + + $scope.verificationButton = true; + $scope.cyberPanelLoading = false; + + url = "/websites/installWordpressStatus"; + + var data = { + domain: $("#domainNamePage").text(), + statusFile: "/home/cyberpanel/" + $("#domainNamePage").text() + "/" + $scope.listName + }; + + 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.cyberPanelLoading = true; + $scope.verificationButton = false; + $scope.currentStatusVerification = 'Emails successfully verified.'; + $timeout.cancel(); + + } else { + + if (response.data.error_message.search('No such file') > -1) { + $scope.verificationButton = false; + return; + } + $scope.verificationButton = true; + $scope.cyberPanelLoading = false; + $scope.verificationStatus = false; + $scope.currentStatusVerification = response.data.error_message; + + } + + } else { + + if (response.data.currentStatus.search('No such file') > -1) { + $scope.cyberPanelLoading = true; + $scope.deleteTemplateBTN = false; + $scope.sendEmailBTN = false; + $scope.sendEmailsView = true; + $scope.jobStatus = true; + $scope.goBackDisable = false; + $timeout.cancel(); + return; + } + + $scope.currentStatusVerification = response.data.currentStatus; + $timeout(listVerificationStatus, 1000); + $scope.verificationStatus = false; + } + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + + } + + + } + + // Delete Email from list + + $scope.deleteEmail = function (id) { + + $scope.cyberPanelLoading = false; + + url = "/emailMarketing/deleteEmail"; + + var data = { + id: id + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.cyberPanelLoading = true; + $scope.fetchEmails(globalPage); + + if (response.data.status === 1) { + $scope.fetchEmails(globalPage); + new PNotify({ + title: 'Success.', + text: 'Email Successfully deleted.', + type: 'success' + }); + + } else { + + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + } + + }; + + + $scope.currentPageLogs = 1; + $scope.recordsToShowLogs = 10; + + $scope.fetchLogs = function () { + + $scope.cyberPanelLoading = false; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + var data = { + listName: $scope.listName, + page: $scope.currentPageLogs, + recordsToShow: $scope.recordsToShowLogs + }; + + url = "/emailMarketing/fetchVerifyLogs"; + + $http.post(url, data, config).then(ListInitialData, cantLoadInitialData); + + function ListInitialData(response) { + $scope.cyberPanelLoading = true; + if (response.data.status === 1) { + $scope.recordsLogs = JSON.parse(response.data.logs); + $scope.paginationLogs = response.data.pagination; + $scope.totalEmails = response.data.totalEmails; + $scope.verified = response.data.verified; + $scope.notVerified = response.data.notVerified; + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + } + + function cantLoadInitialData(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + } + + + }; + + +}); +newapp.controller('sendEmailsCTRLV2', function ($scope, $http, $timeout) { + + $scope.cyberPanelLoading = true; + $scope.availableFunctions = true; + $scope.sendEmailsView = true; + $scope.jobStatus = true; + + // Button + + $scope.deleteTemplateBTN = false; + $scope.sendEmailBTN = false; + + $scope.templateSelected = function () { + $scope.availableFunctions = false; + $scope.sendEmailsView = true; + $scope.previewLink = '/emailMarketing/preview/' + $scope.selectedTemplate; + $scope.jobStatus = true; + emailJobStatus(); + + }; + + $scope.sendEmails = function () { + $scope.sendEmailsView = false; + $scope.fetchJobs(); + }; + + $scope.fetchJobs = function () { + + $scope.cyberPanelLoading = false; + + url = "/emailMarketing/fetchJobs"; + + var data = { + 'selectedTemplate': $scope.selectedTemplate + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.cyberPanelLoading = true; + + if (response.data.status === 1) { + $scope.currentRecords = false; + $scope.records = JSON.parse(response.data.data); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + } + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = false; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + } + + }; + + $scope.startEmailJob = function () { + $scope.cyberPanelLoading = false; + $scope.deleteTemplateBTN = true; + $scope.sendEmailBTN = true; + $scope.sendEmailsView = true; + $scope.goBackDisable = true; + + url = "/emailMarketing/startEmailJob"; + + + var data = { + 'selectedTemplate': $scope.selectedTemplate, + 'listName': $scope.listName, + 'host': $scope.host, + 'verificationCheck': $scope.verificationCheck, + 'unsubscribeCheck': $scope.unsubscribeCheck + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.cyberPanelLoading = true; + + if (response.data.status === 1) { + emailJobStatus(); + } else { + $scope.cyberPanelLoading = true; + $scope.deleteTemplateBTN = false; + $scope.sendEmailBTN = false; + $scope.sendEmailsView = false; + $scope.jobStatus = true; + $scope.goBackDisable = false; + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + } + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = false; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + } + + + }; + + function emailJobStatus() { + + $scope.cyberPanelLoading = false; + $scope.deleteTemplateBTN = true; + $scope.sendEmailBTN = true; + $scope.sendEmailsView = true; + $scope.jobStatus = false; + $scope.goBackDisable = true; + + url = "/websites/installWordpressStatus"; + + var data = { + domain: 'example.com', + statusFile: "/home/cyberpanel/" + $scope.selectedTemplate + "_pendingJob" + }; + + 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.cyberPanelLoading = true; + $scope.deleteTemplateBTN = false; + $scope.sendEmailBTN = false; + $scope.sendEmailsView = true; + $scope.jobStatus = false; + $scope.goBackDisable = false; + $scope.currentStatus = 'Emails successfully sent.'; + $scope.fetchJobs(); + $timeout.cancel(); + + } else { + + if (response.data.error_message.search('No such file') > -1) { + $scope.cyberPanelLoading = true; + $scope.deleteTemplateBTN = false; + $scope.sendEmailBTN = false; + $scope.sendEmailsView = true; + $scope.jobStatus = true; + $scope.goBackDisable = false; + return; + } + $scope.cyberPanelLoading = true; + $scope.deleteTemplateBTN = false; + $scope.sendEmailBTN = false; + $scope.sendEmailsView = true; + $scope.jobStatus = false; + $scope.goBackDisable = false; + $scope.currentStatus = response.data.error_message; + + } + + } else { + + if (response.data.currentStatus.search('No such file') > -1) { + $scope.cyberPanelLoading = true; + $scope.deleteTemplateBTN = false; + $scope.sendEmailBTN = false; + $scope.sendEmailsView = true; + $scope.jobStatus = true; + $scope.goBackDisable = false; + $timeout.cancel(); + return; + } + + $scope.currentStatus = response.data.currentStatus; + $timeout(emailJobStatus, 1000); + $scope.cyberPanelLoading = false; + $scope.deleteTemplateBTN = true; + $scope.sendEmailBTN = true; + $scope.sendEmailsView = true; + $scope.jobStatus = false; + $scope.goBackDisable = true; + } + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page.', + type: 'error' + }); + + + } + + + } + + $scope.goBack = function () { + $scope.cyberPanelLoading = true; + $scope.deleteTemplateBTN = false; + $scope.sendEmailBTN = false; + $scope.sendEmailsView = false; + $scope.jobStatus = true; + + }; + + $scope.deleteTemplate = function () { + + $scope.cyberPanelLoading = false; + + url = "/emailMarketing/deleteTemplate"; + + var data = { + selectedTemplate: $scope.selectedTemplate + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.cyberPanelLoading = true; + + if (response.data.status === 1) { + new PNotify({ + title: 'Success.', + text: 'Template Successfully deleted.', + type: 'success' + }); + + } else { + + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + } + + }; + $scope.deleteJob = function (id) { + + $scope.cyberPanelLoading = false; + + url = "/emailMarketing/deleteJob"; + + var data = { + id: id + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.cyberPanelLoading = true; + $scope.fetchJobs(); + + if (response.data.status === 1) { + new PNotify({ + title: 'Success.', + text: 'Template Successfully deleted.', + type: 'success' + }); + + } else { + + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $scope.cyberPanelLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please refresh this page', + type: 'error' + }); + + } + }; }); \ No newline at end of file diff --git a/emailMarketing/templates/emailMarketing/composeMessagesV2.html b/emailMarketing/templates/emailMarketing/composeMessagesV2.html index 39532fdab..1b0695627 100644 --- a/emailMarketing/templates/emailMarketing/composeMessagesV2.html +++ b/emailMarketing/templates/emailMarketing/composeMessagesV2.html @@ -11,7 +11,7 @@

On this page you can compose email message to be sent out later.

-
+

Compose Email Message

@@ -60,17 +60,17 @@
-
+
+ ng-model="emailMessage" rows="15" class="border w-full">
-
+
diff --git a/emailMarketing/templates/emailMarketing/manageListsV2.html b/emailMarketing/templates/emailMarketing/manageListsV2.html index 9b4a59e4b..7b7b8ab8f 100644 --- a/emailMarketing/templates/emailMarketing/manageListsV2.html +++ b/emailMarketing/templates/emailMarketing/manageListsV2.html @@ -5,7 +5,7 @@ {% load static %} -
+
@@ -19,7 +19,7 @@
-
+

Manage Email Lists

diff --git a/emailMarketing/templates/emailMarketing/manageSMTPHostsV2.html b/emailMarketing/templates/emailMarketing/manageSMTPHostsV2.html index b8750bb61..f9312e858 100644 --- a/emailMarketing/templates/emailMarketing/manageSMTPHostsV2.html +++ b/emailMarketing/templates/emailMarketing/manageSMTPHostsV2.html @@ -12,7 +12,7 @@ used to send emails.

-
+

Manage SMTP Hosts

@@ -53,9 +53,9 @@
-
+
diff --git a/emailMarketing/templates/emailMarketing/sendEmailsV2.html b/emailMarketing/templates/emailMarketing/sendEmailsV2.html new file mode 100644 index 000000000..2c85c2b45 --- /dev/null +++ b/emailMarketing/templates/emailMarketing/sendEmailsV2.html @@ -0,0 +1,220 @@ +{% extends "baseTemplate/newBase.html" %} +{% load i18n %} +{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %} +{% block newContent %} + + {% load static %} + +
+
+
+
+
+

Send Emails

+

On this page you can send emails to the + lists you created using SMTP Hosts.

+
+
+
+
+
+
+

Send Emails

+ +
+
+
+
+
+

Select Template

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

{% trans "SSL for email is not configured properly, you may get Self-Signed error on mail clients such as Outlook and Thunderbird. More details " %}here.#} + {#

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

Details To Configure Mail Clients

#} + {#
#} + {#
#} + {#
#} + {#
#} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {#
#} + {# Emails#} + {# #} + {# Disk Usage#} + {# #} + {# Actions#} + {#
#} + {# #} + {# #} + {# #} + {# #} + {#
#} + {#
#} + {#
#} + {#
#} + {#
#} + {# #} + {#
#} + {#

POP3

#} + {#
#} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {#
#} + {# Server Hostname#} + {# #} + {# Port#} + {# #} + {# Port#} + {# #} + {# SSL#} + {#
#} + {# {$ serverHostname $}#} + {# #} + {# 110#} + {# #} + {# 995 (SSL)#} + {# #} + {# STARTTLS#} + {#
#} + {#
#} + {#
#} + {# #} + {#
#} + {#

IMAP

#} + {#
#} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {#
#} + {# Server Hostname#} + {# #} + {# Port#} + {# #} + {# Port#} + {# #} + {# SSL#} + {#
#} + {# {$ serverHostname $}#} + {# #} + {# 143#} + {# #} + {# 993 (SSL)#} + {# #} + {# STARTTLS#} + {#
#} + {#
#} + {#
#} + {# #} + {#
#} + {#

SMTP

#} + {#
#} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {# #} + {#
#} + {# Server Hostname#} + {# #} + {# Port#} + {# #} + {# Port#} + {# #} + {# 465 SSL#} + {#
#} + {# {$ serverHostname $}#} + {# #} + {# 25#} + {# #} + {# 587 (SSL)#} + {# #} + {# STARTTLS#} + {#
#} + {#
#} + {#
#} + {#
#} + {#
#} +
+
+
+{% endblock %} diff --git a/emailMarketing/urls.py b/emailMarketing/urls.py index d72904447..53960fbff 100755 --- a/emailMarketing/urls.py +++ b/emailMarketing/urls.py @@ -11,8 +11,9 @@ urlpatterns = [ url(r'^(?P(.*))/emailListsV2$', views.createEmailListV2, name='createEmailListV2'), url(r'^submitEmailList$', views.submitEmailList, name='submitEmailList'), url(r'^(?P(.*))/manageLists$', views.manageLists, name='manageLists'), + url(r'^(?P(.*))/manageListsV2$', views.manageListsV2, name='manageListsV2'), url(r'^(?P(.*))/manageSMTP$', views.manageSMTP, name='manageSMTP'), - url(r'^V2/(?P(.*))/manageSMTPV2$', views.manageSMTPV2, name='manageSMTPV2'), + url(r'^(?P(.*))/manageSMTPV2$', views.manageSMTPV2, name='manageSMTPV2'), url(r'^(?P(.*))/configureVerify$', views.configureVerify, name='configureVerify'), url(r'^fetchEmails$', views.fetchEmails, name='fetchEmails'), url(r'^deleteList$', views.deleteList, name='deleteList'), @@ -22,8 +23,10 @@ urlpatterns = [ url(r'^fetchSMTPHosts$', views.fetchSMTPHosts, name='fetchSMTPHosts'), url(r'^smtpHostOperations$', views.smtpHostOperations, name='smtpHostOperations'), url(r'^composeEmailMessage$', views.composeEmailMessage, name='composeEmailMessage'), + url(r'^composeEmailMessageV2$', views.composeEmailMessageV2, name='composeEmailMessageV2'), url(r'^saveEmailTemplate$', views.saveEmailTemplate, name='saveEmailTemplate'), url(r'^sendEmails$', views.sendEmails, name='sendEmails'), + url(r'^sendEmailsV2$', views.sendEmailsV2, name='sendEmailsV2'), url(r'^preview/(?P[-\w]+)/$', views.templatePreview, name='templatePreview'), url(r'^fetchJobs$', views.fetchJobs, name='fetchJobs'), url(r'^startEmailJob$', views.startEmailJob, name='startEmailJob'), diff --git a/emailMarketing/views.py b/emailMarketing/views.py index 8384f5b99..4b55f8365 100755 --- a/emailMarketing/views.py +++ b/emailMarketing/views.py @@ -71,6 +71,15 @@ def manageLists(request, domain): return redirect(loadLoginPage) +def manageListsV2(request, domain): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request, domain) + return emm.manageListsV2() + except KeyError: + return redirect(loadLoginPage) + + def configureVerify(request, domain): try: userID = request.session['userID'] @@ -188,6 +197,15 @@ def composeEmailMessage(request): return redirect(loadLoginPage) +def composeEmailMessageV2(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.composeEmailMessageV2() + except KeyError: + return redirect(loadLoginPage) + + def saveEmailTemplate(request): try: userID = request.session['userID'] @@ -206,6 +224,15 @@ def sendEmails(request): return redirect(loadLoginPage) +def sendEmailsV2(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.sendEmailsV2() + except KeyError: + return redirect(loadLoginPage) + + def templatePreview(request, templateName): try: userID = request.session['userID'] diff --git a/emailPremium/static/emailPremium/emailPremiumV2.js b/emailPremium/static/emailPremium/emailPremiumV2.js index e4e1666c6..771ba5d57 100644 --- a/emailPremium/static/emailPremium/emailPremiumV2.js +++ b/emailPremium/static/emailPremium/emailPremiumV2.js @@ -140,7 +140,7 @@ newapp.controller('EmailDebuugerV2', function ($scope, $http, $timeout, $window) $scope.Port993 = report.Port993; $scope.Port995 = report.Port995; //document.getElementById('MailSSLURL').href = 'https://' + report.serverHostName + ":" + report.port + '/cloudAPI/access?token=' + report.token + "&serverUserName=" + report.userName + '&redirect=/manageSSL/sslForMailServer'; - document.getElementById('MailSSLURL').href = '/manageSSL/sslForMailServer'; + document.getElementById('MailSSLURLV2').href = '/manageSSL/V2/sslForMailServerV2'; $scope.ReportStatus = false; diff --git a/emailPremium/templates/emailPremium/EmailDebuggerV2.html b/emailPremium/templates/emailPremium/EmailDebuggerV2.html index 79d76c85b..109477282 100644 --- a/emailPremium/templates/emailPremium/EmailDebuggerV2.html +++ b/emailPremium/templates/emailPremium/EmailDebuggerV2.html @@ -117,7 +117,7 @@ {$ MailSSL $} - +
-
+

Create FTP Account

diff --git a/mailServer/templates/mailServer/changeEmailPasswordV2.html b/mailServer/templates/mailServer/changeEmailPasswordV2.html index 9120dca6e..71ca4ffcc 100644 --- a/mailServer/templates/mailServer/changeEmailPasswordV2.html +++ b/mailServer/templates/mailServer/changeEmailPasswordV2.html @@ -12,7 +12,7 @@ password.

- {% if openDKIMInstalled == 0 %}
-
+

DKIM Manager

@@ -63,9 +65,10 @@ {% else %}
-

- {% trans "DKIM Manager" %} -

+
+

DKIM Manager

+ +
diff --git a/mailServer/templates/mailServer/listEmailsV2.html b/mailServer/templates/mailServer/listEmailsV2.html index ed348ab57..fdb87ac27 100644 --- a/mailServer/templates/mailServer/listEmailsV2.html +++ b/mailServer/templates/mailServer/listEmailsV2.html @@ -99,9 +99,75 @@ - + {% trans "Change Password" %} + +
@@ -233,4 +299,73 @@
{% endif %}
+ {% trans "Change Password" %} + + {% endblock %} diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctionsV2.js b/websiteFunctions/static/websiteFunctions/websiteFunctionsV2.js index 7e5536c48..9a0d8c2c0 100644 --- a/websiteFunctions/static/websiteFunctions/websiteFunctionsV2.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctionsV2.js @@ -7389,6 +7389,371 @@ function DeleteBackupfileConfigNow(url) { window.location.href = url; } +newapp.controller('sshAccessV2', function ($scope, $http, $timeout) { + + $scope.wpInstallLoading = true; + + $scope.setupSSHAccess = function () { + $scope.wpInstallLoading = false; + + url = "/websites/saveSSHAccessChanges"; + + var data = { + domain: $("#domainName").text(), + externalApp: $("#externalApp").text(), + password: $scope.password + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.wpInstallLoading = true; + + if (response.data.status === 1) { + new PNotify({ + title: 'Success', + text: 'Changes Successfully Applied.', + type: 'success' + }); + } else { + + + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + + } + + + } + + function cantLoadInitialDatas(response) { + + new PNotify({ + title: 'Error!', + text: 'Could not connect to server, please refresh this page.', + type: 'error' + }); + + + } + + }; + + /// SSH Key at user level + + $scope.keyBox = true; + $scope.saveKeyBtn = true; + + $scope.addKey = function () { + $scope.showKeyBox = true; + $scope.keyBox = false; + $scope.saveKeyBtn = false; + }; + + function populateCurrentKeys() { + + url = "/websites/getSSHConfigs"; + + var data = { + domain: $("#domainName").text(), + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + + if (response.data.status === 1) { + $scope.records = JSON.parse(response.data.data); + } + } + + function cantLoadInitialDatas(response) { + $scope.couldNotConnect = false; + } + + + } + + populateCurrentKeys(); + + $scope.deleteKey = function (key) { + + $scope.wpInstallLoading = false; + + url = "/websites/deleteSSHKey"; + + var data = { + domain: $("#domainName").text(), + key: key, + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + function ListInitialDatas(response) { + $scope.wpInstallLoading = true; + if (response.data.delete_status === 1) { + new PNotify({ + title: 'Success', + text: 'Key deleted successfully.', + type: 'success' + }); + populateCurrentKeys(); + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + + } + + function cantLoadInitialDatas(response) { + $scope.wpInstallLoading = true; + new PNotify({ + title: 'Error!', + text: 'Could not connect to server, please refresh this page.', + type: 'error' + }); + + } + + + } + + $scope.saveKey = function (key) { + + $scope.wpInstallLoading = false; + + url = "/websites/addSSHKey"; + + var data = { + domain: $("#domainName").text(), + key: $scope.keyData, + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.wpInstallLoading = true; + if (response.data.add_status === 1) { + new PNotify({ + title: 'Success', + text: 'Key added successfully.', + type: 'success' + }); + populateCurrentKeys(); + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + + } + + function cantLoadInitialDatas(response) { + new PNotify({ + title: 'Error!', + text: 'Could not connect to server, please refresh this page.', + type: 'error' + }); + + } + + + } + + +}); +newapp.controller('cloneWebsiteV2', function ($scope, $http, $timeout, $window) { + + $('form').submit(function (e) { + e.preventDefault(); + }); + + $scope.cyberpanelLoading = true; + $scope.installationDetailsForm = false; + $scope.installationProgress = true; + $scope.goBackDisable = true; + + $scope.cloneEnter = function ($event) { + var keyCode = $event.which || $event.keyCode; + if (keyCode === 13) { + $scope.cyberpanelLoading = false; + $scope.startCloning(); + } + }; + + var statusFile; + + $scope.startCloning = function () { + + $scope.cyberpanelLoading = false; + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.goBackDisable = true; + + $scope.currentStatus = "Cloning started.."; + + url = "/websites/startCloning"; + + + var data = { + masterDomain: $("#domainName").text(), + domainName: $scope.domain + + }; + + 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 { + + $scope.cyberpanelLoading = true; + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.goBackDisable = false; + + $scope.currentStatus = response.data.error_message; + } + + + } + + function cantLoadInitialDatas(response) { + + $scope.cyberpanelLoading = true; + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.goBackDisable = false; + + } + + }; + $scope.goBack = function () { + $scope.cyberpanelLoading = true; + $scope.installationDetailsForm = false; + $scope.installationProgress = true; + $scope.goBackDisable = true; + $("#installProgress").css("width", "0%"); + }; + + 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.cyberpanelLoading = true; + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.goBackDisable = false; + + $("#installProgress").css("width", "100%"); + $scope.installPercentage = "100"; + $scope.currentStatus = response.data.currentStatus; + $timeout.cancel(); + + } else { + + $scope.cyberpanelLoading = true; + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.goBackDisable = false; + + $scope.currentStatus = 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.cyberpanelLoading = true; + $scope.installationDetailsForm = true; + $scope.installationProgress = false; + $scope.goBackDisable = false; + + } + + + } + +}); diff --git a/websiteFunctions/templates/websiteFunctions/WPConfigurePluginsV2.html b/websiteFunctions/templates/websiteFunctions/WPConfigurePluginsV2.html index f0053a28e..903ed0d16 100644 --- a/websiteFunctions/templates/websiteFunctions/WPConfigurePluginsV2.html +++ b/websiteFunctions/templates/websiteFunctions/WPConfigurePluginsV2.html @@ -23,7 +23,7 @@
-
+

Plugin Buckets

diff --git a/websiteFunctions/templates/websiteFunctions/WPsiteHomeV2.html b/websiteFunctions/templates/websiteFunctions/WPsiteHomeV2.html index 62f303f8f..d62f15ac1 100644 --- a/websiteFunctions/templates/websiteFunctions/WPsiteHomeV2.html +++ b/websiteFunctions/templates/websiteFunctions/WPsiteHomeV2.html @@ -601,7 +601,7 @@
    - +
  • -
    -

    Manage GIT - {% trans "Git Docs" %}

    -

    Manage and track folders via Git - for {{ domainName }}.

    +
    +

    Manage GIT -

    + {% trans "Git Docs" %}
    -
    a -
    -

    - {% trans "Manage and track folders via Git for " %} {{ domainName }}. -

    +

    Manage and track folders via Git + for {{ domainName }}.

    +
    +
    +

    Manage and track folders via Git for {{ domainName }}

    +

    @@ -38,18 +37,23 @@

    {% trans "This folder does not have Git tracking, click below to initiate a repository and start tracking files." %}

    - - - +
    +
    + +
    +
    + + +
    +
    diff --git a/websiteFunctions/templates/websiteFunctions/setupStagingV2.html b/websiteFunctions/templates/websiteFunctions/setupStagingV2.html new file mode 100644 index 000000000..8abb63660 --- /dev/null +++ b/websiteFunctions/templates/websiteFunctions/setupStagingV2.html @@ -0,0 +1,71 @@ +{% extends "baseTemplate/newBase.html" %} +{% load i18n %} +{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %} +{% block newContent %} + + {% load static %} + +
    +
    +

    Set up Staging Enviroment

    +
    +

    Set up staging enviroment for + {{ domainName }}. Any domain that you will choose here will be created as child-domain for this master + site.

    +
    +
    +

    Set up staging enviroment for {{ domainName }} +

    + - +
    +
    +
    +

    Domain that you + will enter below will be created as child-domain to + {{ domainName }} + . +

    +
    +
    +
    +
    +

    Domain

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

    {$ currentStatus $}

    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +{% endblock %} diff --git a/websiteFunctions/templates/websiteFunctions/sshAccessV2.html b/websiteFunctions/templates/websiteFunctions/sshAccessV2.html new file mode 100644 index 000000000..5ff5b8084 --- /dev/null +++ b/websiteFunctions/templates/websiteFunctions/sshAccessV2.html @@ -0,0 +1,103 @@ +{% extends "baseTemplate/newBase.html" %} +{% load i18n %} +{% block titleNew %}{% trans "Home - CyberPanel" %}{% endblock %} +{% block newContent %} + + {% load static %} + +
    +
    +

    SSH Access -

    +
    +

    Set up SSH access and enable/disable CageFS + for {{ domainName }} CageFS require CloudLinux OS.

    +
    +
    +

    Set up SSH access for {{ domainName }}

    + - + SFTP Docs +
    +
    +
    +

    SSH user for + {{ domainName }} + is {{ externalApp }} +

    +
    +
    +
    +
    +

    Password

    +
    +
    + +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + +
    + User Name + + Key + + Delete +
    + root + + +
    X
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +{% endblock %} diff --git a/websiteFunctions/templates/websiteFunctions/websiteV2.html b/websiteFunctions/templates/websiteFunctions/websiteV2.html index 5198ca6fc..86abbc66c 100644 --- a/websiteFunctions/templates/websiteFunctions/websiteV2.html +++ b/websiteFunctions/templates/websiteFunctions/websiteV2.html @@ -27,19 +27,19 @@
    -
  • +
    Manage Lists

    -
  • -
  • + +
    SMTP Hosts

    -
  • -
  • + +
    @@ -1020,8 +1020,8 @@

    Compose

    -
  • -
  • + +
    Send Emails

    -
  • +
diff --git a/websiteFunctions/views.py b/websiteFunctions/views.py index 5e9ea895e..87f10069f 100755 --- a/websiteFunctions/views.py +++ b/websiteFunctions/views.py @@ -1794,6 +1794,15 @@ def sshAccess(request, domain): return redirect(loadLoginPage) +def sshAccessV2(request, domain): + try: + userID = request.session['userID'] + wm = WebsiteManager(domain) + return wm.sshAccessV2(request, userID) + except KeyError: + return redirect(loadLoginPage) + + def saveSSHAccessChanges(request): try: userID = request.session['userID'] @@ -1812,6 +1821,15 @@ def setupStaging(request, domain): return redirect(loadLoginPage) +def setupStagingV2(request, domain): + try: + userID = request.session['userID'] + wm = WebsiteManager(domain) + return wm.setupStagingV2(request, userID) + except KeyError: + return redirect(loadLoginPage) + + def startCloning(request): try: userID = request.session['userID'] diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index dca8fdb14..6a0f92d81 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -5357,6 +5357,22 @@ StrictHostKeyChecking no {'domainName': self.domain, 'externalApp': externalApp}) return proc.render() + def sshAccessV2(self, request=None, userID=None, data=None): + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1: + pass + else: + return ACLManager.loadError() + + website = Websites.objects.get(domain=self.domain) + externalApp = website.externalApp + + proc = httpProc(request, 'websiteFunctions/sshAccessV2.html', + {'domainName': self.domain, 'externalApp': externalApp}) + return proc.render() + def saveSSHAccessChanges(self, userID=None, data=None): try: @@ -5411,6 +5427,22 @@ StrictHostKeyChecking no {'domainName': self.domain, 'externalApp': externalApp}) return proc.render() + def setupStagingV2(self, request=None, userID=None, data=None): + currentACL = ACLManager.loadedACL(userID) + admin = Administrator.objects.get(pk=userID) + + if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1: + pass + else: + return ACLManager.loadError() + + website = Websites.objects.get(domain=self.domain) + externalApp = website.externalApp + + proc = httpProc(request, 'websiteFunctions/setupStagingV2.html', + {'domainName': self.domain, 'externalApp': externalApp}) + return proc.render() + def startCloning(self, userID=None, data=None): try: diff --git a/websitesv2/urls.py b/websitesv2/urls.py index 94d358d73..d2eed2281 100755 --- a/websitesv2/urls.py +++ b/websitesv2/urls.py @@ -179,6 +179,8 @@ urlpatterns = [ ### Manage GIT url(r'^(?P(.*))/manageGIT$', views.manageGITV2, name='manageGIT'), + url(r'^(?P(.*))/sshAccessV2$', views.sshAccessV2, name='sshAccessV2'), + url(r'^(?P(.*))/setupStagingV2$', views.setupStagingV2, name='setupStagingV2'), url(r'^(?P(.*))/webhook$', views.webhook, name='webhook'), url(r'^fetchFolderDetails$', views.fetchFolderDetails, name='fetchFolderDetails'), url(r'^initRepo$', views.initRepo, name='initRepo'),