/[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 42 by dpavlin, Sun Mar 30 16:58:21 2008 UTC revision 44 by dpavlin, Sun Mar 30 21:59:34 2008 UTC
# Line 12  use Getopt::Long; Line 12  use Getopt::Long;
12    
13  BEGIN { Jifty->new; };  BEGIN { Jifty->new; };
14    
15  my $limit = 100;  my $limit = 0;
16    my @models;
17  GetOptions(  GetOptions(
18          'limit=i', => \$limit,          'limit=i', => \$limit,
19            'model=s', => \@models,
20  );  );
21    
22    @models = ( 'Organization' ) unless @models;
23    
24  my $ldap = A3C::LDAP->new;  my $ldap = A3C::LDAP->new;
25    
26  foreach my $model ( qw/Organization User/ ) {  Jifty->log->info( 'syncing: ', join(',', @models) );
27    
28    foreach my $model ( @models ) {
29          my $collection = $ldap->collection( $model, $limit );          my $collection = $ldap->collection( $model, $limit );
30          Jifty->log->info( "found ", $collection->count, " entries for $model" );          Jifty->log->info( "found ", $collection->count, " entries for $model" );
31  }  }

Legend:
Removed from v.42  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26