[Bps-public-commit] RT-Extension-LDAPImport branch, master, updated. 0.20_01-45-g2cb90e9

Alex Vandiver alexmv at bestpractical.com
Fri Jul 30 18:24:15 EDT 2010


The branch, master has been updated
       via  2cb90e9da0ca7d01a465c57e872790a0af7c239e (commit)
      from  d8e904b4677d475c7c0e51d74988d1829f0ff664 (commit)

Summary of changes:
 lib/RT/Extension/LDAPImport.pm |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 2cb90e9da0ca7d01a465c57e872790a0af7c239e
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Jul 30 18:26:12 2010 -0400

    Give a progress report while importing

diff --git a/lib/RT/Extension/LDAPImport.pm b/lib/RT/Extension/LDAPImport.pm
index ef86ac1..7baa95e 100644
--- a/lib/RT/Extension/LDAPImport.pm
+++ b/lib/RT/Extension/LDAPImport.pm
@@ -163,6 +163,7 @@ sub import_users {
 
     $self->_dnlist({});
 
+    my $done = 0; my $count = $results->count;
     while (my $entry = $results->shift_entry) {
         my $user = $self->_build_object( ldap_entry => $entry, skip => qr/(?i)^CF\./, mapping => $mapping );
         $user->{Name} ||= $user->{EmailAddress};
@@ -171,6 +172,8 @@ sub import_users {
             next;
         }
         $self->_import_user( user => $user, ldap_entry => $entry, import => $args{import} );
+        $done++;
+        $self->_debug("Imported $done/$count users");
     }
     return 1;
 }
@@ -548,6 +551,7 @@ sub import_groups {
     my $mapping = $RT::LDAPGroupMapping;
     return unless $self->_check_ldap_mapping( mapping => $mapping );
 
+    my $done = 0; my $count = $results->count;
     while (my $entry = $results->shift_entry) {
         my $group = $self->_build_object( ldap_entry => $entry, skip => qr/(?i)^Member_Attr/, mapping => $mapping );
         $group->{Description} ||= 'Imported from LDAP';
@@ -556,6 +560,8 @@ sub import_groups {
             next;
         }
         $self->_import_group( %args, group => $group, ldap_entry => $entry );
+        $done++;
+        $self->_debug("Imported $done/$count groups");
     }
     return 1;
 }

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list