84 |
my $uid = $response->{protocolOp}->{searchResEntry}->{objectName}; |
my $uid = $response->{protocolOp}->{searchResEntry}->{objectName}; |
85 |
warn "## SEARCH $uid"; |
warn "## SEARCH $uid"; |
86 |
|
|
87 |
if(0) { |
my @attrs; |
88 |
|
|
89 |
map { |
map { |
90 |
if ( $_->{type} eq 'postalAddress' ) { |
if ( $_->{type} eq 'hrEduPersonUniqueNumber' ) { |
91 |
$_->{vals} = [ 'foobar' ]; |
foreach my $val ( @{ $_->{vals} } ) { |
92 |
|
next if $val !~ m{.+:.+}; |
93 |
|
my ( $n, $v ) = split(/\s*:\s*/, $val ); |
94 |
|
push @attrs, { type => $_->{type} . '_' . $n, vals => [ $v ] }; |
95 |
|
} |
96 |
} |
} |
97 |
} @{ $response->{protocolOp}->{searchResEntry}->{attributes} }; |
} @{ $response->{protocolOp}->{searchResEntry}->{attributes} }; |
98 |
} |
|
99 |
|
warn "# ++ attrs ",dump( @attrs ); |
100 |
|
|
101 |
|
push @{ $response->{protocolOp}->{searchResEntry}->{attributes} }, $_ foreach @attrs; |
102 |
|
|
103 |
my $path = $config->{yaml_dir} . "$uid.yaml"; |
my $path = $config->{yaml_dir} . "$uid.yaml"; |
104 |
if ( -e $path ) { |
if ( -e $path ) { |
108 |
foreach my $type ( keys %$data ) { |
foreach my $type ( keys %$data ) { |
109 |
|
|
110 |
my $vals = $data->{$type}; |
my $vals = $data->{$type}; |
|
$vals =~ s{#\s*$}{}; |
|
|
|
|
|
my @vals = split(/\s*#\s*/, $vals); |
|
111 |
|
|
112 |
push @{ $response->{protocolOp}->{searchResEntry}->{attributes} }, |
push @{ $response->{protocolOp}->{searchResEntry}->{attributes} }, { |
113 |
{ type => $config->{overlay_prefix} . $type, vals => [ @vals ] }; |
type => $config->{overlay_prefix} . $type, |
114 |
|
vals => ref($vals) eq 'ARRAY' ? $vals : [ $vals ], |
115 |
|
}; |
116 |
} |
} |
117 |
} |
} |
118 |
|
|
153 |
} |
} |
154 |
|
|
155 |
|
|
156 |
|
$ENV{LANG} = 'C'; # so we don't double-encode utf-8 if LANG is utf-8 |
157 |
|
|
158 |
my $listenersock = IO::Socket::INET->new( |
my $listenersock = IO::Socket::INET->new( |
159 |
Listen => 5, |
Listen => 5, |
160 |
Proto => 'tcp', |
Proto => 'tcp', |