繁体   English   中英

是否可以使用活动目录使inetOrgPerson成为ldap php中posixGroup的成员

[英]Is it possible to make a inetOrgPerson a member of a posixGroup in ldap php using active directory

是否有可能使inetOrgPerson成为posixgroup的成员,而不是在cn内添加手动条目,即时通讯使用php和ldap,但我似乎遇到了这一点:

 Modify: Object class violation

码:

 $ldap = ldap_connect("localhost") or die("Unable to connect to server.");
 ldap_set_option($ldap,LDAP_OPT_PROTOCOL_VERSION,3);
 $dn = "cn=admin,dc=*******,dc=com";

 ldap_bind($ldap,$dn,"*****") or die("Unable to connect to server..");
 $dn = "cn=********,cn=*********,cn=*********,ou=A*******,dc=********,dc=com";

      $entry["cn"] = "MerPaul";
      $entry["objectClass"] = "inetOrgPerson";

      ldap_mod_add($ldap,$dn,$entry);

我究竟做错了什么?

LDAP中的objectClass具有可选和必填字段。 inetOrgPerson也不例外。

inetOrgPerson的必填字段是sncn

  $entry["cn"] = "MerPaul";
  $entry["sn"] = "Joe"
  $entry["objectClass"] = "inetOrgPerson";

  ldap_mod_add($ldap,$dn,$entry);

暂无
暂无

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

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