From 2b23c04f491731f4a140f4df8fa0631640a5a756 Mon Sep 17 00:00:00 2001 From: Yaodong Yu <2814461814@qq.com> Date: Mon, 21 Aug 2023 22:52:35 +0800 Subject: [PATCH] fix: add SignupApplication and type for user synced from LDAP (#2240) --- object/ldap_conn.go | 26 ++++++++++++++------------ object/user.go | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/object/ldap_conn.go b/object/ldap_conn.go index 3af908d0..01f049f0 100644 --- a/object/ldap_conn.go +++ b/object/ldap_conn.go @@ -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) diff --git a/object/user.go b/object/user.go index 6ebda178..56008b55 100644 --- a/object/user.go +++ b/object/user.go @@ -536,7 +536,7 @@ func UpdateUser(id string, user *User, columns []string, isAdmin bool) (bool, er "auth0", "battlenet", "bitbucket", "box", "cloudfoundry", "dailymotion", "deezer", "digitalocean", "discord", "dropbox", "eveonline", "fitbit", "gitea", "heroku", "influxcloud", "instagram", "intercom", "kakao", "lastfm", "mailru", "meetup", "microsoftonline", "naver", "nextcloud", "onedrive", "oura", "patreon", "paypal", "salesforce", "shopify", "soundcloud", - "spotify", "strava", "stripe", "tiktok", "tumblr", "twitch", "twitter", "typetalk", "uber", "vk", "wepay", "xero", "yahoo", + "spotify", "strava", "stripe", "type", "tiktok", "tumblr", "twitch", "twitter", "typetalk", "uber", "vk", "wepay", "xero", "yahoo", "yammer", "yandex", "zoom", "custom", } }