我正在尝试在 PHP 中从 naturalPerson 模式添加出生日期属性,但我收到错误消息:21, invalid syntax.
我做错了什么?
$addToGroup['objectclass'][2] = "inetOrgPerson";
$addToGroup['objectclass'][3] = "naturalPerson";
$addToGroup['dateofbirth'] = "2020-01-01";
提前致谢。
根据评论中的反馈进行编辑:
Warning: ldap_add(): Add: Undefined attribute
Line: 54
完整代码:
$addToGroup['cn'] = $email;
$addToGroup['givenname'] = $first_name;
$addToGroup['sn'] = $last_name;
$addToGroup['street'] = $street_name;
$addToGroup['postalCode'] = $postal_code;
$addToGroup['telephonenumber'] = $phone;
$addToGroup['userpassword'] = $password_hash;
$addToGroup['birthdate'] = "20200101";
$addToGroup['objectclass'][0] = "top";
$addToGroup['objectclass'][1] = "person";
$addToGroup['objectclass'][2] = "inetOrgPerson";
$addToGroup['objectclass'][3]= "naturalPerson";
// Add user to selected group
$addToGroupQuery = "cn=$email,dc=ritsemabank,dc=local";
LINE 54: $add = ldap_add($ldapconn, "cn=$email,cn=klanten,dc=ritsemabank,dc=local", $addToGroup);
添加这两行代码后出现错误:
$addToGroup['objectclass'][2] = "inetOrgPerson";
$addToGroup['objectclass'][3] = "naturalPerson";
$addToGroup['dateofbirth'] = "2020-01-01";
我正在尝试使用此链接:https : //ldapwiki.com/wiki/Date%20Of%20Birth 将 dateofbirth 属性添加到我要创建的用户。
我希望这段代码提供了解决我的问题所需的信息。