1 package LiCoM::Connection;
12 LiCoM::Connection - Represents the connection to an LDAP-server.
18 @LiCoM::Connection::EXPORT_OK = (qw($Ldap));
19 @LiCoM::Connection::ISA = ('Exporter');
27 =item LiCoM::Connection-E<gt>B<connect> (I<$server>, I<$bind_dn>, I<$password>, I<$base_dn>, [I<$port>])
29 Connects to the LDAP-Server given.
38 my $bind_dn = $opts{'bind_dn'};
39 my $uri = $opts{'uri'};
40 my $passwd = $opts{'password'};
44 die unless ($bind_dn and $uri and defined ($passwd));
46 $Ldap = Net::LDAP->new ($uri);
48 $msg = $Ldap->bind ($bind_dn, password => $passwd);
49 if ($msg->is_error ())
51 warn ('LDAP bind failed: ' . $msg->error_text ());
58 =item LiCoM::Connection-E<gt>B<disconnect> ()
60 Disconnect from the LDAP-Server.
74 Florian octo Forster E<lt>octo at verplant.orgE<gt>