From de86423d0b9ff465e702069ff5ce8c99c7bb618b Mon Sep 17 00:00:00 2001 From: usmannasir Date: Fri, 4 Apr 2025 17:57:49 +0500 Subject: [PATCH] fix vhuser in function --- websiteFunctions/website.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index 0f68926ca..dd7fe2c6f 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -7067,18 +7067,27 @@ StrictHostKeyChecking no wp_sites = WPSites.objects.filter(owner=website) sites = [] + + Vhuser = website.externalApp + PHPVersion = website.phpSelection - command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp core version --skip-plugins --skip-themes --path=%s 2>/dev/null' % ( - Vhuser, FinalPHPPath, path) + php = ACLManager.getPHPString(PHPVersion) + FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) for site in wp_sites: + + command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp core version --skip-plugins --skip-themes --path=%s 2>/dev/null' % ( + Vhuser, FinalPHPPath, site.path) + version = ProcessUtilities.outputExecutioner(command, None, True) + version = html.escape(version) + + sites.append({ 'id': site.id, 'title': site.title, 'url': site.FinalURL, 'path': site.path, - 'version': site.version, - 'status': site.status + 'version': version, }) data_ret = {'status': 1, 'fetchStatus': 1, 'error_message': "None", "sites": sites}