no share in unauthenticated

This commit is contained in:
ville rantanen
2018-07-01 16:54:50 +03:00
parent 42ad2da90a
commit f11486bde0
2 changed files with 2 additions and 8 deletions

View File

@@ -97,7 +97,6 @@ def upload(name = None, token = None):
(ok,share) = get_share(name, token = token)
if not ok:
notify({
"recipient": get_or_none('recipient', share),
"share": name,
"operation": "unauthorized_upload"
})
@@ -137,7 +136,6 @@ def upload_join_splitted(name, token):
(ok,share) = get_share(name, token = token)
if not ok:
notify({
"recipient": get_or_none('recipient', share),
"share": name,
"operation": "unauthorized_split_upload"
})
@@ -193,7 +191,6 @@ def upload_url():
(ok,share) = get_share(name)
if not ok:
notify({
"recipient": get_or_none('recipient', share),
"share": name,
"operation": "unauthorized_URL_upload"
})
@@ -278,7 +275,6 @@ def list_view(name, token = None):
(ok,share) = get_share(name, token = token)
if not ok:
notify({
"recipient": get_or_none('recipient', share),
"share": name,
"operation": "unauthorized_list"
})
@@ -381,7 +377,6 @@ def download_zip(name, token = None):
(ok,share) = get_share(name, token = token)
if not ok:
notify({
"recipient": get_or_none('recipient', share),
"share": name,
"operation": "unauthorized_zip_download"
})
@@ -409,7 +404,6 @@ def script_client(name = None, token = None):
(ok,share) = get_share(name, token = token)
if not ok:
notify({
"recipient": get_or_none('recipient', share),
"share": name,
"operation": "unauthorized_script_client"
})
@@ -602,7 +596,6 @@ def download_file(name, filename, token = None):
(ok,share) = get_share(name, token = token)
if not ok:
notify({
"recipient": get_or_none('recipient', share),
"share": name,
"operation": "unauthorized_download"
})

View File

@@ -7,7 +7,8 @@ class Notifier:
pass
def notify(self, msg):
self.output = open('/code/data/notifier.log','at')
msg['address'] = msg['environment']['HTTP_X_FORWARDED_FOR']
if 'HTTP_X_FORWARDED_FOR' in msg['environment']:
msg['address'] = msg['environment']['HTTP_X_FORWARDED_FOR']
msg['date'] = datetime.now().isoformat()
del msg['environment']
self.output.write(json.dumps(msg, sort_keys = True)+"\n")