mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 20:08:26 +00:00
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">
|
<div class="control-group">
|
||||||
<label class="control-label">{{i18n user.username.title}}</label>
|
<label class="control-label">{{i18n user.username.title}}</label>
|
||||||
<div class="controls">
|
<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>
|
||||||
<div class='instructions'>
|
<div class='instructions'>
|
||||||
{{#if taken}}
|
{{#if taken}}
|
||||||
|
@ -102,7 +102,7 @@ class User < ActiveRecord::Base
|
|||||||
if SiteSetting.enforce_global_nicknames
|
if SiteSetting.enforce_global_nicknames
|
||||||
GLOBAL_USERNAME_LENGTH_RANGE
|
GLOBAL_USERNAME_LENGTH_RANGE
|
||||||
else
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -103,6 +103,10 @@ users:
|
|||||||
min_username_length:
|
min_username_length:
|
||||||
client: true
|
client: true
|
||||||
default: 3
|
default: 3
|
||||||
|
max_username_length:
|
||||||
|
client: true
|
||||||
|
default: 15
|
||||||
|
hidden: true
|
||||||
min_password_length:
|
min_password_length:
|
||||||
client: true
|
client: true
|
||||||
default: 8
|
default: 8
|
||||||
|
Loading…
x
Reference in New Issue
Block a user