a bit more cleanup
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 14 Mar 2009 13:45:20 +0000 (13:45 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 14 Mar 2009 13:45:20 +0000 (13:45 +0000)
Makefile.PL
lib/VLDAP/Server.pm

index 57202c4..230a7e9 100644 (file)
@@ -7,7 +7,7 @@ license     'GPL';
 requires       'Net::LDAP::Server';
 requires       'URI::Escape';
 requires       'IO::Socket::INET';
 requires       'Net::LDAP::Server';
 requires       'URI::Escape';
 requires       'IO::Socket::INET';
-requires    'Data::Dump';
+requires       'Data::Dump';
 
 auto_install;
 
 
 auto_install;
 
index 56094ba..7084080 100644 (file)
@@ -14,6 +14,8 @@ use Net::LDAP::Filter;
 use base qw(Net::LDAP::Server);
 use fields qw(upstream);
 
 use base qw(Net::LDAP::Server);
 use fields qw(upstream);
 
+use Net::LDAP;
+
 use URI::Escape;       # uri_escape
 use IO::Socket::INET;
 use IO::Select;
 use URI::Escape;       # uri_escape
 use IO::Socket::INET;
 use IO::Select;
@@ -22,19 +24,19 @@ use Data::Dump qw/dump/;
 
 =head1 NAME
 
 
 =head1 NAME
 
-A3C::LDAP::Server
+VLDAP::Server
 
 =cut
 
 =head1 DESCRIPTION
 
 
 =cut
 
 =head1 DESCRIPTION
 
-Provide LDAP server functionality for L<A3C> somewhat similar to C<slapo-rwm>
+Provide LDAP server functionality somewhat similar to C<slapo-rwm>
 
 =head1 METHODS
 
 =head2 run
 
 
 =head1 METHODS
 
 =head2 run
 
-  my $pid = A3C::LDAP::Server->run({ port => 1389, fork => 0 });
+  my $pid = VLDAP::Server->run({ port => 1389, fork => 0 });
 
 =cut
 
 
 =cut
 
@@ -80,7 +82,7 @@ sub run {
                                # let's create a new socket
                                my $psock = $sock->accept;
                                $sel->add($psock);
                                # let's create a new socket
                                my $psock = $sock->accept;
                                $sel->add($psock);
-                               $Handlers{*$psock} = A3C::LDAP::Server->new($psock);
+                               $Handlers{*$psock} = VLDAP::Server->new($psock);
                        } else {
                                my $result = $Handlers{*$fh}->handle;
                                if ($result) {
                        } else {
                                my $result = $Handlers{*$fh}->handle;
                                if ($result) {
@@ -96,7 +98,7 @@ sub run {
 
 =head2 stop
 
 
 =head2 stop
 
-  my $stopped_pids = A3C::LDAP::Server->stop;
+  my $stopped_pids = VLDAP::Server->stop;
 
 =cut
 
 
 =cut
 
@@ -141,18 +143,18 @@ sub bind {
                resultCode => LDAP_STRONG_AUTH_NOT_SUPPORTED,
        };
 
                resultCode => LDAP_STRONG_AUTH_NOT_SUPPORTED,
        };
 
-       $self->{upstream} ||= A3C::LDAP->new->ldap or return {
+       $self->{upstream} ||= Net::LDAP->new( 'ldaps://ldap.ffzg.hr/' ) or return {
                matchedDN => '',
                errorMessage => $@,
                resultCode => LDAP_UNAVAILABLE,
        };
 
                matchedDN => '',
                errorMessage => $@,
                resultCode => LDAP_UNAVAILABLE,
        };
 
-#      warn "## upstream = ",dump( $self->{upstream} );
-#      warn "upstream not Net::LDAP but ",ref($self->{upstream}) unless ref($self->{upstream}) eq 'Net::LDAP';
+       warn "## upstream = ",dump( $self->{upstream} );
+       warn "upstream not Net::LDAP but ",ref($self->{upstream}) unless ref($self->{upstream}) eq 'Net::LDAP';
 
        my $msg;
 
 
        my $msg;
 
-       # FIXME we would need to unbind because A3C::LDAP binds us automatically, but that doesn't really work
+       # FIXME we would need to unbind because VLDAP binds us automatically, but that doesn't really work
        #$msg = $self->{upstream}->unbind;
        #warn "# unbind msg = ",dump( $msg );
 
        #$msg = $self->{upstream}->unbind;
        #warn "# unbind msg = ",dump( $msg );