fix
This commit is contained in:
parent
0fee793931
commit
41e446e3a5
|
@ -54,7 +54,7 @@ func (l *Ldap) Search(DN, filter string, attr []string, controls []ldap.Control)
|
||||||
return l.conn.Search(searchRequest)
|
return l.conn.Search(searchRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddUserToGroup 添加用户到分组(暂时不用这种方式除非组里面objectClass设置了groupOfNames)
|
// AddUserToGroup 添加用户到分组
|
||||||
func (l *Ldap) AddUserToGroup(groupDN, userDN string) error {
|
func (l *Ldap) AddUserToGroup(groupDN, userDN string) error {
|
||||||
//判断dn是否以ou开头
|
//判断dn是否以ou开头
|
||||||
if groupDN[:3] == "ou=" {
|
if groupDN[:3] == "ou=" {
|
||||||
|
@ -65,7 +65,7 @@ func (l *Ldap) AddUserToGroup(groupDN, userDN string) error {
|
||||||
return l.conn.Modify(modify)
|
return l.conn.Modify(modify)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DelUserFromGroup 将用户从分组删除(暂时不用这种方式除非组里面objectClass设置了groupOfNames)
|
// DelUserFromGroup 将用户从分组删除
|
||||||
func (l *Ldap) RemoveUserFromGroup(groupDN, userDN string) error {
|
func (l *Ldap) RemoveUserFromGroup(groupDN, userDN string) error {
|
||||||
modify := ldap.NewModifyRequest(groupDN, nil)
|
modify := ldap.NewModifyRequest(groupDN, nil)
|
||||||
modify.Delete("uniqueMember", []string{userDN})
|
modify.Delete("uniqueMember", []string{userDN})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user