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