Removed LDAP-lookup loop for new external users.
authorMikal Kolbein Gule <m.k.gule@usit.uio.no>
Wed, 25 Jul 2012 13:45:35 +0000 (15:45 +0200)
committerMikal Kolbein Gule <m.k.gule@usit.uio.no>
Wed, 25 Jul 2012 13:45:35 +0000 (15:45 +0200)
local/lib/RT/Interface/Email/Auth/MailFrom.pm

index b0b9b04..b1ea20f 100644 (file)
@@ -84,16 +84,15 @@ sub GetCurrentUser {
     
     unless ($CurrentUser->Id) {
         my ( $found, %params );
-        while (not $found) {
-            my @auth_services = @$RT::ExternalAuthPriority;
-            for my $service (@auth_services) {
-                my $config = $RT::ExternalSettings->{$service};
-                my $lookup_attr = $config->{'lookup_attr_map'}->{'EmailAddress'};
-                next unless ($config->{'type'} eq 'ldap');
-                ($found, %params) = 
-                RT::Authen::ExternalAuth::LDAP::CanonicalizeUserInfo ( $service, $lookup_attr, $Address );
-                $CurrentUser->LoadByName( %params->{'Name'} ) if $found;
-            }
+        my @auth_services = @$RT::ExternalAuthPriority;
+        for my $service (@auth_services) {
+            my $config = $RT::ExternalSettings->{$service};
+            my $lookup_attr = $config->{'lookup_attr_map'}->{'EmailAddress'};
+            next unless ($config->{'type'} eq 'ldap');
+            ($found, %params) = 
+            RT::Authen::ExternalAuth::LDAP::CanonicalizeUserInfo ( $service, $lookup_attr, $Address );
+            $CurrentUser->LoadByName( %params->{'Name'} ) if $found;
+            last if $found;
         }
     }