diff options
Diffstat (limited to 'utils/config.go')
-rw-r--r-- | utils/config.go | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/utils/config.go b/utils/config.go index dff4efd6e..c4ffbc8e0 100644 --- a/utils/config.go +++ b/utils/config.go @@ -373,10 +373,6 @@ func LoadConfig(fileName string) { cfgMutex.Lock() } - if err := ValidateLdapFilter(&config); err != nil { - panic(T(err.Id)) - } - configureLog(&config.LogSettings) if *config.FileSettings.DriverName == model.IMAGE_DRIVER_LOCAL { @@ -392,16 +388,6 @@ func LoadConfig(fileName string) { clientCfgJson, _ := json.Marshal(ClientCfg) ClientCfgHash = fmt.Sprintf("%x", md5.Sum(clientCfgJson)) - // Actions that need to run every time the config is loaded - if ldapI := einterfaces.GetLdapInterface(); ldapI != nil { - // This restarts the job if nessisary (works for config reloads) - ldapI.StartLdapSyncJob() - } - - if samlI := einterfaces.GetSamlInterface(); samlI != nil { - samlI.ConfigureSP() - } - SetDefaultRolesBasedOnConfig() SetSiteURL(*Cfg.ServiceSettings.SiteURL) @@ -597,10 +583,9 @@ func getClientConfig(c *model.Config) map[string]string { return props } -func ValidateLdapFilter(cfg *model.Config) *model.AppError { - ldapInterface := einterfaces.GetLdapInterface() - if *cfg.LdapSettings.Enable && ldapInterface != nil && *cfg.LdapSettings.UserFilter != "" { - if err := ldapInterface.ValidateFilter(*cfg.LdapSettings.UserFilter); err != nil { +func ValidateLdapFilter(cfg *model.Config, ldap einterfaces.LdapInterface) *model.AppError { + if *cfg.LdapSettings.Enable && ldap != nil && *cfg.LdapSettings.UserFilter != "" { + if err := ldap.ValidateFilter(*cfg.LdapSettings.UserFilter); err != nil { return err } } |