1
0
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:
lian
2015-10-09 10:33:29 +08:00
parent e3df7b561e
commit fa95e64d87
2 changed files with 6 additions and 1 deletions

View File

@@ -53,7 +53,7 @@
{% include "snippets/web_settings_form.html" %} {% include "snippets/web_settings_form.html" %}
{% endwith %} {% 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" %} {% include "snippets/web_settings_form.html" %}
{% endwith %} {% endwith %}
</div> </div>

View File

@@ -1690,6 +1690,11 @@ def sys_settings(request):
else: else:
result['error'] = _(u'Invalid value') result['error'] = _(u'Invalid value')
return HttpResponse(json.dumps(result), status=400, content_type=content_type) 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: else:
if key not in STRING_WEB_SETTINGS: if key not in STRING_WEB_SETTINGS:
result['error'] = _(u'Invalid value') result['error'] = _(u'Invalid value')