[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-ldap-dev
Subject:    Re: trying to add a mailing list to the directory
From:       70.85.16.38
Date:       2005-08-24 2:55:54
Message-ID: 8f9da899c6575a41059caf9be18a9c6e$1 () www ! ldaps ! com
[Download RAW message or body]

Chris Ridd wrote:

> On 17/1/05 12:31 pm, ronan <r.mcglue@qub.ac.uk> wrote:

>> LDAP::NET LDAP::NETapi
>> 
>> the directory is using NETapi
>> 
>> can someone point me to a documet(s) where the differences betwween thsse
>> two modules are hightlighted
>> 
>> specifically in the writing of an entry to the directory...
>> 
>> I have created the entry and am attempting to write using NET::LDAP but
>> keep getting an error
>> 
>> failed to add entry: Object class violation at ./e2.pl line 87
>> 
>> the code is as follows
>> 
>> $list{'entry'} = {
>> 'objectClass' => ['top','mjDistributionList'],
>> 'cn' => ["AUT"],
>> 'mj_admin_passwd' => ["apassword"],
>> 'mj_moderate' => ['TRUE'],
>> 'owner' => [$list_owner],
>> 'description' => ["AUT mailing list"],
>> 'mj_approve_passwd' => ["aut.approve"],
>> 'mj_submit_policy' => ["restricted"],
>> 'mj_subscribe_policy' => ["closed"],
>> 'mj_restrict_post' => \@senders,
>> 'mj_DLMembers' => []
>> };
>> 
>> 
>> $ret = $ldap->add(dn=>$dn,attrs => [@$list{'entry'}]);
>> 
>> if ($ret != LDAP_SUCCESS){
>> $ret->code && warn "failed to add entry: ", $ret->error ;
>> } else {
>> print "Added $rdn successfully\n";
>> };
>> 
>> 
>> Is there any difference in how the two modules wrap the entry before they
>> add to the directory??

> I don't know anything about Net::LDAPapi. You'll need to seek help elsewhere
> with that code!

> You're obviously not running with perl's -w flag or using 'use strict'.
> These are *strongly* recommended, because they point out errors in your
> code. If you try to do that with your snippet it complains:

> Global symbol "$list" requires explicit package name at ./test.pl line 20.
> Execution of ./test.pl aborted due to compilation errors.

> Line 20 in my test script is the line that calls add.

> Does writing:

>     attrs => [%{$list{'entry'}}]

> make a difference? 

>> as before im not on the list so could any helpful souls please reply to
>> my email address.

> Cheers,

> Chris


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic