NAME

LDAPInfo - Class to retrieve LDAP information from an LDAP-server.

SYNOPSIS

use LDAPInfo;
 
# instantiate
my $ldap=LDAPInfo->new(server=>"localhost",dn=>"username",password=>"MYPW",confidential=>1);

# bind
$ldap->bind();

# search
my $result=$ldap->search(base=>"ou=MYOU,dc=domain,dc=topdomain",filter=>"cn=mystring*");

DESCRIPTION

Class to retrieve information from an LDAP catalogue server. It supports the most basic operations in a set of easy operations.

new()

Instantiates the class.

Accepts the followng parameters:

Returns the class instance.

METHODS

bind()

Attempts to bind to the LDAP-server.

Accepts no input.

Returns 1 upon success, 0 upon failure. Please check the error()-method for more information upon failure.

Searches the LDAP catalogue for information.

Accepts to input in the following order:

Upon success returns a HASH-reference to a structure as follows:

(
   0 => {
          ATTRIBUTEa => VALUE,
          .
          .
          ATTRIBUTEz => VALUE
        }

  1 => {
         ATTRIBUTEa => VALUE,
         .
         .
         ATTRIBUTEz => VALUE

       }
 )

where the primary keys are the numbered hits that it found (from 0 - N). The HASH may be empty if there were no hits.

Upon failure it will return undef. Please check the error()-method for more information.

error()

Returns the last error message from the module.

Accepts no input.

Returns the last error message as a SCALAR.