/[A3C]/bin/import-ldap.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /bin/import-ldap.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (show annotations)
Wed Mar 12 23:14:13 2008 UTC (11 years, 5 months ago) by dpavlin
Original Path: bin/ldap.pl
File MIME type: text/plain
File size: 533 byte(s)
more-or-less copy/paste from Net::LDAP pod

1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 use lib 'lib';
7
8 use Jifty;
9 use Net::LDAP;
10
11 BEGIN { Jifty->new; };
12
13 my $ldap = Net::LDAP->new( 'ldap1.skole.local' ) or die "$@";
14
15 # an anonymous bind
16 my $mesg = $ldap->bind;
17
18 # perform a search
19 $mesg = $ldap->search(
20 base => "dc=skole,dc=hr",
21 # filter => "(&(sn=Barr) (o=Texas Instruments))",
22 filter => "(objectClass=hrEduPerson)",
23 sizelimit => 0, # off
24 );
25
26 if ( $mesg->code ) {
27 warn $mesg->code, ": ", $mesg->error, "\n";
28 }
29
30 foreach my $entry ( $mesg->entries ) {
31 $entry->dump;
32 }
33

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26