Y9qkT;12?KRG>T6L~j*_I)w$`v#4Zcu!#Vm zE^y5Re1whQ>)t{?9_=8srQqMU6}%+`TsDwUZQw1mSsHw%J-}B=fC&i}J6}WKw`1j= zz+wUbf1s-k&c19<@CKW!O>AznCwMagN(DTtNdSE84c=fk!(cPR-r$V{loRdCtk)Jg zn~av2*af`7W-XvsMZwVy_8C|Tyu|^}U|=Fz8fc`N(g7V>|jAr_iqt;+EL0000 Eh3m*+RnJn!tx5Jd=ynsAv+cZ?~@GhUOaq2F%5 zI%KsLU$WUAn2f$mTw_sD|G1_obE(sxdSha)(N6+(Cnu9GDtx-_cF(ZYx}!5I>(*%l zfI59Yb+mwLfIBUU0}yr2;rMOPW~&~ySmxfC0343nyo$1X%w#H~PW~Ru@lXIn^(Q9& z?6F#lM$G2BraXYL=;&DL^t;rtA455<1prr%!|{jPX6qiYT63osfZ4O}995L(sWUCI zPLBtGsNSTcQIE~`-B3cp!;=FbD(aTe*w{4cz*kh>@i-m{08uWx{laiU!p;FY?F {> zYm1LAna%f(8vspc@uMbFA?@U4y`45109Uuefwe{N1&ifbDFDAjNB@&1w0zpJP9vS3 zC;)zIi=?D68WpAIEf&QOz}~%ka|#O!w;#{Xf3G()v%GK7qRNSsGd0!iOi3A =|{UZGci6Y1oK9 zw6(QqivWxY7e+A{fCC2(u#v_0Cr+IBTjx)oKFuHm10X)bF^p(QNeLTKI9ps??2882 zc6N69A^`$`g9i^X8}wHkc|he+3GoP%1|TCI0sQ&YsZ%VZ;S9cm<2+o00e}r`Q3jyG zMF2h#DX_&e+C~&LG&J~}gAi5X$OEkA93UeQ4$KW0IgiKVdln-H9Sf`jwkX5@7V8u3 z#lKM}>>xmc#B!*wqoc#8-ring0NkjG2mnSM;l|1HB&KH1Gco32cXu}%4UCXDXCo1! z27N$ZP(P23Q1y=s02)Fv!u&(B!|M;iT*TbRTS5$dbO3X&y1JUp^P@+PGJ7PflP6D- zvuDrxLVr90bY4I50Phd4ANfJ8e$4 #w |Q@G8oK zRQ2M)<*)Jar1rVZBu2s^{2tH(0QPzSFsEcOXYCYdJpGN~tAFV_c>tq|vOv7L7N}FR zEFmFazAaesv?c%xS3VOlfLvP|xx6@oT-~^lT+PcPzi!=1zKXZA@6aDP0E%+=n9212 zaL3qtEXk_QAOs)H*&q!7^D|@3^AQ8cx26#9iWS6LP(Zxfwh`~{-J~MU!UiNOce5M- zI`S{doa6tZD8!VU5!9iS$MZA+K=|tc0GgNd7)cdmc4UwQIwi87%9jLSGL^_)W>}h- z9yI)yuHU2y0G!tgKrmtNLJNS-pOjcq8keA|R`YBIU^5N5z{VU)*0RQA0oZ7=g1u1y z%qiI v=wfCWooliH5G|Q&HyR3nkG>`Vm+AbjnKegM z02B;Bs?eAWfO%QDK6@hoAQ|)eH35*#0V06JjMaXPg#*A7lTiS$S&LjWApjgp*7!9P z4uE~}lO*e}d1(Xyb80rLFR)L#1K4Uy@e6wy0Q0hQgWBr_z>>bwmxl}oP%wWnnVYpf zs4yi&07!Tkc{O`PQKSGct+1j@Ulm-s1E_obO}5jjrk3_DGUyo&X(I}-v;r6y^hno_ zvj-^vS7KsF(?bub$~AK)1JJf>m+$I|Uc#{&Iw%8xU!fUK{UHJTNC6z0F+){=008cy zA~s@1DBOuL0Prnzt-`*dE&zV`{BzBRnR*ETa2*HJMT@YNj 0q|{VE}Yhg&p4|$ z0sx%BRKc#XjBuX;;jcRYY*UNd);PexsV#pN?+)n=08Yu?3Izm10Pt;VoC3pnE*xm^ zt?X$HfD2PWY|x0%pV9zuWGzNOB-dUh6~HKVd?*ApUHxkzG}&(f!vNs_g0L@0L41GB z;UK}}r9YXc0suIIV{;ktOBG=Oj48^~;jYPzTCI}~;PBzY>{^W$;fC6@0f75H<58%U Z;GZ;>Ulnqt#w!2-002ovPDHLkV1kgQjobhL literal 0 HcmV?d00001 diff --git a/emailMarketing/templates/emailMarketing/composeMessages.html b/emailMarketing/templates/emailMarketing/composeMessages.html new file mode 100644 index 000000000..4c4ec015d --- /dev/null +++ b/emailMarketing/templates/emailMarketing/composeMessages.html @@ -0,0 +1,90 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Compose Email Message - CyberPanel" %}{% endblock %} +{% block content %} + +{% load static %} +{% get_current_language as LANGUAGE_CODE %} + + + + ++ + +{% endblock %} \ No newline at end of file diff --git a/emailMarketing/templates/emailMarketing/createEmailList.html b/emailMarketing/templates/emailMarketing/createEmailList.html new file mode 100644 index 000000000..863afa4fe --- /dev/null +++ b/emailMarketing/templates/emailMarketing/createEmailList.html @@ -0,0 +1,75 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Create Email List - CyberPanel" %}{% endblock %} +{% block content %} + +{% load static %} +{% get_current_language as LANGUAGE_CODE %} + + + +++{% trans "Compose Email Message" %}
+{% trans "On this page you can compose email message to be sent out later." %}
++++++ {% trans "Compose Email Message" %}
++
+ + + + + + + ++++{% endblock %} + diff --git a/emailMarketing/templates/emailMarketing/emailMarketing.html b/emailMarketing/templates/emailMarketing/emailMarketing.html new file mode 100644 index 000000000..0e5d9a677 --- /dev/null +++ b/emailMarketing/templates/emailMarketing/emailMarketing.html @@ -0,0 +1,72 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Email Marketing - CyberPanel" %}{% endblock %} +{% block content %} + +{% load static %} +{% get_current_language as LANGUAGE_CODE %} + + + +++{% trans "Create Email List" %} - {{ domain }}
+{% trans "Create email list, to send out news letters and marketing emails." %}
+++ + ++++ {% trans "Create Email List" %}
++
+ + + + + + + +++ +++ +{% trans "Email Marketing" %}
+{% trans "Select users to Enable/Disable Email Marketing feature!" %}
+++ + + +{% endblock %} \ No newline at end of file diff --git a/emailMarketing/templates/emailMarketing/manageLists.html b/emailMarketing/templates/emailMarketing/manageLists.html new file mode 100644 index 000000000..378649f87 --- /dev/null +++ b/emailMarketing/templates/emailMarketing/manageLists.html @@ -0,0 +1,190 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Manage Email Lists - CyberPanel" %}{% endblock %} +{% block content %} + +{% load static %} +{% get_current_language as LANGUAGE_CODE %} + + + ++ +++ {% trans "Email Marketing" %}
+ + {% if installCheck == 0 %} + ++
++ {% else %} +++{% trans "Email Policy Server is not enabled " %} + +
++ ++ + {% endif %} ++ +
+ ++ + + + +{% trans 'ID' %} +{% trans 'Username' %} +{% trans 'Status' %} ++ + + ++ + + ++ +
+ +
++ + +{% endblock %} \ No newline at end of file diff --git a/emailMarketing/templates/emailMarketing/manageSMTPHosts.html b/emailMarketing/templates/emailMarketing/manageSMTPHosts.html new file mode 100644 index 000000000..c90d4ae04 --- /dev/null +++ b/emailMarketing/templates/emailMarketing/manageSMTPHosts.html @@ -0,0 +1,126 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Manage SMTP Hosts - CyberPanel" %}{% endblock %} +{% block content %} + +{% load static %} +{% get_current_language as LANGUAGE_CODE %} + + + +++{% trans "Manage Email Lists" %} - {{ domain }}
+{% trans "On this page you can manage your email lists (Delete, Verify, Add More Emails)." %}
+++ + ++++ {% trans "Manage Email Lists" %}
++
+ + + + + + + ++++ + +{% endblock %} \ No newline at end of file diff --git a/emailMarketing/templates/emailMarketing/sendEmails.html b/emailMarketing/templates/emailMarketing/sendEmails.html new file mode 100644 index 000000000..67d19cfff --- /dev/null +++ b/emailMarketing/templates/emailMarketing/sendEmails.html @@ -0,0 +1,204 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Send Emails - CyberPanel" %}{% endblock %} +{% block content %} + +{% load static %} +{% get_current_language as LANGUAGE_CODE %} + + + +++{% trans "Manage SMTP Hosts" %}
+{% trans "On this page you can manage STMP Host. (SMTP hosts are used to send emails)" %}
+++ + ++++ {% trans "Manage SMTP Hosts" %}
++
+ + + + + + + ++++ + +{% endblock %} \ No newline at end of file diff --git a/emailMarketing/templates/emailMarketing/website.html b/emailMarketing/templates/emailMarketing/website.html new file mode 100644 index 000000000..46e2938b2 --- /dev/null +++ b/emailMarketing/templates/emailMarketing/website.html @@ -0,0 +1,1097 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{{ domain }} - CyberPanel{% endblock %} +{% block content %} + +{% load static %} +{% get_current_language as LANGUAGE_CODE %} + + +++{% trans "Send Emails" %}
+{% trans "On this page you can send emails to the lists you created using SMTP Hosts." %}
+++ + ++++ {% trans "Send Emails" %}
++
+ + + + + + + +++ ++ + + +{% endblock %} \ No newline at end of file diff --git a/emailMarketing/tests.py b/emailMarketing/tests.py new file mode 100644 index 000000000..5982e6bcd --- /dev/null +++ b/emailMarketing/tests.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.test import TestCase + +# Create your tests here. diff --git a/emailMarketing/urls.py b/emailMarketing/urls.py new file mode 100644 index 000000000..b8bf67151 --- /dev/null +++ b/emailMarketing/urls.py @@ -0,0 +1,26 @@ +from django.conf.urls import url +import views +urlpatterns = [ + url(r'^$', views.emailMarketing, name='emailMarketing'), + url(r'^fetchUsers$', views.fetchUsers, name='fetchUsers'), + url(r'^enableDisableMarketing$', views.enableDisableMarketing, name='enableDisableMarketing'), + url(r'^(?P++ + {% if not error %} + + +{{ domain }} - {% trans "Preview" %}
+{% trans "All functions related to a particular site." %}
++ ++ + ++ +++ {% trans "Resource Usage" %}
+ + ++
++ + ++ ++++ ++ +
++ + + +{% trans "Resource" %} +{% trans "Usage" %} +{% trans "Allowed" %} ++ ++ {% trans "FTP" %}{{ ftpUsed }} +{{ ftpTotal }} ++ + + ++ {% trans "Databases" %}{{ databasesUsed }} +{{ databasesTotal }} ++ ++ {% trans "Disk Usage" %}{{ diskInMB }} (MB) +{{ diskInMBTotal }} (MB) ++ + + + + ++ {% trans "Bandwidth Usage" %}{{ bwInMB }} (MB) +{{ bwInMBTotal }} (MB) +++ +++++++ ++ {% trans "Disk Usage" %} +
+ + + ++ {% trans "Bandwidth Usage" %} +
+ + + + ++ ++ + ++++ {% trans "Logs" %}
+ ++
+++ +++ ++ + ++ + + {% trans "Access Logs" %} + + +
+ ++ + ++ + + {% trans "Error Logs" %} + + +
+ + + + + + + ++ + +++ + ++ +++ {% trans "Domains" %}
+ ++
+ +++ ++ ++ ++ + ++ + + {% trans "Add Domains" %} + + +
+ ++ ++ + + {% trans "List Domains" %} + + +
+ ++ + ++ + + {% trans "Domain Alias" %} + + +
+ ++ + + + + ++ + + {% trans "Cron Jobs" %} + + +
+ ++ + + + + ++ + + ++ + ++ ++ + ++++ {% trans "Configurations" %}
+ + ++
+++ +++ + ++ + ++ + + {% trans "vHost Conf" %} + + +
+ + ++ + ++ + + {% trans "Rewrite Rules" %} + + +
+ + ++ + ++ + + {% trans "Add SSL" %} + + +
+ + ++ + + ++ + + {% trans "Change PHP" %} + + +
+ + + + + + + ++ + + + + + + ++ + + ++ + + ++ + + ++ + + ++ + ++ +++ + {% if marketingStatus %} + ++++ {% trans "Files" %} +
+ ++++ +++ + ++ ++ + + {% trans "File Manager" %} + + +
+ + ++ + ++ + + {% trans "open_basedir" %} + + +
+ + ++ + ++ + + {% trans "Create FTP Acct" %} + + +
+ + ++ + + + ++ + + {% trans "Delete FTP Acct" %} + + +
+ + ++ + + + + +++ + {% endif %} + ++++ {% trans "Email Marketing" %} +
+ ++++ +++ + ++ ++ + + {% trans "Create Lists" %} + + +
+ + ++ ++ + + {% trans "Manage Lists" %} + + +
+ + ++ ++ + + {% trans "SMTP Hosts" %} + + +
+ + ++ ++ + + {% trans "Compose" %} + + +
+ + ++ ++ + + {% trans "Send Emails" %} + + +
+ ++ + {% else %} + ++++ {% trans "Application Installer" %}
+ ++
++ ++ + +++ + ++ + ++ + + {% trans "Wordpress with LSCache" %} + + +
+ + ++ + ++ + + {% trans "Joomla" %} + + +
+ + ++ + + ++ + + {% trans "Git" %} + + +
+ + ++ + ++ + + {% trans "Prestashop" %} + + +
++ + + {% endif %} + + + + +{{ domain }}
+([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=]{1}[\da-z\.-]+)*[\/\?]?)/emailLists$', views.createEmailList, name='createEmailList'), + url(r'^submitEmailList$', views.submitEmailList, name='submitEmailList'), + url(r'^(?P ([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=]{1}[\da-z\.-]+)*[\/\?]?)/manageLists$', views.manageLists, name='manageLists'), + url(r'^(?P ([\da-z\.-]+\.[a-z\.]{2,12}|[\d\.]+)([\/:?=]{1}[\da-z\.-]+)*[\/\?]?)/manageSMTP$', views.manageSMTP, name='manageSMTP'), + url(r'^fetchEmails$', views.fetchEmails, name='fetchEmails'), + url(r'^deleteList$', views.deleteList, name='deleteList'), + url(r'^emailVerificationJob$', views.emailVerificationJob, name='emailVerificationJob'), + url(r'^deleteEmail$', views.deleteEmail, name='deleteEmail'), + url(r'^saveSMTPHost$', views.saveSMTPHost, name='saveSMTPHost'), + url(r'^fetchSMTPHosts$', views.fetchSMTPHosts, name='fetchSMTPHosts'), + url(r'^smtpHostOperations$', views.smtpHostOperations, name='smtpHostOperations'), + url(r'^composeEmailMessage$', views.composeEmailMessage, name='composeEmailMessage'), + url(r'^saveEmailTemplate$', views.saveEmailTemplate, name='saveEmailTemplate'), + url(r'^sendEmails$', views.sendEmails, name='sendEmails'), + url(r'^preview/(?P [-\w]+)/$', views.templatePreview, name='templatePreview'), + url(r'^fetchJobs$', views.fetchJobs, name='fetchJobs'), + url(r'^startEmailJob$', views.startEmailJob, name='startEmailJob'), + url(r'^deleteTemplate$', views.deleteTemplate, name='deleteTemplate'), + url(r'^deleteJob$', views.deleteJob, name='deleteJob'), +] \ No newline at end of file diff --git a/emailMarketing/views.py b/emailMarketing/views.py new file mode 100644 index 000000000..a5ba2efc4 --- /dev/null +++ b/emailMarketing/views.py @@ -0,0 +1,183 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +from django.shortcuts import redirect +from loginSystem.views import loadLoginPage +from emailMarketingManager import EmailMarketingManager +# Create your views here. + + +def emailMarketing(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.emailMarketing() + except KeyError: + return redirect(loadLoginPage) + +def fetchUsers(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.fetchUsers() + except KeyError: + return redirect(loadLoginPage) + +def enableDisableMarketing(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.enableDisableMarketing() + except KeyError: + return redirect(loadLoginPage) + +def createEmailList(request, domain): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request, domain) + return emm.createEmailList() + except KeyError: + return redirect(loadLoginPage) + +def submitEmailList(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.submitEmailList() + except KeyError: + return redirect(loadLoginPage) + +def manageLists(request, domain): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request, domain) + return emm.manageLists() + except KeyError: + return redirect(loadLoginPage) + +def fetchEmails(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.fetchEmails() + except KeyError: + return redirect(loadLoginPage) + +def deleteList(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.deleteList() + except KeyError: + return redirect(loadLoginPage) + +def emailVerificationJob(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.emailVerificationJob() + except KeyError: + return redirect(loadLoginPage) + +def deleteEmail(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.deleteEmail() + except KeyError: + return redirect(loadLoginPage) + +def manageSMTP(request, domain): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request, domain) + return emm.manageSMTP() + except KeyError: + return redirect(loadLoginPage) + +def saveSMTPHost(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.saveSMTPHost() + except KeyError: + return redirect(loadLoginPage) + +def fetchSMTPHosts(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.fetchSMTPHosts() + except KeyError: + return redirect(loadLoginPage) + +def smtpHostOperations(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.smtpHostOperations() + except KeyError: + return redirect(loadLoginPage) + +def composeEmailMessage(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.composeEmailMessage() + except KeyError: + return redirect(loadLoginPage) + +def saveEmailTemplate(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.saveEmailTemplate() + except KeyError: + return redirect(loadLoginPage) + +def sendEmails(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.sendEmails() + except KeyError: + return redirect(loadLoginPage) + +def templatePreview(request, templateName): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request, templateName) + return emm.templatePreview() + except KeyError: + return redirect(loadLoginPage) + +def fetchJobs(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.fetchJobs() + except KeyError: + return redirect(loadLoginPage) + +def startEmailJob(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.startEmailJob() + except KeyError: + return redirect(loadLoginPage) + +def deleteTemplate(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.deleteTemplate() + except KeyError: + return redirect(loadLoginPage) + +def deleteJob(request): + try: + userID = request.session['userID'] + emm = EmailMarketingManager(request) + return emm.deleteJob() + except KeyError: + return redirect(loadLoginPage) \ No newline at end of file diff --git a/install/install.py b/install/install.py index 19f13377c..46fa22abb 100644 --- a/install/install.py +++ b/install/install.py @@ -687,8 +687,8 @@ class preFlightsChecks: count = 0 while (1): - command = "wget http://cyberpanel.net/CyberPanel.1.7.2.tar.gz" - #command = "wget http://cyberpanel.net/CyberPanelTemp.tar.gz" + #command = "wget http://cyberpanel.net/CyberPanel.1.7.2.tar.gz" + command = "wget http://cyberpanel.net/CyberPanelTemp.tar.gz" res = subprocess.call(shlex.split(command)) if res == 1: @@ -707,8 +707,8 @@ class preFlightsChecks: count = 0 while(1): - command = "tar zxf CyberPanel.1.7.2.tar.gz" - #command = "tar zxf CyberPanelTemp.tar.gz" + #command = "tar zxf CyberPanel.1.7.2.tar.gz" + command = "tar zxf CyberPanelTemp.tar.gz" res = subprocess.call(shlex.split(command)) @@ -2582,6 +2582,29 @@ class preFlightsChecks: logging.InstallLog.writeToFile(str(msg) + " [installTLDExtract]") return 0 + def installPYDNS(self): + try: + count = 0 + while (1): + command = "pip install pydns" + + res = subprocess.call(shlex.split(command)) + + if res == 1: + count = count + 1 + preFlightsChecks.stdOut( + "Trying to install pydns, trying again, try number: " + str(count)) + if count == 3: + logging.InstallLog.writeToFile( + "Failed to install pydns! [installTLDExtract]") + else: + logging.InstallLog.writeToFile("pydns successfully installed! [pip]") + preFlightsChecks.stdOut("pydns successfully installed! [pip]") + break + except OSError, msg: + logging.InstallLog.writeToFile(str(msg) + " [installTLDExtract]") + return 0 + def installOpenDKIM(self): try: count = 0 @@ -3003,6 +3026,7 @@ def main(): checks.installCertBot() checks.test_Requests() + checks.installPYDNS() checks.download_install_CyberPanel(installCyberPanel.InstallCyberPanel.mysqlPassword, mysql) checks.setupCLI() checks.setup_cron() diff --git a/plogical/website.py b/plogical/website.py index 198ce662e..1eabfef17 100644 --- a/plogical/website.py +++ b/plogical/website.py @@ -1495,6 +1495,8 @@ class WebsiteManager: lastLine = statusData[-1] if lastLine.find('[200]') > -1: + command = 'sudo rm -f ' + statusFile + subprocess.call(shlex.split(command)) data_ret = {'abort': 1, 'installStatus': 1, 'installationProgress': "100", 'currentStatus': 'Successfully Installed.'} json_data = json.dumps(data_ret) @@ -1507,7 +1509,10 @@ class WebsiteManager: else: progress = lastLine.split(',') currentStatus = progress[0] - installationProgress = progress[1] + try: + installationProgress = progress[1] + except: + installationProgress = 0 data_ret = {'abort': 0, 'installStatus': 0, 'installationProgress': installationProgress, 'currentStatus': currentStatus} json_data = json.dumps(data_ret) diff --git a/requirments.txt b/requirments.txt index cacd75630..cb196634f 100644 --- a/requirments.txt +++ b/requirments.txt @@ -35,6 +35,7 @@ psutil==5.4.3 ptyprocess==0.6.0 pycparser==2.18 pycurl==7.19.0 +pydns==2.3.6 pygpgme==0.3 pyliblzma==0.5.3 pyOpenSSL==17.5.0 diff --git a/websiteFunctions/pluginManager.py b/websiteFunctions/pluginManager.py index 757114926..1659ac516 100644 --- a/websiteFunctions/pluginManager.py +++ b/websiteFunctions/pluginManager.py @@ -51,6 +51,14 @@ class pluginManager: def postWebsiteModification(request, response): return pluginManagerGlobal.globalPlug(request, postWebsiteModification, response) + @staticmethod + def preDomain(request): + return pluginManagerGlobal.globalPlug(request, preDomain) + + @staticmethod + def postDomain(request, response): + return pluginManagerGlobal.globalPlug(request, postDomain, response) + @staticmethod def preSaveConfigsToFile(request): return pluginManagerGlobal.globalPlug(request, preSaveConfigsToFile) diff --git a/websiteFunctions/signals.py b/websiteFunctions/signals.py index edae8427b..3876b7461 100644 --- a/websiteFunctions/signals.py +++ b/websiteFunctions/signals.py @@ -39,6 +39,13 @@ preWebsiteModification = Signal(providing_args=["request"]) ## This event is fired after CyberPanel core finished suspension of website postWebsiteModification = Signal(providing_args=["request", "response"]) + +## This event is fired before CyberPanel core load website launcher +preDomain = Signal(providing_args=["request"]) + +## This event is fired after CyberPanel core finished loading website launcher +postDomain = Signal(providing_args=["request", "response"]) + ## This event is fired before CyberPanel core start saving changes to vhost conf preSaveConfigsToFile = Signal(providing_args=["request"]) diff --git a/websiteFunctions/views.py b/websiteFunctions/views.py index 7d91ac470..265e0d7cd 100644 --- a/websiteFunctions/views.py +++ b/websiteFunctions/views.py @@ -211,9 +211,23 @@ def saveWebsiteChanges(request): def domain(request, domain): try: + if not request.GET._mutable: + request.GET._mutable = True + request.GET['domain'] = domain + + result = pluginManager.preDomain(request) + if result != 200: + return result + userID = request.session['userID'] wm = WebsiteManager(domain) - return wm.loadDomainHome(request, userID) + coreResult = wm.loadDomainHome(request, userID) + + result = pluginManager.postDomain(request, coreResult) + if result != 200: + return result + + return coreResult except KeyError: return redirect(loadLoginPage)