allow for custom min_username_length

change constant in user to be global range and not default
This commit is contained in:
Stephen Birarda
2014-02-28 10:54:21 -08:00
parent b4688fc4c5
commit 4a2dab9c5e
4 changed files with 43 additions and 4 deletions

View File

@ -93,9 +93,15 @@ class User < ActiveRecord::Base
ALWAYS = -1
LAST_VISIT = -2
end
GLOBAL_USERNAME_LENGTH_RANGE = 3..15
def self.username_length
3..15
if SiteSetting.enforce_global_nicknames
GLOBAL_USERNAME_LENGTH_RANGE
else
SiteSetting.min_username_length.to_i..GLOBAL_USERNAME_LENGTH_RANGE.end
end
end
def custom_groups