mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 10:58:33 +00:00
update USER_PASSWORD_STRENGTH_LEVEL setting
This commit is contained in:
@@ -53,7 +53,7 @@
|
||||
{% include "snippets/web_settings_form.html" %}
|
||||
{% endwith %}
|
||||
|
||||
{% with type="input" setting_display_name="password strength level" help_tip="The level of an account password's strength." setting_name="USER_PASSWORD_STRENGTH_LEVEL" setting_val=config_dict.USER_PASSWORD_STRENGTH_LEVEL %}
|
||||
{% with type="input" setting_display_name="password strength level" help_tip="The level(1-4) of an account password's strength. For example, '3' means password must have at least 3 of the following: num, upper letter, lower letter and other symbols" setting_name="USER_PASSWORD_STRENGTH_LEVEL" setting_val=config_dict.USER_PASSWORD_STRENGTH_LEVEL %}
|
||||
{% include "snippets/web_settings_form.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
@@ -1690,6 +1690,11 @@ def sys_settings(request):
|
||||
else:
|
||||
result['error'] = _(u'Invalid value')
|
||||
return HttpResponse(json.dumps(result), status=400, content_type=content_type)
|
||||
|
||||
if key == 'USER_PASSWORD_STRENGTH_LEVEL' and value not in (1,2,3,4):
|
||||
result['error'] = _(u'Invalid value')
|
||||
return HttpResponse(json.dumps(result), status=400, content_type=content_type)
|
||||
|
||||
else:
|
||||
if key not in STRING_WEB_SETTINGS:
|
||||
result['error'] = _(u'Invalid value')
|
||||
|
Reference in New Issue
Block a user