/[virtual-ldap]/bin/ldap-rewrite.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /bin/ldap-rewrite.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 73 by dpavlin, Tue Feb 23 00:11:35 2010 UTC revision 84 by dpavlin, Mon Mar 1 18:57:30 2010 UTC
# Line 136  sub log_response { Line 136  sub log_response {
136    
137                  my @attrs;                  my @attrs;
138    
139                  map {                  foreach my $attr ( @{ $response->{protocolOp}->{searchResEntry}->{attributes} } ) {
140                          if ( $_->{type} eq 'hrEduPersonUniqueNumber' ) {                          if ( $attr->{type} =~ m/date/i ) {
141                                  foreach my $val ( @{ $_->{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+)$/;
143                                    }
144                            } elsif ( $attr->{type} eq 'hrEduPersonUniqueNumber' ) {
145                                    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 => $_->{type} . '_' . $n, vals => [ $v ] };
149                                  }                                  }
150                          }                          }
151                  } @{ $response->{protocolOp}->{searchResEntry}->{attributes} };                  }
152    
153                  warn "# ++ attrs ",dump( @attrs );                  warn "# ++ attrs ",dump( @attrs );
154    

Legend:
Removed from v.73  
changed lines
  Added in v.84

  ViewVC Help
Powered by ViewVC 1.1.26