fix: fix incorrect LDAP sync status (#1859)

This commit is contained in:
Yaodong Yu
2023-05-18 22:03:53 +08:00
committed by GitHub
parent 2eefeaffa7
commit 6455734807
5 changed files with 38 additions and 39 deletions

View File

@ -86,7 +86,10 @@ func (c *ApiController) GetLdapUsers() {
Phone: util.GetMaxLenStr(user.TelephoneNumber, user.Mobile, user.MobileTelephoneNumber),
Address: util.GetMaxLenStr(user.RegisteredAddress, user.PostalAddress),
})
uuids = append(uuids, user.Uuid)
if user.Uuid != "" {
uuids = append(uuids, user.Uuid)
}
}
existUuids := object.GetExistUuids(ldapServer.Owner, uuids)
@ -215,10 +218,10 @@ func (c *ApiController) SyncLdapUsers() {
object.UpdateLdapSyncTime(ldapId)
exist, failed := object.SyncLdapUsers(owner, users, ldapId)
exist, failed, _ := object.SyncLdapUsers(owner, users, ldapId)
c.ResponseOk(&LdapSyncResp{
Exist: *exist,
Failed: *failed,
Exist: exist,
Failed: failed,
})
}