X-Git-Url: http://git.rot13.org/?p=virtual-ldap;a=blobdiff_plain;f=bin%2Fldap-rewrite.pl;h=b6f726f15aa6b9d0d948803aa39a38e86ad0de85;hp=e9be738c22686ce2262dae98019afcbcd48dce8a;hb=HEAD;hpb=72a182f851703954afd534a9e4623103b8efdab2 diff --git a/bin/ldap-rewrite.pl b/bin/ldap-rewrite.pl index e9be738..b6f726f 100755 --- a/bin/ldap-rewrite.pl +++ b/bin/ldap-rewrite.pl @@ -157,6 +157,14 @@ sub log_response { foreach my $i ( 0 .. $#{ $attr->{vals} } ) { $attr->{vals}->[$i] =~ s/^u2010/p2010/gs && warn "FIXME group"; } + } elsif ( $attr->{type} eq 'homePostalAddress' ) { + foreach my $val ( @{ $attr->{vals} } ) { + next if $val !~ m{^(.+)\s*,\s*(\d+)\s+(.+)}; + push @attrs, + { type => 'homePostalAddress_address', vals => [ $1 ] }, + { type => 'homePostalAddress_zipcode', vals => [ $2 ] }, + { type => 'homePostalAddress_city', vals => [ $3 ] }; + } } elsif ( $attr->{type} eq 'mail' ) { my @emails; foreach my $i ( 0 .. $#{ $attr->{vals} } ) {