--On Montag, 2. August 2004 10:56 +0200 Ulrich Windl <[EMAIL PROTECTED]> wrote:

Graham,

sorry for contacting you directly, but I have a documentation problem with
Net::LDAP:

I wrote a CGI script to edit LDAP directory entries. The script works
fine for
modifying attributes (add/modify/delete), but it fails for modifying
entries. When
I try to add a new entry using the $entry->update($ldap) method, I get
the error
"newrdn: attribute type undefined".

For reasons of uniqueness, I try to batch all changes into an
Net::LDAP::Entry
object, but I'm unsure how to do it correctly. I set up the entry like
this:

            $entry = Net::LDAP::Entry->new();
                 $entry->changetype('add');
                 $entry->dn($dn1);

$entry->add('newrdn' => $dn2);

Here you're adding the "newrdn" attribute with a value of "cn=Joe Test". But your schema does not include such an attribute type. Hence the "newrdn: attribute type undefined" error.



$dn1 would be "dc=people,dc=klinik,dc=uni-regensburg,dc=de" while $dn2 would be

If you want to create an entry with a DN of "cn=Joe Test,dc=people,dc=klinik,dc=uni-regensburg,dc=de" then use
$entry->dn("cn=Joe Test,dc=people,dc=klinik,dc=uni-regensburg,dc=de").


Norbert

Reply via email to