fix
This commit is contained in:
@@ -66,12 +66,12 @@ func (l *Ldap) Search(DN string, scope int, filter string, attr []string, contro
|
||||
}
|
||||
|
||||
// AddUserToGroup 添加用户到组织
|
||||
func (l *Ldap) AddUserToOrganization(groupDN, userDN string) error {
|
||||
func (l *Ldap) AddUserToOrganization(organizationDN, userDN string) error {
|
||||
//判断dn是否以ou开头
|
||||
if groupDN[:3] == "ou=" {
|
||||
/*if organizationDN[:3] == "ou=" {
|
||||
return errors.New("不能添加用户到OU组织单元")
|
||||
}
|
||||
modify := ldap.NewModifyRequest(groupDN, nil)
|
||||
}*/
|
||||
modify := ldap.NewModifyRequest(organizationDN, nil)
|
||||
modify.Add("uniqueMember", []string{userDN})
|
||||
return l.conn.Modify(modify)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user