From 5aee24ae593cdbbf5b1ccea5ad3f9c8898d5a7b1 Mon Sep 17 00:00:00 2001 From: "usman@cyberpersons.com" Date: Mon, 1 May 2023 12:56:31 +0500 Subject: [PATCH] bug fix: in scanwp function --- websiteFunctions/website.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index d0ea215b2..d389425f9 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -1410,6 +1410,7 @@ class WebsiteManager: currentACL = ACLManager.loadedACL(userID) admin = Administrator.objects.get(pk=userID) + allweb = Websites.objects.all() childdomain = ChildDomains.objects.all() @@ -1417,9 +1418,13 @@ class WebsiteManager: for web in allweb: webpath = "/home/%s/public_html/" % web.domain command = "cat %swp-config.php" % webpath - result, stdout = ProcessUtilities.outputExecutioner(command, None, None, None, 1) + result = ProcessUtilities.outputExecutioner(command, web.externalApp) - if result == 1: + if os.path.exists(ProcessUtilities.debugPath): + logging.CyberCPLogFileWriter.writeToFile(result) + + + if result.find('No such file or directory') == -1: try: WPSites.objects.get(path=webpath) except: @@ -1432,9 +1437,12 @@ class WebsiteManager: childPath = chlid.path.rstrip('/') command = "cat %s/wp-config.php" % childPath - result, stdout = ProcessUtilities.outputExecutioner(command, None, None, None, 1) + result = ProcessUtilities.outputExecutioner(command, chlid.master.externalApp) - if result == 1: + if os.path.exists(ProcessUtilities.debugPath): + logging.CyberCPLogFileWriter.writeToFile(result) + + if result.find('No such file or directory') == -1: fChildPath = f'{childPath}/' try: WPSites.objects.get(path=fChildPath)