mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-29 01:06:16 -05:00
Make receive_allow_receiver_shutdown setting work
This commit is contained in:
parent
7e11687731
commit
996df24646
@ -266,7 +266,8 @@ class Web(object):
|
|||||||
|
|
||||||
r = make_response(render_template(
|
r = make_response(render_template(
|
||||||
'receive.html',
|
'receive.html',
|
||||||
slug=self.slug))
|
slug=self.slug,
|
||||||
|
receive_allow_receiver_shutdown=self.common.settings.get('receive_allow_receiver_shutdown')))
|
||||||
return self.add_security_headers(r)
|
return self.add_security_headers(r)
|
||||||
|
|
||||||
@self.app.route("/<slug_candidate>/upload", methods=['POST'])
|
@self.app.route("/<slug_candidate>/upload", methods=['POST'])
|
||||||
@ -326,9 +327,13 @@ class Web(object):
|
|||||||
@self.app.route("/<slug_candidate>/close", methods=['POST'])
|
@self.app.route("/<slug_candidate>/close", methods=['POST'])
|
||||||
def close(slug_candidate):
|
def close(slug_candidate):
|
||||||
self.check_slug_candidate(slug_candidate)
|
self.check_slug_candidate(slug_candidate)
|
||||||
self.force_shutdown()
|
|
||||||
r = make_response(render_template('closed.html'))
|
if self.common.settings.get('receive_allow_receiver_shutdown'):
|
||||||
return self.add_security_headers(r)
|
self.force_shutdown()
|
||||||
|
r = make_response(render_template('closed.html'))
|
||||||
|
return self.add_security_headers(r)
|
||||||
|
else:
|
||||||
|
return redirect('/{}'.format(slug_candidate))
|
||||||
|
|
||||||
def common_routes(self):
|
def common_routes(self):
|
||||||
"""
|
"""
|
||||||
|
@ -34,10 +34,10 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if receive_allow_receiver_shutdown %}
|
||||||
<form method="post" action="/{{ slug }}/close">
|
<form method="post" action="/{{ slug }}/close">
|
||||||
<input type="submit" class="close-button" value="I'm Finished Uploading" />
|
<input type="submit" class="close-button" value="I'm Finished Uploading" />
|
||||||
</form>
|
</form>
|
||||||
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user