summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-21 04:13:34 -0500
committerGeorge Goldberg <george@gberg.me>2017-09-21 10:13:34 +0100
commit266ff8670244da288aec937320d9eecc7996af35 (patch)
tree39e4e528cda0abb24be317683516ee246717fc68 /utils
parentadab1a660fdc0c307238279edc7a9918d14577e5 (diff)
downloadchat-266ff8670244da288aec937320d9eecc7996af35.tar.gz
chat-266ff8670244da288aec937320d9eecc7996af35.tar.bz2
chat-266ff8670244da288aec937320d9eecc7996af35.zip
remove more global refs (#7480)
Diffstat (limited to 'utils')
-rw-r--r--utils/config.go21
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
}
}