---------------------------- Original Message ----------------------------
Subject: Do not understand Net::LDAP::Entry
From:    "Liebeskind Uri (liu)" <[EMAIL PROTECTED]>
Date:    Fri, February 25, 2005 10:29 am
To:      [EMAIL PROTECTED]
--------------------------------------------------------------------------

Hello Graham,

I do not understand Net::LDAP::Entry.

Assuming that a ldap connection is set up:
$ldap = Net::LDAP->new($dc) or die "Connection failed!", $@;
$rc = $ldap->bind( $ldapAdmin, password => $pwd);
die $rc->error if $rc->code;

I read the example code of Net::LDAP::Entry but I do not understand  what
it does.

01.  use Net::LDAP::Entry;
02.  $entry = Net::LDAP::Entry->new;
03.  $entry->add (
04.     attr1 => 'value1',
05.     attr2 => [ qw(value1 value2) ]
06.   );
07.
08.  $entry->update ( $ldap ); # update directory server

As far as I understand the code:
02: create new ldap-entry object
03: populate object data structure with 2 attributes.
08: but here: what will be updated on the directory server?
    There is no DN specified? It looks like "nirwana code".

How can $entry be directly bound to a user object like
$dn = "CN=x99,OU=Test,OU=OrgUsers,OU=DepartementX,DC=zhwin,DC=ch"; 
without using $ldap->search?

I just want to use: $entry->add(), $entry->change(),
$entry->get_value(), etc.


Thank you very much for your advice.

Kind regards,
Uri Liebeskind



------------------------------------------------------------------------
Uri Liebeskind                             Zürcher Hochschule Winterthur
System Administrator                                  Technikumstrasse 9
Dipl. El. Ing. HTL                                          Postfach 805
[EMAIL PROTECTED]                   CH-8401 Winterthur/Switzerland
Phone +41 52 267 72 63                            Phone +41 52 267 71 71
Content Security by MailMarshal




Reply via email to