remove more global refs (#7480)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
adab1a660f
Коммит
266ff86702
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user