Fox user_address detection for sub-directories in user directory
This commit is contained in:
parent
74048ce53f
commit
2ef537ee6c
1 changed files with 8 additions and 2 deletions
|
@ -380,7 +380,13 @@ class ContentManager(object):
|
||||||
# Return: The rules of the file or False if not allowed
|
# Return: The rules of the file or False if not allowed
|
||||||
def getUserContentRules(self, parent_content, inner_path, content):
|
def getUserContentRules(self, parent_content, inner_path, content):
|
||||||
user_contents = parent_content["user_contents"]
|
user_contents = parent_content["user_contents"]
|
||||||
user_address = re.match(".*/([A-Za-z0-9]*?)/.*?$", inner_path).group(1) # Delivered for directory
|
|
||||||
|
# Delivered for directory
|
||||||
|
if "inner_path" in parent_content:
|
||||||
|
parent_content_dir = helper.getDirname(parent_content["inner_path"])
|
||||||
|
user_address = re.match("([A-Za-z0-9]*?)/", inner_path[len(parent_content_dir):]).group(1)
|
||||||
|
else:
|
||||||
|
user_address = re.match(".*/([A-Za-z0-9]*?)/.*?$", inner_path).group(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not content:
|
if not content:
|
||||||
|
|
Loading…
Reference in a new issue