Skip to content

Commit

Permalink
path check: listForTable
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jan 17, 2020
1 parent e66282e commit 970ee42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion filemanager/filemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def listForTable(self):
domainName = self.data['domainName']
website = Websites.objects.get(domain=domainName)

if not self.data['completeStartingPath'].find(self.data['home']) > -1:
pathCheck = '/home/%s' % (domainName)

if self.data['completeStartingPath'].find(pathCheck) == -1:
return self.ajaxPre(0, 'Not allowed to browse this path, going back home!')

command = "ls -la --group-directories-first " + self.returnPathEnclosed(
Expand Down

0 comments on commit 970ee42

Please sign in to comment.