简体   繁体   English

在没有ldap_mod_add()的情况下将用户添加到LDAP组

[英]Adding users to an LDAP group without ldap_mod_add()

The PHP function ldap_mod_add() is great for adding users to a group, like this: PHP函数ldap_mod_add()非常适合将用户添加到组中,如下所示:

$group_name = "CN=MyGroup,OU=Groups,DC=example,DC=com";
$group_info['member'] = $dn; // User's DN is added to group's 'member' array
ldap_mod_add($connect,$group_name,$group_info);

but this triggers a change at the attribute level as opposed to the object level, so it isn't detected and replicated to my mirror LDAP server. 但这会触发属性级别(而不是对象级别)的更改,因此不会检测到该更改并将其复制到我的镜像LDAP服务器。

Is there, in PHP, any way to make this same operation using a object level function like ldap_modify()? 在PHP中,是否有使用ldap_modify()之类的对象级函数进行相同操作的任何方法?

Note: When I add it through Apache Directory Studio, it triggers the mirror operation. 注意:当我通过Apache Directory Studio添加它时,它将触发镜像操作。

You can use ldap_modify but you will need to provide the complete entry as third parameter. 您可以使用ldap_modify但需要提供完整的条目作为第三个参数。

I will need to check why ldap_mod_add does not trigger synchronisation in your setup. 我将需要检查为什么ldap_mod_add不会在您的设置中触发同步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM