FEATURE: Hidden site setting for max username length
This commit is contained in:
parent
d3810ba3bc
commit
b0ed9082b3
|
@ -18,7 +18,7 @@
|
|||
<div class="control-group">
|
||||
<label class="control-label">{{i18n user.username.title}}</label>
|
||||
<div class="controls">
|
||||
{{textField value=newUsername id="change_username" classNames="input-xxlarge" maxlength="15"}}
|
||||
{{textField value=newUsername id="change_username" classNames="input-xxlarge" maxlengthBinding="Discourse.SiteSettings.max_username_length"}}
|
||||
</div>
|
||||
<div class='instructions'>
|
||||
{{#if taken}}
|
||||
|
|
|
@ -102,7 +102,7 @@ class User < ActiveRecord::Base
|
|||
if SiteSetting.enforce_global_nicknames
|
||||
GLOBAL_USERNAME_LENGTH_RANGE
|
||||
else
|
||||
SiteSetting.min_username_length.to_i..GLOBAL_USERNAME_LENGTH_RANGE.end
|
||||
SiteSetting.min_username_length.to_i..SiteSetting.max_username_length.to_i
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -103,6 +103,10 @@ users:
|
|||
min_username_length:
|
||||
client: true
|
||||
default: 3
|
||||
max_username_length:
|
||||
client: true
|
||||
default: 15
|
||||
hidden: true
|
||||
min_password_length:
|
||||
client: true
|
||||
default: 8
|
||||
|
|
Loading…
Reference in New Issue