use IO::Socket::INET;
use IO::Select;
+use YAML qw/DumpFile/;
+
use Data::Dump qw/dump/;
=head1 NAME
=cut
our $pids;
-our $cache;
-
-sub cache {
- return $cache;
-}
sub run {
my $self = shift;
my $bind;
$bind->{dn} = $req->{name} if $req->{name};
+
+ if ( $bind->{dn} =~ m{@} ) {
+
+ $bind->{dn} =~ s/[@\.]/,dc=/g;
+ $bind->{dn} =~ s/^/uid=/;
+
+ }
+
$bind->{password} = $req->{authentication}->{simple} if $req->{authentication}->{simple};
warn "# bind ",dump( $bind );
$msg = $self->{upstream}->bind( %$bind );
warn "## entries = ",dump( @entries );
-# $self->cache->write_cache( \@entries, uri_escape( $filter ));
+ my $path = 'var/' . uri_escape( $filter ) . '.yml';
+ DumpFile( $path, \@entries );
+ warn "# created $path ", -s $path, " bytes";
return RESULT_OK, @entries;
}