From a7af525b85aa322ca2b5996bc106e2a6eed2b1ae Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 4 Apr 2021 14:16:59 +0500 Subject: [PATCH] bug fix: full path for add user --- plogical/ClusterManager.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/plogical/ClusterManager.py b/plogical/ClusterManager.py index c8e82652c..ca19a5ebf 100644 --- a/plogical/ClusterManager.py +++ b/plogical/ClusterManager.py @@ -273,7 +273,6 @@ password=%s""" % (rootdbpassword, rootdbpassword) self.PostStatus('Domain %s successfully created.' % (website.domain)) - for childDomain in ChildDomains.objects.all(): confPath = '%s/%s' % (ClusterManager.vhostConfPath, childDomain.domain) if not os.path.exists(confPath): @@ -281,6 +280,24 @@ password=%s""" % (rootdbpassword, rootdbpassword) virtualHostUtilities.createDomain(childDomain.master.domain, childDomain.domain, childDomain.phpSelection, childDomain.path, 1, 1, 0, childDomain.master.admin.userName, 0, 0) self.PostStatus('Child Domain %s successfully created.' % (childDomain.domain)) + ## Cleanup of deleted domains + + from plogical.acl import ACLManager + currentACL = ACLManager.loadedACL(1) + allSite = ACLManager.findAllSites(currentACL, 1) + + for website in os.listdir('/home'): + if website not in allSite: + self.PostStatus('Domain %s not found in Master, deleting data directories and configurations.' % (website)) + + command = 'rm -rf /home/%s' % (website) + ProcessUtilities.normalExecutioner(command) + + command = 'rm -rf /%s/%s' % (ClusterManager.vhostConfPath, website) + ProcessUtilities.normalExecutioner(command) + + + self.PostStatus('All domains synced.') except BaseException as msg: