diff options
author | George Goldberg <george@gberg.me> | 2016-12-14 11:11:51 +0000 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-12-14 08:11:51 -0300 |
commit | 8406e854aa912f3d7f9179b10356444f07e25223 (patch) | |
tree | 353294a5ae87cf0c0cf3e675f32073fff1988d16 /model/config.go | |
parent | 973585450378a457a94824b7852c7ab7194e2b3e (diff) | |
download | chat-8406e854aa912f3d7f9179b10356444f07e25223.tar.gz chat-8406e854aa912f3d7f9179b10356444f07e25223.tar.bz2 chat-8406e854aa912f3d7f9179b10356444f07e25223.zip |
PLT-4332 Position field for Users (#4632)
* Add User.Position field to store & model.
* GOFMT
* Add Position to user settings.
* Unit tests.
* Add position to profile popup.
* i18n
* Fix log message for invalid position.
* Add Position field attribute to LDAP config.
* Add Position field attribute to SAML config.
* Reword empty position message.
* Change Position Max Length to 35.
* Better invalid position error message.
* Add new fields to config.json.
* Ensure position is never longer than max when displayed.
* Hard limit of 64 chars with soft limit still 35
* Put field with other attributes.
Diffstat (limited to 'model/config.go')
-rw-r--r-- | model/config.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go index 7d3cb93d6..0a3fcb33e 100644 --- a/model/config.go +++ b/model/config.go @@ -251,6 +251,7 @@ type LdapSettings struct { UsernameAttribute *string NicknameAttribute *string IdAttribute *string + PositionAttribute *string // Syncronization SyncIntervalMinutes *int @@ -297,6 +298,7 @@ type SamlSettings struct { UsernameAttribute *string NicknameAttribute *string LocaleAttribute *string + PositionAttribute *string LoginButtonText *string } @@ -690,6 +692,11 @@ func (o *Config) SetDefaults() { *o.LdapSettings.IdAttribute = "" } + if o.LdapSettings.PositionAttribute == nil { + o.LdapSettings.PositionAttribute = new(string) + *o.LdapSettings.PositionAttribute = "" + } + if o.LdapSettings.SyncIntervalMinutes == nil { o.LdapSettings.SyncIntervalMinutes = new(int) *o.LdapSettings.SyncIntervalMinutes = 60 @@ -911,6 +918,11 @@ func (o *Config) SetDefaults() { *o.SamlSettings.NicknameAttribute = "" } + if o.SamlSettings.PositionAttribute == nil { + o.SamlSettings.PositionAttribute = new(string) + *o.SamlSettings.PositionAttribute = "" + } + if o.SamlSettings.LocaleAttribute == nil { o.SamlSettings.LocaleAttribute = new(string) *o.SamlSettings.LocaleAttribute = "" |