diff --git a/plogical/phpUtilities.py b/plogical/phpUtilities.py index 4a0a130d7..ceb06415d 100755 --- a/plogical/phpUtilities.py +++ b/plogical/phpUtilities.py @@ -232,6 +232,16 @@ class phpUtilities: result = result.rsplit("lsphp", 1)[0] + "php" return result + + @staticmethod + def WrapGetPHPVersionFromFileToGetVersionWithPHP(vhFile): + result = phpUtilities.GetPHPVersionFromFile(vhFile) + command = result + " -v | awk '/^PHP/ {print $2}'" + php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n') + return f"PHP {php_version}" + + + @staticmethod def InstallSaidPHP(php): if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20: diff --git a/websiteFunctions/templates/websiteFunctions/listWebsites.html b/websiteFunctions/templates/websiteFunctions/listWebsites.html index d7ec49e5e..de049d08a 100755 --- a/websiteFunctions/templates/websiteFunctions/listWebsites.html +++ b/websiteFunctions/templates/websiteFunctions/listWebsites.html @@ -61,66 +61,48 @@
-
+
-
+
-
+ +
+ + +
-
+
-
+
-
+
- -

{% trans "Cannot list websites. Error message:" %} {$ errorMessage $}

diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index a849be00b..1106bc9fa 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -2411,18 +2411,28 @@ class WebsiteManager: logging.CyberCPLogFileWriter.writeToFile("Failed to read machine IP, error:" + str(msg)) ipAddress = "192.168.100.1" + ### lets first find php path + + from plogical.phpUtilities import phpUtilities + + + for items in websites: if items.state == 0: state = "Suspended" else: state = "Active" + vhFile = f'/usr/local/lsws/conf/vhosts/{items.domain}/vhost.conf' + + PHPVersionActual = phpUtilities.WrapGetPHPVersionFromFileToGetVersionWithPHP(vhFile) + DiskUsage, DiskUsagePercentage, bwInMB, bwUsage = virtualHostUtilities.FindStats(items) diskUsed = "%sMB" % str(DiskUsage) dic = {'domain': items.domain, 'adminEmail': items.adminEmail, 'ipAddress': ipAddress, 'admin': items.admin.userName, 'package': items.package.packageName, 'state': state, - 'diskUsed': diskUsed} + 'diskUsed': diskUsed, 'phpVersion': PHPVersionActual} if checker == 0: json_data = json_data + json.dumps(dic)