fix
This commit is contained in:
parent
41e446e3a5
commit
d362c1d496
|
@ -16,5 +16,6 @@ type Config struct {
|
|||
BindDN string
|
||||
Password string
|
||||
BaseDN string
|
||||
RootDN string
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,10 @@ func (l *GetDepartmentsLogic) GetDepartments(req *types.Request, userinfo *auth.
|
|||
sortNum := 0
|
||||
//每个DN存入map
|
||||
for _, v := range searchResult.Entries {
|
||||
//如果是root用户则跳过
|
||||
if v.DN == l.svcCtx.Config.Ldap.RootDN {
|
||||
continue
|
||||
}
|
||||
sortNum++
|
||||
attribute := make(map[string]interface{})
|
||||
for _, attr := range v.Attributes {
|
||||
|
@ -68,6 +72,8 @@ func (l *GetDepartmentsLogic) GetDepartments(req *types.Request, userinfo *auth.
|
|||
mapObjectClass[objectClassItem] = struct{}{}
|
||||
}
|
||||
attribute[attr.Name] = mapObjectClass
|
||||
case "member": //成员不用变
|
||||
attribute[attr.Name] = attr.Values
|
||||
default: //普通属性
|
||||
attribute[attr.Name] = strings.Join(attr.Values, ",")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user