feat: add LDAP custom filter support (#1719)

* refactor: improve ldap server code

* feat: custom filter

* fix: fix displayName mapping

* feat: add custom filter search fields

* chore: add license

* chore: i18n

* chore: i18n

* chore: update init field
This commit is contained in:
Yaodong Yu
2023-04-13 14:12:31 +08:00
committed by GitHub
parent 968d8646b2
commit 1b1de1dd01
33 changed files with 826 additions and 625 deletions

View File

@ -82,7 +82,7 @@ func (l *LdapAutoSynchronizer) syncRoutine(ldap *Ldap, stopChan chan struct{}) {
continue
}
users, err := conn.GetLdapUsers(ldap.BaseDn)
users, err := conn.GetLdapUsers(ldap)
if err != nil {
logs.Warning(fmt.Sprintf("autoSync failed for %s, error %s", ldap.Id, err))
continue
@ -112,3 +112,10 @@ func (l *LdapAutoSynchronizer) LdapAutoSynchronizerStartUpAll() {
}
}
}
func UpdateLdapSyncTime(ldapId string) {
_, err := adapter.Engine.ID(ldapId).Update(&Ldap{LastSync: util.GetCurrentTime()})
if err != nil {
panic(err)
}
}