diff options
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 08b00b90f..7e810be02 100644 --- a/model/config.go +++ b/model/config.go @@ -190,6 +190,9 @@ type LdapSettings struct { NicknameAttribute *string IdAttribute *string + // Syncronization + SyncIntervalMinutes *int + // Advanced SkipCertificateVerification *bool QueryTimeout *int @@ -441,6 +444,11 @@ func (o *Config) SetDefaults() { *o.LdapSettings.LoginFieldName = "" } + if o.LdapSettings.SyncIntervalMinutes == nil { + o.LdapSettings.SyncIntervalMinutes = new(int) + *o.LdapSettings.SyncIntervalMinutes = 60 + } + if o.ServiceSettings.SessionLengthWebInDays == nil { o.ServiceSettings.SessionLengthWebInDays = new(int) *o.ServiceSettings.SessionLengthWebInDays = 30 @@ -635,6 +643,10 @@ func (o *Config) IsValid() *AppError { return NewLocAppError("Config.IsValid", "model.config.is_valid.ldap_security.app_error", nil, "") } + if *o.LdapSettings.SyncIntervalMinutes <= 0 { + return NewLocAppError("Config.IsValid", "model.config.is_valid.ldap_sync_interval.app_error", nil, "") + } + return nil } |