mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
change permissions structure
This commit is contained in:
@@ -53,10 +53,10 @@ def changePermissions(request):
|
||||
website = Websites.objects.get(domain=domainName)
|
||||
externalApp = website.externalApp
|
||||
|
||||
command = "sudo chown -R " + externalApp + ":" + externalApp +" /home/"+domainName
|
||||
command = "chown -R " + externalApp + ":" + externalApp +" /home/"+domainName
|
||||
ProcessUtilities.popenExecutioner(command)
|
||||
|
||||
command = "sudo chown -R lscpd:lscpd /home/" + domainName+"/logs"
|
||||
command = "chown root:nobody /home/" + domainName+"/logs"
|
||||
ProcessUtilities.popenExecutioner(command)
|
||||
|
||||
command = "find %s -type d -exec chmod 0755 {} \;" % ("/home/" + domainName + "/public_html")
|
||||
@@ -65,6 +65,12 @@ def changePermissions(request):
|
||||
command = "find %s -type f -exec chmod 0644 {} \;" % ("/home/" + domainName + "/public_html")
|
||||
ProcessUtilities.popenExecutioner(command)
|
||||
|
||||
command = 'chown %s:nobody /home/%s/public_html' % (externalApp, domainName)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chmod 750 /home/%s/public_html' % (domainName)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
data_ret = {'permissionsChanged': 1, 'error_message': "None"}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
Reference in New Issue
Block a user