Re: Issue adding LDAP Entry - Could not add entry LDAP_NAMING_VIOLATION

[email protected] (Agus)
Newsgroups php.pear.general
Message-ID <CAK_ux-VySGVDhK-MoEf+3Or1uA_fK98WAHhKe1FtKeePUzXvxg@mail.gmail.com>
Did it. The key was to put objectClass, user.


2013/4/14 Agus <[email protected]>

> 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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.