summaryrefslogtreecommitdiffstats
path: root/model/config.go
diff options
context:
space:
mode:
authorMartin Kraft <martinkraft@gmail.com>2018-05-11 08:05:23 -0400
committerMartin Kraft <martinkraft@gmail.com>2018-05-11 08:05:23 -0400
commit91557bbd978500388a11b99401783164e143a966 (patch)
tree676d6278d957df20f21d5e367d1f447ee281414e /model/config.go
parent11c60ea41afd419036edc54b5571f26ce680c93c (diff)
parent2b27e12445ba51e1fa1ab2aceac5fcb3de66845d (diff)
downloadchat-91557bbd978500388a11b99401783164e143a966.tar.gz
chat-91557bbd978500388a11b99401783164e143a966.tar.bz2
chat-91557bbd978500388a11b99401783164e143a966.zip
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2
Diffstat (limited to 'model/config.go')
-rw-r--r--model/config.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index 5074b7637..07cd9d977 100644
--- a/model/config.go
+++ b/model/config.go
@@ -1144,6 +1144,7 @@ type LdapSettings struct {
NicknameAttribute *string
IdAttribute *string
PositionAttribute *string
+ LoginIdAttribute *string
// Synchronization
SyncIntervalMinutes *int
@@ -1227,6 +1228,12 @@ func (s *LdapSettings) SetDefaults() {
s.PositionAttribute = NewString(LDAP_SETTINGS_DEFAULT_POSITION_ATTRIBUTE)
}
+ // For those upgrading to the version when LoginIdAttribute was added
+ // they need IdAttribute == LoginIdAttribute not to break
+ if s.LoginIdAttribute == nil {
+ s.LoginIdAttribute = s.IdAttribute
+ }
+
if s.SyncIntervalMinutes == nil {
s.SyncIntervalMinutes = NewInt(60)
}
@@ -2074,6 +2081,10 @@ func (ls *LdapSettings) isValid() *AppError {
if *ls.IdAttribute == "" {
return NewAppError("Config.IsValid", "model.config.is_valid.ldap_id", nil, "", http.StatusBadRequest)
}
+
+ if *ls.LoginIdAttribute == "" {
+ return NewAppError("Config.IsValid", "model.config.is_valid.ldap_login_id", nil, "", http.StatusBadRequest)
+ }
}
return nil