mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
suspend child domains along with master website
This commit is contained in:
@@ -86,6 +86,8 @@ class Administrator(models.Model):
|
|||||||
token = models.CharField(max_length=500, default='None')
|
token = models.CharField(max_length=500, default='None')
|
||||||
api = models.IntegerField(default=0)
|
api = models.IntegerField(default=0)
|
||||||
securityLevel = models.IntegerField(default=0)
|
securityLevel = models.IntegerField(default=0)
|
||||||
|
state = models.CharField(max_length=10, default='ACTIVE')
|
||||||
|
|
||||||
|
|
||||||
initWebsitesLimit = models.IntegerField(default=0)
|
initWebsitesLimit = models.IntegerField(default=0)
|
||||||
acl = models.ForeignKey(ACL, default=1, on_delete=models.PROTECT)
|
acl = models.ForeignKey(ACL, default=1, on_delete=models.PROTECT)
|
||||||
|
|||||||
@@ -553,14 +553,32 @@ class WebsiteManager:
|
|||||||
|
|
||||||
if state == "Suspend":
|
if state == "Suspend":
|
||||||
confPath = virtualHostUtilities.Server_root + "/conf/vhosts/" + websiteName
|
confPath = virtualHostUtilities.Server_root + "/conf/vhosts/" + websiteName
|
||||||
command = "sudo mv " + confPath + " " + confPath + "-suspended"
|
command = "mv " + confPath + " " + confPath + "-suspended"
|
||||||
ProcessUtilities.popenExecutioner(command)
|
ProcessUtilities.popenExecutioner(command)
|
||||||
|
|
||||||
|
childDomains = website.childdomains_set.all()
|
||||||
|
|
||||||
|
for items in childDomains:
|
||||||
|
confPath = virtualHostUtilities.Server_root + "/conf/vhosts/" + items.domain
|
||||||
|
command = "mv " + confPath + " " + confPath + "-suspended"
|
||||||
|
|
||||||
installUtilities.reStartLiteSpeedSocket()
|
installUtilities.reStartLiteSpeedSocket()
|
||||||
website.state = 0
|
website.state = 0
|
||||||
else:
|
else:
|
||||||
confPath = virtualHostUtilities.Server_root + "/conf/vhosts/" + websiteName
|
confPath = virtualHostUtilities.Server_root + "/conf/vhosts/" + websiteName
|
||||||
|
|
||||||
command = "sudo mv " + confPath + "-suspended" + " " + confPath
|
command = "mv " + confPath + "-suspended" + " " + confPath
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
|
command = "chown -R " + "lsadm" + ":" + "lsadm" + " " + confPath
|
||||||
|
ProcessUtilities.popenExecutioner(command)
|
||||||
|
|
||||||
|
childDomains = website.childdomains_set.all()
|
||||||
|
|
||||||
|
for items in childDomains:
|
||||||
|
confPath = virtualHostUtilities.Server_root + "/conf/vhosts/" + items.domain
|
||||||
|
|
||||||
|
command = "mv " + confPath + "-suspended" + " " + confPath
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = "chown -R " + "lsadm" + ":" + "lsadm" + " " + confPath
|
command = "chown -R " + "lsadm" + ":" + "lsadm" + " " + confPath
|
||||||
|
|||||||
Reference in New Issue
Block a user