mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
bug fix: wp scanner
This commit is contained in:
@@ -1364,22 +1364,32 @@ class WebsiteManager:
|
|||||||
childdomain = ChildDomains.objects.all()
|
childdomain = ChildDomains.objects.all()
|
||||||
|
|
||||||
for web in allweb:
|
for web in allweb:
|
||||||
webpath = "/home/%s/public_html" % web.domain
|
webpath = "/home/%s/public_html/" % web.domain
|
||||||
command = "cat %s/wp-config.php" % webpath
|
command = "cat %swp-config.php" % webpath
|
||||||
result, stdout = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
|
result, stdout = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
|
||||||
|
|
||||||
if result == 1:
|
if result == 1:
|
||||||
|
try:
|
||||||
|
WPSites.objects.get(path=webpath)
|
||||||
|
except:
|
||||||
wpobj = WPSites(owner=web, title=web.domain, path=webpath, FinalURL=web.domain,
|
wpobj = WPSites(owner=web, title=web.domain, path=webpath, FinalURL=web.domain,
|
||||||
AutoUpdates="Enabled", PluginUpdates="Enabled",
|
AutoUpdates="Enabled", PluginUpdates="Enabled",
|
||||||
ThemeUpdates="Enabled", )
|
ThemeUpdates="Enabled", )
|
||||||
wpobj.save()
|
wpobj.save()
|
||||||
|
|
||||||
for chlid in childdomain:
|
for chlid in childdomain:
|
||||||
command = "cat %s/wp-config.php"%chlid.path
|
childPath = chlid.path.rstrip('/')
|
||||||
|
|
||||||
|
command = "cat %s/wp-config.php"% childPath
|
||||||
result, stdout = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
|
result, stdout = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
|
||||||
|
|
||||||
if result == 1:
|
if result == 1:
|
||||||
wpobj = WPSites(owner=chlid.master, title=chlid.domain, path=chlid.path, FinalURL=chlid.domain,
|
fChildPath = f'{childPath}/'
|
||||||
|
try:
|
||||||
|
WPSites.objects.get(path=fChildPath)
|
||||||
|
except:
|
||||||
|
|
||||||
|
wpobj = WPSites(owner=chlid.master, title=chlid.domain, path=fChildPath, FinalURL=chlid.domain,
|
||||||
AutoUpdates="Enabled", PluginUpdates="Enabled",
|
AutoUpdates="Enabled", PluginUpdates="Enabled",
|
||||||
ThemeUpdates="Enabled", )
|
ThemeUpdates="Enabled", )
|
||||||
wpobj.save()
|
wpobj.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user