139 |
foreach my $attr ( @{ $response->{protocolOp}->{searchResEntry}->{attributes} } ) { |
foreach my $attr ( @{ $response->{protocolOp}->{searchResEntry}->{attributes} } ) { |
140 |
if ( $attr->{type} =~ m/date/i ) { |
if ( $attr->{type} =~ m/date/i ) { |
141 |
foreach my $i ( 0 .. $#{ $attr->{vals} } ) { |
foreach my $i ( 0 .. $#{ $attr->{vals} } ) { |
142 |
$attr->{vals}->[$i] = "$1-$2-$3" if $attr->{vals}->[$i] =~ m/^([12]\d\d\d)([01]\d+)([123]\d+)$/; |
$attr->{vals}->[$i] = "$1-$2-$3" if $attr->{vals}->[$i] =~ m/^([12]\d\d\d)([01]\d+)([0123]\d+)$/; |
143 |
} |
} |
144 |
} elsif ( $attr->{type} eq 'hrEduPersonUniqueNumber' ) { |
} elsif ( $attr->{type} eq 'hrEduPersonUniqueNumber' ) { |
145 |
foreach my $val ( @{ $attr->{vals} } ) { |
foreach my $val ( @{ $attr->{vals} } ) { |
146 |
next if $val !~ m{.+:.+}; |
next if $val !~ m{.+:.+}; |
147 |
my ( $n, $v ) = split(/\s*:\s*/, $val ); |
my ( $n, $v ) = split(/\s*:\s*/, $val ); |
148 |
push @attrs, { type => $_->{type} . '_' . $n, vals => [ $v ] }; |
push @attrs, { type => $attr->{type} . '_' . $n, vals => [ $v ] }; |
149 |
} |
} |
150 |
} |
} |
151 |
} |
} |