random password generator

This commit is contained in:
usmannasir
2019-03-12 14:47:58 +05:00
parent 6f2d6d8673
commit 29b6d4d3b4
16 changed files with 446 additions and 225 deletions

View File

@@ -24,6 +24,10 @@ class FileManager:
def changeOwner(self, path):
domainName = self.data['domainName']
website = Websites.objects.get(domain=domainName)
if path.find('..') > -1:
return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!')
command = "sudo chown -R " + website.externalApp + ':' + website.externalApp + ' ' + self.returnPathEnclosed(path)
ProcessUtilities.executioner(command)
@@ -99,6 +103,9 @@ class FileManager:
finalData = {}
finalData['status'] = 1
if self.data['fileName'].find('..') > -1:
return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!')
command = "sudo touch " + self.returnPathEnclosed(self.data['fileName'])
ProcessUtilities.executioner(command)
@@ -195,6 +202,9 @@ class FileManager:
finalData = {}
finalData['status'] = 1
if self.data['newFileName'].find('..') > -1:
return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!')
command = 'sudo mv ' + self.returnPathEnclosed(self.data['basePath'] + '/' + self.data['existingName']) + ' ' + self.returnPathEnclosed(self.data['basePath'] + '/' + self.data['newFileName'])
ProcessUtilities.executioner(command)