( Actually, the name is chosen to `rhyme' with Apache::DBI. There are no dependencies on Apache or mod_perl. )
NAME Apache::LDAP - provides persistent LDAP connections SYNOPSIS use Apache::LDAP; # use Net::LDAP my $connection = Apache::LDAP -> new( connection => [ # Net::LDAP -> new parameters ], tls => [ # Net::LDAP -> start_tls parameters ], bind => [ # Net::LDAP -> bind parameters ], ); # use Net::LDAPS my $connection = Apache::LDAPS -> new( connection => [ # Net::LDAPS -> new parameters ], tls => [ # Net::LDAPS -> new tls parameters ], bind => [ # Net::LDAPS -> bind parameters ], ); DESCRIPTION This module initiates a persistant LDAP connection. The LDAP access uses the Net::LDAP family of modules. Since a usable LDAP connection usually requires two or three steps, Apache::LDAP is not a simple drop-in module in the manner of Apache::DBI. Code must be written to take advantage of Apache::LDAP. Unfortunately, LDAP connections are not sharable across processes. This means that connections must be made in Apache children processes, not in the startup process (i.e., during child initialization, not during server configuration). Connections are cached based on the class and the parameters passed to the "new" method. A previously cached connection is returned only if the class and parameters are identical to those used to create the connection and if the connection appears to be alive. The connection is tested by requesting the root DSA information from the server. Net::LDAPS Support Apache::LDAPS is included with Apache::LDAP to support Net::LDAPS. The parameters to "new" are identical. The "tls" parameters are included with the "connection" parameters when calling "Net::LDAPS -> new". SUB-CLASSING A sub-class of Apache::LDAP may be useful if you want to use an LDAP module other than Net::LDAP. package My::Persistant::LDAP; use base qw(Apache::LDAP); sub make_connection { my($class, $params) = @_; # return new connection } sub test_connection { my($class, $connection) = @_; # return true if $connection is good } __END__ SEE ALSO the Net::LDAP manpage, the Net::LDAPS manpage. AUTHOR James G. Smith <[EMAIL PROTECTED]> COPYRIGHT Copyright (C) 2002 Texas A&M University. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. -- James Smith <[EMAIL PROTECTED]>, 979-862-3725 Senior Software Applications Developer, Texas A&M CIS Operating Systems Group, Unix