1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-01 23:38:37 +00:00

add SHARE_LINK_EXPIRE_DAYS_DEFAULT setting

This commit is contained in:
lian 2018-11-21 17:51:48 +08:00 committed by llj
parent ec7aa914ee
commit d585c29a7f
3 changed files with 7 additions and 2 deletions

View File

@ -320,6 +320,10 @@ SHARE_LINK_LOGIN_REQUIRED = False
SHARE_LINK_EXPIRE_DAYS_MIN = 0 # 0 means no limit
SHARE_LINK_EXPIRE_DAYS_MAX = 0 # 0 means no limit
# default expire days should be
# greater than or equal to MIN and less than or equal to MAX
SHARE_LINK_EXPIRE_DAYS_DEFAULT = 0
# mininum length for the password of a share link
SHARE_LINK_PASSWORD_MIN_LENGTH = 8

View File

@ -1205,7 +1205,7 @@
<input type="checkbox" checked="checked" disabled="disabled" name="set_expiration" class="vam" />
<span class="checkbox-option vam">{% trans "Add auto expiration"%}</span>
<div class="link-option-content inline-block vam">
<input type="text" name="expire_days" class="input short-input" id="expire-days" />
<input type="text" name="expire_days" value="{{ share_link_expire_days_default }}" class="input short-input" id="expire-days" />
<span>{% trans "days" %}</span>
<span>
{% if share_link_expire_days_min > 0 and share_link_expire_days_max > 0 %}

View File

@ -55,7 +55,7 @@ import seahub.settings as settings
from seahub.settings import AVATAR_FILE_STORAGE, \
ENABLE_SUB_LIBRARY, ENABLE_FOLDER_PERM, ENABLE_REPO_SNAPSHOT_LABEL, \
UNREAD_NOTIFICATIONS_REQUEST_INTERVAL, SHARE_LINK_EXPIRE_DAYS_MIN, \
SHARE_LINK_EXPIRE_DAYS_MAX
SHARE_LINK_EXPIRE_DAYS_MAX, SHARE_LINK_EXPIRE_DAYS_DEFAULT
from seahub.wopi.settings import ENABLE_OFFICE_WEB_APP
from seahub.onlyoffice.settings import ENABLE_ONLYOFFICE
@ -736,6 +736,7 @@ def libraries(request):
'enable_file_comment': settings.ENABLE_FILE_COMMENT,
'share_link_expire_days_min': SHARE_LINK_EXPIRE_DAYS_MIN,
'share_link_expire_days_max': SHARE_LINK_EXPIRE_DAYS_MAX,
'share_link_expire_days_default': SHARE_LINK_EXPIRE_DAYS_DEFAULT,
'enable_office_web_app': ENABLE_OFFICE_WEB_APP,
'enable_onlyoffice': ENABLE_ONLYOFFICE,
'trash_repos_expire_days': expire_days if expire_days > 0 else 30,