Issue adding LDAP Entry - Could not add entry LDAP_NAMING_VIOLATION
[email protected] (Agus)
| Newsgroups | php.pear.general |
|---|---|
| Message-ID | <CAK_ux-Uii94nwcD_qCvFeppz+1diyjKWZu78kOUPDK-yzeAJbQ@mail.gmail.com> |
This is what i did. FIrst I got different error so i added attribute
objectClass: person which gave me this error.
this is the code. the ldap object was created earlier:
$addEntry = new LdapManage();
$addEntry->setDn('cn=Test,dc=corp,dc=test,dc=com');
$attribs = array(
'objectClass' =>'person',
'cn' =>'Test',
'mail' =>[email protected]',
);
$addEntry->setAttribs($attribs);
$entry = $addEntry->createEntry();
//lets add entry
$return = $ldap->add($entry);
if(PEAR::isError($return)){
die('Cant add entry: '.$return->getMessage());
}
i get the LDAP_errors mentioned. Seems like it isn't as simple as the
example in the manual. Any hint would be appreciated.
Thanks