mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 11:20:18 +08:00
Add UserPrincipalName and MemberOf to get-ldap-users API
This commit is contained in:
@ -41,6 +41,7 @@ type LdapUser struct {
|
|||||||
GidNumber string `json:"gidNumber"`
|
GidNumber string `json:"gidNumber"`
|
||||||
// Gcn string
|
// Gcn string
|
||||||
Uuid string `json:"uuid"`
|
Uuid string `json:"uuid"`
|
||||||
|
UserPrincipalName string `json:"userPrincipalName"`
|
||||||
DisplayName string `json:"displayName"`
|
DisplayName string `json:"displayName"`
|
||||||
Mail string
|
Mail string
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
@ -51,9 +52,10 @@ type LdapUser struct {
|
|||||||
RegisteredAddress string
|
RegisteredAddress string
|
||||||
PostalAddress string
|
PostalAddress string
|
||||||
|
|
||||||
GroupId string `json:"groupId"`
|
GroupId string `json:"groupId"`
|
||||||
Phone string `json:"phone"`
|
Phone string `json:"phone"`
|
||||||
Address string `json:"address"`
|
Address string `json:"address"`
|
||||||
|
MemberOf string `json:"memberOf"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ldap *Ldap) GetLdapConn() (c *LdapConn, err error) {
|
func (ldap *Ldap) GetLdapConn() (c *LdapConn, err error) {
|
||||||
@ -168,6 +170,8 @@ func (l *LdapConn) GetLdapUsers(ldapServer *Ldap) ([]LdapUser, error) {
|
|||||||
user.Uuid = attribute.Values[0]
|
user.Uuid = attribute.Values[0]
|
||||||
case "objectGUID":
|
case "objectGUID":
|
||||||
user.Uuid = attribute.Values[0]
|
user.Uuid = attribute.Values[0]
|
||||||
|
case "userPrincipalName":
|
||||||
|
user.UserPrincipalName = attribute.Values[0]
|
||||||
case "displayName":
|
case "displayName":
|
||||||
user.DisplayName = attribute.Values[0]
|
user.DisplayName = attribute.Values[0]
|
||||||
case "mail":
|
case "mail":
|
||||||
@ -186,6 +190,8 @@ func (l *LdapConn) GetLdapUsers(ldapServer *Ldap) ([]LdapUser, error) {
|
|||||||
user.RegisteredAddress = attribute.Values[0]
|
user.RegisteredAddress = attribute.Values[0]
|
||||||
case "postalAddress":
|
case "postalAddress":
|
||||||
user.PostalAddress = attribute.Values[0]
|
user.PostalAddress = attribute.Values[0]
|
||||||
|
case "memberOf":
|
||||||
|
user.MemberOf = attribute.Values[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ldapUsers = append(ldapUsers, user)
|
ldapUsers = append(ldapUsers, user)
|
||||||
|
Reference in New Issue
Block a user