From: Graham B. <gb...@po...> - 2001-03-30 15:37:48
|
----- Forwarded message from Paul Jones <PJ...@no...> ----- Date: Fri, 30 Mar 2001 08:34:56 -0700 To: <gb...@po...> From: "Paul Jones" <PJ...@no...> Subject: creating LDAP entries X-Mailer: Novell GroupWise Internet Agent 5.5.5.1 Graham, This looks like an excellent module. I have a question about creating entries though. How do I specify what type of entry to enter? ie. How do I specify that I want to create a 'group' object, or 'user' object, or any other type of object? Other than that, I think this might be a very useful tool. If I am writting to the wrong place, please let me know who I should contact. Thank you, Paul Jones Developer Support Novell, Inc., the leading provider of Net services software www.novell.com ----- End forwarded message ----- |
From: Eric N. <eni...@cp...> - 2001-03-30 15:55:14
|
This might have been asked before. Is there any way I can take an Net::LDAP::Entry object and save it in LDIF format to a variable rather than a file? I'm sure there's some perl trick to it.. |
From: Graham B. <gb...@po...> - 2001-03-30 16:01:29
|
It should be possible using the IO::Scalar package. Create the IO::Scalar object then my $ldif = Net::LDAP::LDIF->new($io_scalar,"w"); $ldif->write(@entries); should work, but I have not tried it Graham. On Fri, Mar 30, 2001 at 10:54:06AM -0500, Eric Nichols wrote: > This might have been asked before. > Is there any way I can take an Net::LDAP::Entry object and save it in LDIF > format to a variable rather than a file? > > I'm sure there's some perl trick to it.. > > > > |
From: Eric N. <eni...@cp...> - 2001-03-30 18:49:03
|
No such luck. I tried everything. I guess there isn't a method in LDIF to output to a variable? ----- Original Message ----- From: "Graham Barr" <gb...@po...> To: "Eric Nichols" <eni...@cp...> Cc: <per...@li...> Sent: Friday, March 30, 2001 11:00 AM Subject: Re: Writing an LDIF to a variable? > It should be possible using the IO::Scalar package. > > Create the IO::Scalar object then > > my $ldif = Net::LDAP::LDIF->new($io_scalar,"w"); > $ldif->write(@entries); > > should work, but I have not tried it > > Graham. > > On Fri, Mar 30, 2001 at 10:54:06AM -0500, Eric Nichols wrote: > > This might have been asked before. > > Is there any way I can take an Net::LDAP::Entry object and save it in LDIF > > format to a variable rather than a file? > > > > I'm sure there's some perl trick to it.. > > > > > > > > > > |
From: Behruz R. <beh...@cp...> - 2001-03-30 18:56:06
|
Hi Eric, check out the next Web site , there is a great article about NET::LDAP by MArk Wilcox. There is alos an example with LDIF. http://www.perlmonth.com/features/ldap/ldap.html?issue=11 Behruz -----Original Message----- From: per...@li... [mailto:per...@li...]On Behalf Of Eric Nichols Sent: Friday, March 30, 2001 10:48 AM To: per...@li... Subject: Re: Writing an LDIF to a variable? No such luck. I tried everything. I guess there isn't a method in LDIF to output to a variable? ----- Original Message ----- From: "Graham Barr" <gb...@po...> To: "Eric Nichols" <eni...@cp...> Cc: <per...@li...> Sent: Friday, March 30, 2001 11:00 AM Subject: Re: Writing an LDIF to a variable? > It should be possible using the IO::Scalar package. > > Create the IO::Scalar object then > > my $ldif = Net::LDAP::LDIF->new($io_scalar,"w"); > $ldif->write(@entries); > > should work, but I have not tried it > > Graham. > > On Fri, Mar 30, 2001 at 10:54:06AM -0500, Eric Nichols wrote: > > This might have been asked before. > > Is there any way I can take an Net::LDAP::Entry object and save it in LDIF > > format to a variable rather than a file? > > > > I'm sure there's some perl trick to it.. > > > > > > > > > > |
From: Eric N. <eni...@cp...> - 2001-03-30 19:36:21
|
No such luck, I got it to work, except IO::Scalar dosen't support the TELL function? Can't locate object method "TELL" via package "IO::Scalar" at C:/Perl/site/lib/Net/LDAP/LDIF.pm line 169. Source code: --- use Net::LDAP::Entry; use Net::LDAP::LDIF; use IO::Scalar; my ($destentry) = Net::LDAP::Entry->new; $destentry->add('cn'=>['Eric Nichols']); $destentry->dn('cn=eric nichols,o=cps'); my $s; tie *OUT, 'IO::Scalar', \$s; my $ldif = Net::LDAP::LDIF->new(\*OUT,"a"); $ldif->write($destentry); $ldif->done(); print $s; --- ----- Original Message ----- From: "Graham Barr" <gb...@po...> To: "Eric Nichols" <eni...@cp...> Cc: <per...@li...> Sent: Friday, March 30, 2001 11:00 AM Subject: Re: Writing an LDIF to a variable? > It should be possible using the IO::Scalar package. > > Create the IO::Scalar object then > > my $ldif = Net::LDAP::LDIF->new($io_scalar,"w"); > $ldif->write(@entries); > > should work, but I have not tried it > > Graham. > > On Fri, Mar 30, 2001 at 10:54:06AM -0500, Eric Nichols wrote: > > This might have been asked before. > > Is there any way I can take an Net::LDAP::Entry object and save it in LDIF > > format to a variable rather than a file? > > > > I'm sure there's some perl trick to it.. > > > > > > > > > > |
From: Graham B. <gb...@po...> - 2001-04-02 14:15:41
|
That is an easy fix to IO::Scalar though sub TELL { shift->{Pos} } Graham. On Fri, Mar 30, 2001 at 02:34:40PM -0500, Eric Nichols wrote: > No such luck, > I got it to work, except IO::Scalar dosen't support the TELL function? > > Can't locate object method "TELL" via package "IO::Scalar" at > C:/Perl/site/lib/Net/LDAP/LDIF.pm line 169. > > Source code: > --- > use Net::LDAP::Entry; > use Net::LDAP::LDIF; > use IO::Scalar; > > my ($destentry) = Net::LDAP::Entry->new; > $destentry->add('cn'=>['Eric Nichols']); > $destentry->dn('cn=eric nichols,o=cps'); > > my $s; > tie *OUT, 'IO::Scalar', \$s; > > my $ldif = Net::LDAP::LDIF->new(\*OUT,"a"); > $ldif->write($destentry); > $ldif->done(); > > print $s; > --- > ----- Original Message ----- > From: "Graham Barr" <gb...@po...> > To: "Eric Nichols" <eni...@cp...> > Cc: <per...@li...> > Sent: Friday, March 30, 2001 11:00 AM > Subject: Re: Writing an LDIF to a variable? > > > > It should be possible using the IO::Scalar package. > > > > Create the IO::Scalar object then > > > > my $ldif = Net::LDAP::LDIF->new($io_scalar,"w"); > > $ldif->write(@entries); > > > > should work, but I have not tried it > > > > Graham. > > > > On Fri, Mar 30, 2001 at 10:54:06AM -0500, Eric Nichols wrote: > > > This might have been asked before. > > > Is there any way I can take an Net::LDAP::Entry object and save it in > LDIF > > > format to a variable rather than a file? > > > > > > I'm sure there's some perl trick to it.. > > > > > > > > > > > > > > > > > > |
From: Eryq <er...@ze...> - 2001-04-02 15:22:41
|
Graham Barr wrote: > > That is an easy fix to IO::Scalar though > > sub TELL { shift->{Pos} } > > Graham. > Consider it on the queue. I should get to it tonight; somebody please bug me if they don't see it on CPAN soon. Eryq |
From: Eric N. <eni...@cp...> - 2001-04-02 15:40:51
|
Thanks for all the help! I've never seen responses so quick! I did figure out one snipit of code, this just writes it to STDOUT. Actually any existing file handle can be used. my $ldif = Net::LDAP::LDIF->new(\*STDOUT,"a"); $ldif->write_cmd($destentry); $ldif->done(); This sounds obvious to the experienced, but to us lay people.... ----- Original Message ----- From: "Eryq" <er...@ze...> To: "Graham Barr" <gb...@po...> Cc: "Eric Nichols" <eni...@cp...>; <per...@li...> Sent: Monday, April 02, 2001 11:22 AM Subject: Re: Writing an LDIF to a variable? > Graham Barr wrote: > > > > That is an easy fix to IO::Scalar though > > > > sub TELL { shift->{Pos} } > > > > Graham. > > > > Consider it on the queue. I should get to it tonight; > somebody please bug me if they don't see it on CPAN > soon. > > Eryq > > |
From: Chris R. <chr...@me...> - 2001-03-30 16:09:47
|
Graham Barr <gb...@po...> wrote: > ----- Forwarded message from Paul Jones <PJ...@no...> ----- > > Date: Fri, 30 Mar 2001 08:34:56 -0700 > To: <gb...@po...> > From: "Paul Jones" <PJ...@no...> > Subject: creating LDAP entries > X-Mailer: Novell GroupWise Internet Agent 5.5.5.1 > > Graham, > > This looks like an excellent module. I have a question about creating > entries though. How do I specify what type of entry to enter? ie. How do > I specify that I want to create a 'group' object, or 'user' object, or > any other type of object? Other than that, I think this might be a very > useful tool. If I am writting to the wrong place, please let me know who > I should contact. > > Thank you, > > > Paul Jones > Developer Support > Novell, Inc., the leading provider of Net services software > www.novell.com > > > > > ----- End forwarded message ----- > You need to have some understanding of the schema provided by your directory server. Most servers implement the schema described in RFC 2256, so you should get a copy of that and work out what objectclasses map to what you're trying to model. It isn't terribly descriptive though - the X.521 standard actually describes the standard objectclasses a lot better, so you might want to look for your copy of X.521. (You can drafts of it from ftp://ftp.bull.com/pub/OSIdirectory/) For example, the standard objectclasses 'groupOfNames' and 'groupOfUniqueNames' are typically used to represent groups. 'User's might use the 'person' or 'organizationalPerson' objectclass if the user's a person, or something like 'applicationEntity' if it is a program of some type. There's another RFC - 2798 - that defines 'inetOrgPerson', which is another way to describe a person. Cheers, Chris |