try adding address commonly
This commit is contained in:
16
code/app.py
16
code/app.py
@@ -107,8 +107,7 @@ def upload(name = None, password = None):
|
|||||||
"recipient": get_or_none(share,'recipient'),
|
"recipient": get_or_none(share,'recipient'),
|
||||||
"share": name,
|
"share": name,
|
||||||
"filename": filename,
|
"filename": filename,
|
||||||
"operation": "upload",
|
"operation": "upload"
|
||||||
"address": request.remote_addr
|
|
||||||
})
|
})
|
||||||
if 'from_gui' in request.form:
|
if 'from_gui' in request.form:
|
||||||
if request.form['from_gui'] == "true":
|
if request.form['from_gui'] == "true":
|
||||||
@@ -190,8 +189,7 @@ def download_direct(name,password,filename):
|
|||||||
"recipient": get_or_none(share,'recipient'),
|
"recipient": get_or_none(share,'recipient'),
|
||||||
"share": name,
|
"share": name,
|
||||||
"filename": file_path,
|
"filename": file_path,
|
||||||
"operation": "direct_download",
|
"operation": "direct_download"
|
||||||
"address": request.remote_addr
|
|
||||||
})
|
})
|
||||||
return send_from_directory(directory=share['path'], filename=filename)
|
return send_from_directory(directory=share['path'], filename=filename)
|
||||||
|
|
||||||
@@ -211,8 +209,7 @@ def download_file(name,filename,password = None):
|
|||||||
"recipient": get_or_none(share,'recipient'),
|
"recipient": get_or_none(share,'recipient'),
|
||||||
"share": name,
|
"share": name,
|
||||||
"filename": file_path,
|
"filename": file_path,
|
||||||
"operation": "download",
|
"operation": "download"
|
||||||
"address": request.remote_addr
|
|
||||||
})
|
})
|
||||||
return send_from_directory(directory=share['path'], filename=filename)
|
return send_from_directory(directory=share['path'], filename=filename)
|
||||||
|
|
||||||
@@ -234,8 +231,7 @@ def download_zip(name,password = None):
|
|||||||
"recipient": get_or_none(share,'recipient'),
|
"recipient": get_or_none(share,'recipient'),
|
||||||
"share": name,
|
"share": name,
|
||||||
"filename": name + ".zip",
|
"filename": name + ".zip",
|
||||||
"operation": "zip_download",
|
"operation": "zip_download"
|
||||||
"address": request.remote_addr
|
|
||||||
})
|
})
|
||||||
return send_file(
|
return send_file(
|
||||||
zip_path,
|
zip_path,
|
||||||
@@ -382,6 +378,10 @@ def makedirs_rights(path):
|
|||||||
|
|
||||||
def notify(msg):
|
def notify(msg):
|
||||||
if 'notifier' in app.config:
|
if 'notifier' in app.config:
|
||||||
|
msg['address'] = "%s:%s"%(
|
||||||
|
request.remote_addr,
|
||||||
|
request.environ['REMOTE_ADDR']
|
||||||
|
)
|
||||||
app.config['notifier'].notify(msg)
|
app.config['notifier'].notify(msg)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user