diff --git a/firewall/firewallManager.py b/firewall/firewallManager.py index 1313a4a26..90dbc481d 100755 --- a/firewall/firewallManager.py +++ b/firewall/firewallManager.py @@ -1552,6 +1552,14 @@ class FirewallManager: else: return ACLManager.loadError() - return render(self.request, 'firewall/imunify.html', {}) + ipFile = "/etc/cyberpanel/machineIP" + f = open(ipFile) + ipData = f.read() + ipAddress = ipData.split('\n', 1)[0] + + data = {} + data['ipAddress'] = ipAddress + + return render(self.request, 'firewall/imunify.html', data) except BaseException as msg: return HttpResponse(str(msg)) diff --git a/firewall/templates/firewall/imunify.html b/firewall/templates/firewall/imunify.html index b1316daeb..ba187e9c5 100755 --- a/firewall/templates/firewall/imunify.html +++ b/firewall/templates/firewall/imunify.html @@ -1,6 +1,6 @@ {% extends "baseTemplate/index.html" %} {% load i18n %} -{% block title %}{% trans "CloudLinux - CyberPanel" %}{% endblock %} +{% block title %}{% trans "Imunify - CyberPanel" %}{% endblock %} {% block content %} {% load static %} @@ -10,20 +10,20 @@
-

{% trans "CloudLinux" %}

-

{% trans "Access LVEManager" %}

+

{% trans "Imunify" %}

+

{% trans "Access Imunify" %}

- {% trans "CloudLinux" %} + {% trans "Imunify" %}

-

{% trans "CloudLinux is now integrated via their new API. You can manage CageFS and Package limits directly from LVEManager by clicking below. You can use your server root credentials to access LVEManager." %}

+

{% trans "Imunify is now integrated via their new API. You can manage Imunify by clicking below. You can use your server root credentials to access Imunify." %}


- + diff --git a/firewall/templates/firewall/notAvailable.html b/firewall/templates/firewall/notAvailable.html new file mode 100755 index 000000000..1519e6feb --- /dev/null +++ b/firewall/templates/firewall/notAvailable.html @@ -0,0 +1,67 @@ +{% extends "baseTemplate/index.html" %} +{% load i18n %} +{% block title %}{% trans "Not available - CyberPanel" %}{% endblock %} +{% block content %} + + {% load static %} + {% get_current_language as LANGUAGE_CODE %} + + + +
+
+

{% trans "Not available" %}

+

{% trans "Either Imunify is not installed or you are not on CloudLinux OS." %}

+
+ + {% if not CL %} + +
+
+
+

{% trans "CloudLinux is not installed on your server." %} Click + Here {% trans " for conversion details." %}

+
+
+
+ + {% else %} + +
+
+

+ {% trans "Activate Now" %} +

+
+ +

{% trans "CloudLinux is installed, but not activated." %}

+ + +
+ +
+
+
+ +
+
+
+
+ + + +
+ + +
+
+
+ + {% endif %} + +
+{% endblock %} + diff --git a/plogical/upgrade.py b/plogical/upgrade.py index c925a0878..c59747afe 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -597,6 +597,11 @@ class Upgrade: except: pass + try: + cursor.execute("ALTER TABLE websiteFunctions_websites MODIFY externalApp varchar(30)") + except: + pass + try: cursor.execute("ALTER TABLE loginSystem_acl ADD COLUMN listUsers INT DEFAULT 0;") diff --git a/websiteFunctions/models.py b/websiteFunctions/models.py index 5858d842a..630ad542a 100755 --- a/websiteFunctions/models.py +++ b/websiteFunctions/models.py @@ -16,7 +16,7 @@ class Websites(models.Model): phpSelection = models.CharField(max_length=10) ssl = models.IntegerField() state = models.IntegerField(default=1) - externalApp = models.CharField(max_length=10, default=None) + externalApp = models.CharField(max_length=30, default=None) class ChildDomains(models.Model): master = models.ForeignKey(Websites,on_delete=models.CASCADE) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index e58e8e158..edf5f9105 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -173,14 +173,13 @@ class WebsiteManager: loggedUser = Administrator.objects.get(pk=userID) newOwner = Administrator.objects.get(userName=websiteOwner) + if ACLManager.currentContextPermission(currentACL, 'createWebsite') == 0: return ACLManager.loadErrorJson('createWebSiteStatus', 0) if ACLManager.checkOwnerProtection(currentACL, loggedUser, newOwner) == 0: return ACLManager.loadErrorJson('createWebSiteStatus', 0) - - if not validators.domain(domain): data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."} json_data = json.dumps(data_ret) @@ -223,6 +222,7 @@ class WebsiteManager: import pwd counter = 0 + while 1: try: pwd.getpwnam(externalApp) @@ -233,7 +233,7 @@ class WebsiteManager: ## Create Configurations - execPath = "sudo /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py" + execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py" execPath = execPath + " createVirtualHost --virtualHostName " + domain + \ " --administratorEmail " + adminEmail + " --phpVersion '" + phpSelection + \ "' --virtualHostUser " + externalApp + " --ssl " + str(data['ssl']) + " --dkimCheck " \