MM-50443 - LdapSettings.SyncEnabled error message (#22314)

* Added ldap disabled message

* Changed style per suggestions

* Remove blank line

Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>

---------

Co-authored-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Этот коммит содержится в:
Colton Shaw
2023-02-13 12:29:06 -05:00
коммит произвёл GitHub
родитель f17b226034
Коммит a0eb22bf8a

Просмотреть файл

@@ -19,12 +19,18 @@ import (
func (a *App) SyncLdap(includeRemovedMembers bool) {
a.Srv().Go(func() {
if license := a.Srv().License(); license != nil && *license.Features.LDAP && *a.Config().LdapSettings.EnableSync {
if ldapI := a.Ldap(); ldapI != nil {
ldapI.StartSynchronizeJob(false, includeRemovedMembers)
} else {
mlog.Error("Not executing ldap sync because ldap is not available")
if license := a.Srv().License(); license != nil && *license.Features.LDAP {
if !*a.Config().LdapSettings.EnableSync {
mlog.Error("LdapSettings.EnableSync is set to false. Skipping LDAP sync.")
return
}
ldapI := a.Ldap()
if ldapI == nil {
mlog.Error("Not executing ldap sync because ldap is not available")
return
}
ldapI.StartSynchronizeJob(false, includeRemovedMembers)
}
})
}