Morning all, I have made changes to that ldap script and when I tried to
delete a user I got "subtree delete not supported". I want to delete
everything associated with a user, is there a way that I can delete
everything with just the user id ?
Cheers for any advice folks.
G :)
From: Dave Gray <[EMAIL PROTECTED]>
Reply-To: Dave Gray <[EMAIL PROTECTED]>
To: beginners@perl.org
Subject: Re: deleting ldap users question
Date: Mon, 27 Jun 2005 10:20:59 -0400
MIME-Version: 1.0
Received: from lists.develooper.com ([63.251.223.186]) by
MC6-F31.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Mon, 27 Jun 2005
07:22:08 -0700
Received: (qmail 24254 invoked by uid 514); 27 Jun 2005 14:21:06 -0000
Received: (qmail 24245 invoked from network); 27 Jun 2005 14:21:06 -0000
Received: from x1a.develooper.com (HELO x1.develooper.com) (216.52.237.111)
by lists.develooper.com with SMTP; 27 Jun 2005 14:21:06 -0000
Received: (qmail 20306 invoked by uid 225); 27 Jun 2005 14:21:06 -0000
Received: (qmail 20300 invoked by alias); 27 Jun 2005 14:21:05 -0000
Received: pass (x1.develooper.com: domain of [EMAIL PROTECTED] designates
64.233.184.202 as permitted sender)
Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.202)
by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 27 Jun 2005
07:21:03 -0700
Received: by wproxy.gmail.com with SMTP id i4so358209wra for
<beginners@perl.org>; Mon, 27 Jun 2005 07:20:59 -0700 (PDT)
Received: by 10.54.129.19 with SMTP id b19mr3354313wrd; Mon, 27 Jun
2005 07:20:59 -0700 (PDT)
Received: by 10.54.63.5 with HTTP; Mon, 27 Jun 2005 07:20:59 -0700 (PDT)
X-Message-Info: JGTYoYF78jFQyCpTbXQI19BRsJVd92Z23eosuKjIyTc=
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Post: <mailto:beginners@perl.org>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
List-Id: <beginners.perl.org>
Delivered-To: mailing list beginners@perl.org
Delivered-To: beginners@perl.org
X-Spam-Status: No, hits=-2.5 required=8.0tests=BAYES_00,RCVD_BY_IP
X-Spam-Check-By: la.mx.develooper.com
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta;
d=gmail.com;
h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
b=Bwf78MqBhttEwhcP2lkUNhxN+HeV0IgothQewHstTeB12toQLuxwYNUo71K+j2wgwTsLQGem+HZ6PRLR+i3zst2UEqmpo5Gpa8HOU+LqMLS6II0AWWJDhDWmumPlHbI1yexpwf9EB0xQyk27/1VYCfE7JJRP6pSc1nxfqTCQ9cQ=
References: <[EMAIL PROTECTED]>
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 27 Jun 2005 14:22:08.0512 (UTC)
FILETIME=[99D8C800:01C57B23]
On 6/27/05, Graeme McLaren <[EMAIL PROTECTED]> wrote:
> Hi all, I am trying to delete entries from an LDAP server and I don't
> understand why my code is not deleting the relevant entries.
[snip]
> here is my code:
> #############################################################
> #!/usr/bin/perl
> use Net::LDAP;
[snip]
> eval{$ldap->delete($dn)};
> if($@){
> print "error: $@ \n";
> }else{
> print "username $_ deleted \n";
> }
Net::LDAP[1] doesn't call die when it encounters an error. You need to
check for an error condition like they do in the example, something
like:
$msg = $ldap->delete($dn);
die $msg->error if $msg->code;
[1] <http://search.cpan.org/~gbarr/perl-ldap-0.33/lib/Net/LDAP.pod>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>