[Bps-public-commit] rt-authen-externalauth branch, multiple-emails, updated. 0.09-50-g68ce8d2
Ruslan Zakirov
ruz at bestpractical.com
Tue May 17 17:41:46 EDT 2011
The branch, multiple-emails has been updated
via 68ce8d238d59ee6c868117d7e6d981cf955d737d (commit)
from 454a0c3729557b500ae99a0f2ea7c7f21cc57988 (commit)
Summary of changes:
lib/RT/Authen/ExternalAuth.pm | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
- Log -----------------------------------------------------------------
commit 68ce8d238d59ee6c868117d7e6d981cf955d737d
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed May 18 01:41:15 2011 +0400
refactor long grep/map chains
diff --git a/lib/RT/Authen/ExternalAuth.pm b/lib/RT/Authen/ExternalAuth.pm
index 960b888..5877af7 100644
--- a/lib/RT/Authen/ExternalAuth.pm
+++ b/lib/RT/Authen/ExternalAuth.pm
@@ -666,8 +666,7 @@ sub FindRecordsWithAlternatives {
my $config = $RT::ExternalSettings->{ $service };
next if $config->{'type'} eq 'cookie';
next unless
- grep ref $_,
- map $config->{'attr_map'}{ $_ },
+ grep ref $config->{'attr_map'}{ $_ },
@{ $config->{'attr_match_list'} };
push @info_services, $service;
@@ -743,12 +742,13 @@ sub FindRecordsByOtherFields {
&& defined $args{ $search_by }
&& length $args{ $search_by };
- my @fetch =
- map ref $_? @$_ : $_,
- grep defined,
- map $config->{'attr_map'}{ $_ },
- grep $_ ne $search_by,
- @{ $config->{'attr_match_list'} };
+ my @fetch;
+ foreach my $field ( @{ $config->{'attr_match_list'} } ) {
+ next if $field eq $search_by;
+
+ my $external = $config->{'attr_map'}{ $field };
+ push @fetch, ref $external? (@$external) : ($external);
+ }
my @search_args = (
$service,
$config->{'attr_map'}{ $search_by },
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list