mirror of
https://github.com/haiwen/seahub.git
synced 2025-04-28 03:10:45 +00:00
Merge pull request #4908 from haiwen/share-link-dl
fix bug when visit password protected direct download share link
This commit is contained in:
commit
2175c1234b
@ -5,9 +5,17 @@
|
||||
<div class="mt-9 mb-4 mx-auto small-panel">
|
||||
<p class="intro">{% trans "Please input the password if you want to browse the shared file/directory." %}</p>
|
||||
{% if path %}
|
||||
{% if direct_download %}
|
||||
<form action="{% url view_name token %}?p={{ path }}&dl=1" method="post" id="share-passwd-form">
|
||||
{% else %}
|
||||
<form action="{% url view_name token %}?p={{ path }}" method="post" id="share-passwd-form">
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if direct_download %}
|
||||
<form action="{% url view_name token %}?dl=1" method="post" id="share-passwd-form">
|
||||
{% else %}
|
||||
<form action="{% url view_name token %}" method="post" id="share-passwd-form">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="token" value="{{ token }}" />
|
||||
|
@ -1109,8 +1109,10 @@ def view_shared_file(request, fileshare):
|
||||
|
||||
# check if share link is encrypted
|
||||
password_check_passed, err_msg = check_share_link_common(request, fileshare)
|
||||
direct_download = request.GET.get('dl', '') == '1'
|
||||
if not password_check_passed:
|
||||
d = {'token': token, 'view_name': 'view_shared_file', 'err_msg': err_msg}
|
||||
d = {'token': token, 'view_name': 'view_shared_file',
|
||||
'err_msg': err_msg, 'direct_download': direct_download}
|
||||
return render(request, 'share_access_validation.html', d)
|
||||
|
||||
# recourse check
|
||||
|
Loading…
Reference in New Issue
Block a user