summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-07-14 08:18:56 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-07-14 08:18:56 -0400
commit6abc9601bec18e5005ff16dd4147bf038dafb264 (patch)
treec7e6c8611365e84ddf237e6ec661b35a50011f23 /model
parent294981d4a3a36d48c983a3a92cf423910347b4c4 (diff)
downloadchat-6abc9601bec18e5005ff16dd4147bf038dafb264.tar.gz
chat-6abc9601bec18e5005ff16dd4147bf038dafb264.tar.bz2
chat-6abc9601bec18e5005ff16dd4147bf038dafb264.zip
PLT-3192 EE: Restricted site name to 30 characters (#3560)
* Restricted site name to 30 characters * Added maxlength to TextSetting
Diffstat (limited to 'model')
-rw-r--r--model/config.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index 8e9320008..64396b65e 100644
--- a/model/config.go
+++ b/model/config.go
@@ -44,6 +44,8 @@ const (
RESTRICT_EMOJI_CREATION_ALL = "all"
RESTRICT_EMOJI_CREATION_ADMIN = "admin"
RESTRICT_EMOJI_CREATION_SYSTEM_ADMIN = "system_admin"
+
+ SITENAME_MAX_LENGTH = 30
)
type ServiceSettings struct {
@@ -960,6 +962,10 @@ func (o *Config) IsValid() *AppError {
return NewLocAppError("Config.IsValid", "model.config.is_valid.password_length.app_error", map[string]interface{}{"MinLength": PASSWORD_MINIMUM_LENGTH, "MaxLength": PASSWORD_MAXIMUM_LENGTH}, "")
}
+ if len(o.TeamSettings.SiteName) > SITENAME_MAX_LENGTH {
+ return NewLocAppError("Config.IsValid", "model.config.is_valid.sitename_length.app_error", map[string]interface{}{"MaxLength": SITENAME_MAX_LENGTH}, "")
+ }
+
return nil
}