/[A3C]/bin/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/ldap.pl

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

revision 61 by dpavlin, Wed Apr 9 21:32:34 2008 UTC revision 106 by dpavlin, Thu May 1 17:06:02 2008 UTC
# Line 33  if ( @models ) { Line 33  if ( @models ) {
33          }          }
34  } else {  } else {
35    
36          Jifty->log->info( 'syncing all organizations and users' );          my $person_oc = $ldap->objectClass->{person};
37            my $org_oc = $ldap->objectClass->{organization};
38    
39          my $orgs = $ldap->collection( 'Organization', limit => $limit );          Jifty->log->info( "syncing all $org_oc organizations and $person_oc persons" );
40    
41            my $orgs = $ldap->collection( $org_oc , limit => $limit );
42    
43          my $o_nr = 1;          my $o_nr = 1;
44    
45          while ( my $o = $orgs->next ) {          while ( my $o = $orgs->next ) {
46                  Jifty->log->info( 'sync organization ', $o_nr++, '/', $orgs->count, ' ', $o->name );                  Jifty->log->info( 'sync organization ', $o_nr++, '/', $orgs->count, ' ', $o->name );
47                    my $org_uid = $o->__value( $ldap->link->{value_from} ) || die "can't find org_uid";
48                  my $action = Jifty->web->new_action(                  my $action = Jifty->web->new_action(
49                          class => 'SyncOrganization',                          class => 'SyncOrganization',
50                          moniker => 'sync',                          moniker => 'sync',
51                          arguments => {                          arguments => {
52                                  cn => $o->cn,                                  org_uid => $org_uid,
53                          }                          }
54                  );                  );
55                  $action->run;                  $action->run;

Legend:
Removed from v.61  
changed lines
  Added in v.106

  ViewVC Help
Powered by ViewVC 1.1.26