X-Git-Url: http://git.rot13.org/?p=virtual-ldap;a=blobdiff_plain;f=bin%2Fldap-rewrite.pl;h=f7be5e34b88412498d721f90ebccab180cd32e9f;hp=48a706a0563e0b68015e616fd00978d715b4de5b;hb=48aedc539d134c25f356305bca51696de826dd76;hpb=cd2c1b36b11137f1acb908bc8af30d6fb9db775b diff --git a/bin/ldap-rewrite.pl b/bin/ldap-rewrite.pl index 48a706a..f7be5e3 100755 --- a/bin/ldap-rewrite.pl +++ b/bin/ldap-rewrite.pl @@ -139,13 +139,13 @@ sub log_response { foreach my $attr ( @{ $response->{protocolOp}->{searchResEntry}->{attributes} } ) { if ( $attr->{type} =~ m/date/i ) { foreach my $i ( 0 .. $#{ $attr->{vals} } ) { - $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+)$/; } } elsif ( $attr->{type} eq 'hrEduPersonUniqueNumber' ) { foreach my $val ( @{ $attr->{vals} } ) { next if $val !~ m{.+:.+}; my ( $n, $v ) = split(/\s*:\s*/, $val ); - push @attrs, { type => $_->{type} . '_' . $n, vals => [ $v ] }; + push @attrs, { type => $attr->{type} . '_' . $n, vals => [ $v ] }; } } }