no share in unauthenticated
This commit is contained in:
@@ -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"
|
||||
})
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user