From bf496020b2ea2c9fae6a3ba73fa2fe4c3c586783 Mon Sep 17 00:00:00 2001 From: usmannasir <01-134132-158@student.bahria.edu.pk> Date: Fri, 9 Mar 2018 18:47:03 +0500 Subject: [PATCH] Bug fix to domain creation. --- install/install.py | 1 - install/install.xml | 15 +++++++++++++++ .../templates/websiteFunctions/website.html | 13 +++++++------ websiteFunctions/views.py | 6 ++++-- 4 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 install/install.xml diff --git a/install/install.py b/install/install.py index d7768eddb..81d39e403 100644 --- a/install/install.py +++ b/install/install.py @@ -43,7 +43,6 @@ class preFlightsChecks: logging.InstallLog.writeToFile("SELinux is enabled, please disable SELinux and restart the installation!") preFlightsChecks.stdOut("Installation failed, consult: /var/log/installLogs.txt") sys.exit() - return 0 except BaseException,msg: logging.InstallLog.writeToFile(str(msg) + "[checkIfSeLinuxDisabled]") diff --git a/install/install.xml b/install/install.xml new file mode 100644 index 000000000..954494dc1 --- /dev/null +++ b/install/install.xml @@ -0,0 +1,15 @@ + + + + yum install sudo -y + apt-get install sudo -y + + + adduser cyberpanel + adduser --disabled-password --gecos "" cyberpanel + + + usermod -aG wheel cyberpanel + usermod -aG sudo cyberpanel + + \ No newline at end of file diff --git a/websiteFunctions/templates/websiteFunctions/website.html b/websiteFunctions/templates/websiteFunctions/website.html index 0e7f562f6..2901e7517 100644 --- a/websiteFunctions/templates/websiteFunctions/website.html +++ b/websiteFunctions/templates/websiteFunctions/website.html @@ -251,10 +251,11 @@

- {% trans "Domains" %} -

+ {% trans "Domains" %} +
+
@@ -294,11 +295,10 @@ - +
-
@@ -383,7 +383,8 @@
- + +
@@ -478,7 +479,7 @@
-
+
diff --git a/websiteFunctions/views.py b/websiteFunctions/views.py index 3e9cd3a88..0772dd93b 100644 --- a/websiteFunctions/views.py +++ b/websiteFunctions/views.py @@ -412,9 +412,11 @@ def submitDomainCreation(request): ####### Limitations check master = Websites.objects.get(domain=masterDomain) + domainsInPackage = master.package.allowedDomains - - if master.package.allowedDomains > master.childdomains_set.all().count(): + if domainsInPackage == 0: + pass + elif domainsInPackage > master.childdomains_set.all().count(): pass else: data_ret = {"existsStatus": 0, 'createWebSiteStatus': 0,