Commit 91b5a08f authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Push Name checking into _import_user, to tighten the import_users loop

parent 70259d7d
......@@ -500,14 +500,6 @@ sub import_users {
my $done = 0; my $count = scalar @results;
while (my $entry = shift @results) {
my $user = $self->_build_user_object( ldap_entry => $entry );
unless ( $user->{Name} ) {
$self->_warn("No Name or Emailaddress for user, skipping ".Dumper $user);
next;
}
if ( $user->{Name} =~ /^[0-9]+$/) {
$self->_debug("Skipping user '$user->{Name}', as it is numeric");
next;
}
$self->_import_user( user => $user, ldap_entry => $entry, import => $args{import} );
$done++;
$self->_debug("Imported $done/$count users");
......@@ -526,6 +518,15 @@ sub _import_user {
my $self = shift;
my %args = @_;
unless ( $args{user}{Name} ) {
$self->_warn("No Name or Emailaddress for user, skipping ".Dumper($args{user}));
return;
}
if ( $args{user}{Name} =~ /^[0-9]+$/) {
$self->_debug("Skipping user '$args{user}{Name}', as it is numeric");
return;
}
$self->_debug("Processing user $args{user}{Name}");
$self->_cache_user( %args );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment