Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

同步用户到ldap时候,将用户添加到部门内uniqueMember参数不支持 #368

Open
iyongfei opened this issue Oct 10, 2024 · 2 comments
Labels
Inactive question Further information is requested

Comments

@iyongfei
Copy link

Question Report

LDAP Result Code 65 "Object Class Violation": attribute 'uniqueMember' not allowed

/ AddUserToGroup 添加用户到分组
func (x GroupService) AddUserToGroup(dn, udn string) error {
//判断dn是否以ou开头
if dn[:3] == "ou=" {
return errors.New("不能添加用户到OU组织单元")
}
newmr := ldap.NewModifyRequest(dn, nil)
newmr.Add("uniqueMember", []string{udn})

// 获取 LDAP 连接
conn, err := common.GetLDAPConn()
defer common.PutLADPConn(conn)
if err != nil {
return err
}

return conn.Modify(newmr)
}

请在提交问题之前回答这些问题,谢谢。 | Please answer these questions before submitting them. Thank you.

你使用了哪个版本? | Which version did you use?

项目推荐的版本,
OPENLDAP="1.5.0"
PHPLDAPADMIN="0.9.0"

预期行为 | Expected behavior

实际行为 | Actual behavior

原因分析(如果可以) | Cause analysis (if possible)

问题重现步骤 | Steps to reproduce the problem

@iyongfei iyongfei added the question Further information is requested label Oct 10, 2024
@eryajf
Copy link
Member

eryajf commented Oct 10, 2024

您好 @iyongfei👋,我已收到您的反馈,我将安排时间考虑您提交的信息并进行回复。-- 这条信息是由自动回复的机器人发出的。

Hello @iyongfei. I have received your feedback, and I will arrange time to consider the information you submitted and reply. -- This message is sent by an automatic reply robot.

@eryajf
Copy link
Member

eryajf commented Oct 10, 2024

可以看下这个报错的部门dn,属性是ou还是cn的,如果是cn则不应该出现这个错误。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Inactive question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants