my $uid = $response->{protocolOp}->{searchResEntry}->{objectName};
warn "## SEARCH $uid";
-if(0) {
+ my @attrs;
+
map {
- if ( $_->{type} eq 'postalAddress' ) {
- $_->{vals} = [ 'foobar' ];
+ if ( $_->{type} eq 'hrEduPersonUniqueNumber' ) {
+ foreach my $val ( @{ $_->{vals} } ) {
+ next if $val !~ m{.+:.+};
+ my ( $n, $v ) = split(/\s*:\s*/, $val );
+ push @attrs, { type => $_->{type} . '_' . $n, vals => [ $v ] };
+ }
}
} @{ $response->{protocolOp}->{searchResEntry}->{attributes} };
-}
+
+ warn "# ++ attrs ",dump( @attrs );
+
+ push @{ $response->{protocolOp}->{searchResEntry}->{attributes} }, $_ foreach @attrs;
my $path = $config->{yaml_dir} . "$uid.yaml";
if ( -e $path ) {
foreach my $type ( keys %$data ) {
my $vals = $data->{$type};
- $vals =~ s{#\s*$}{};
-
- my @vals = split(/\s*#\s*/, $vals);
- push @{ $response->{protocolOp}->{searchResEntry}->{attributes} },
- { type => $config->{overlay_prefix} . $type, vals => [ @vals ] };
+ push @{ $response->{protocolOp}->{searchResEntry}->{attributes} }, {
+ type => $config->{overlay_prefix} . $type,
+ vals => ref($vals) eq 'ARRAY' ? $vals : [ $vals ],
+ };
}
}
}
+$ENV{LANG} = 'C'; # so we don't double-encode utf-8 if LANG is utf-8
+
my $listenersock = IO::Socket::INET->new(
Listen => 5,
Proto => 'tcp',