security fix: CP-10: Admin Websites Suspend / Unsuspend

This commit is contained in:
Usman Nasir
2021-08-02 11:55:43 +05:00
parent bc67e56224
commit c0a8aee7d7

View File

@@ -574,6 +574,12 @@ class WebsiteManager:
website = Websites.objects.get(domain=websiteName) website = Websites.objects.get(domain=websiteName)
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(websiteName, admin, currentACL) == 1:
pass
else:
return ACLManager.loadErrorJson('websiteStatus', 0)
if state == "Suspend": if state == "Suspend":
confPath = virtualHostUtilities.Server_root + "/conf/vhosts/" + websiteName confPath = virtualHostUtilities.Server_root + "/conf/vhosts/" + websiteName
command = "mv " + confPath + " " + confPath + "-suspended" command = "mv " + confPath + " " + confPath + "-suspended"