fix: add SignupApplication and type for user synced from LDAP (#2240)

This commit is contained in:
Yaodong Yu
2023-08-21 22:52:35 +08:00
committed by GitHub
parent e60ee52d91
commit 2b23c04f49
2 changed files with 15 additions and 13 deletions

View File

@ -311,18 +311,20 @@ func SyncLdapUsers(owner string, syncUsers []LdapUser, ldapId string) (existUser
}
newUser := &User{
Owner: owner,
Name: name,
CreatedTime: util.GetCurrentTime(),
DisplayName: syncUser.buildLdapDisplayName(),
Avatar: organization.DefaultAvatar,
Email: syncUser.Email,
Phone: syncUser.Mobile,
Address: []string{syncUser.Address},
Affiliation: affiliation,
Tag: tag,
Score: score,
Ldap: syncUser.Uuid,
Owner: owner,
Name: name,
CreatedTime: util.GetCurrentTime(),
DisplayName: syncUser.buildLdapDisplayName(),
SignupApplication: organization.DefaultApplication,
Type: "normal-user",
Avatar: organization.DefaultAvatar,
Email: syncUser.Email,
Phone: syncUser.Mobile,
Address: []string{syncUser.Address},
Affiliation: affiliation,
Tag: tag,
Score: score,
Ldap: syncUser.Uuid,
}
affected, err := AddUser(newUser)