/[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

Diff of /bin/import-ldap.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 34 by dpavlin, Tue Mar 18 19:22:50 2008 UTC revision 36 by dpavlin, Sun Mar 30 00:02:18 2008 UTC
# Line 6  use strict; Line 6  use strict;
6  use lib 'lib';  use lib 'lib';
7    
8  use Jifty;  use Jifty;
9  use Net::LDAP;  use A3C::LDAP;
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
11  use Getopt::Long;  use Getopt::Long;
12    
# Line 17  GetOptions( Line 17  GetOptions(
17          'limit=i', => \$limit,          'limit=i', => \$limit,
18  );  );
19    
 my $ldap_config = Jifty->config->app('LDAP');  
 Jifty->log->debug( "config->app(LDAP) = ",dump( $ldap_config ) );  
   
 my $ldap = Net::LDAP->new( $ldap_config->{Server} ) or die "$@";  
   
 # an anonymous bind  
 #my $mesg = $ldap->bind;  
 my $mesg = $ldap->bind( $ldap_config->{DN}, password => $ldap_config->{Password} );  
   
 Jifty->log->info("Connected to ", $ldap_config->{Server}, " with DN ", $ldap_config->{DN});  
   
20  # perform a search  # perform a search
21  $mesg = $ldap->search(  my $mesg = A3C::LDAP->search(
22          base   => "dc=skole,dc=hr",          base   => "dc=skole,dc=hr",
23  #       filter => "(&(sn=Barr) (o=Texas Instruments))",  #       filter => "(&(sn=Barr) (o=Texas Instruments))",
24          filter => "(objectClass=hrEduPerson)",          filter => "(objectClass=hrEduPerson)",

Legend:
Removed from v.34  
changed lines
  Added in v.36

  ViewVC Help
Powered by ViewVC 1.1.26