- skip to content

# Database Abstraction Layer

### User Tools

- Login

### Site Tools

- Recent changes
- Media Manager
- Sitemap

### Sidebar

##### Resources

- Reference Manual
- User Guide
- The Data Dictionary
- ADOdb-xmlschema
- ADOdb Active Record
- Performance Monitoring
- Date/Time Library
- Session Management Library
- Unsupported Addons
- Coding Standards

##### Supported Databases

- Access
- ADO
- CSV
- Firebird
- Frontbase
- IBM DB2
- Informix
- Interbase
- LDAP
- Microsoft SQL Server
- MySQL
- Netezza
- ODBC
- ODBTP
- Oracle
- PDO
- Postgresql
- SAP ADS
- SAP ASE
- SAP Maxdb
- SAP Sqlanywhere
- Sqlite
- Sybase
- Plain Text
- Visual Foxpro

##### Other

- Feature Comparison Matrix
- Connection Matrix
- Include File Guide

v5:database:ldap

# LDAP

##### Specification

Driver Name | ldap
Data Provider | ldap
Status | Inactive1)
Windows | Yes
Unix | Perhaps2)
ADOdb V5 | Yes
ADOdb V6 | Yes

## Description

The `ldap` driver provides a small subset of ADOdb commands allowing read-only access to an LDAP database.

## Available Methods

The following methods are available for use with the LDAP driver:

- getAssoc()
- selectDb()
- serverInfo()
- getRowAssoc()

Calls to other methods when used with this driver may produce unexpected results or program failure.

## Usage

    $db = newAdoConnection('ldap');

## Custom Functionality

If defined prior to connection, the following variables will be passed as input bind variables. Valid Domain Values for LDAP Options:

    LDAP_OPT_DEREF (integer)
    LDAP_OPT_SIZELIMIT (integer)
    LDAP_OPT_TIMELIMIT (integer)
    LDAP_OPT_PROTOCOL_VERSION (integer)
    LDAP_OPT_ERROR_NUMBER (integer)
    LDAP_OPT_REFERRALS (boolean)
    LDAP_OPT_RESTART (boolean)
    LDAP_OPT_HOST_NAME (string)
    LDAP_OPT_ERROR_STRING (string)
    LDAP_OPT_MATCHED_DN (string)
    LDAP_OPT_SERVER_CONTROLS (array)
    LDAP_OPT_CLIENT_CONTROLS (array)

Make sure to set this BEFORE calling Connect() Example:

    $LDAP_CONNECT_OPTIONS = Array(
    	Array (
    		"OPTION_NAME"=>LDAP_OPT_DEREF,
    		"OPTION_VALUE"=>2
    	),
    	Array (
    		"OPTION_NAME"=>LDAP_OPT_SIZELIMIT,
    		"OPTION_VALUE"=>100
    	),
    	Array (
    		"OPTION_NAME"=>LDAP_OPT_TIMELIMIT,
    		"OPTION_VALUE"=>30
    	),
    	Array (
    		"OPTION_NAME"=>LDAP_OPT_PROTOCOL_VERSION,
    		"OPTION_VALUE"=>3
    	),
    	Array (
    		"OPTION_NAME"=>LDAP_OPT_ERROR_NUMBER,
    		"OPTION_VALUE"=>13
    	),
    	Array (
    		"OPTION_NAME"=>LDAP_OPT_REFERRALS,
    		"OPTION_VALUE"=>FALSE
    	),
    	Array (
    		"OPTION_NAME"=>LDAP_OPT_RESTART,
    		"OPTION_VALUE"=>FALSE
    	)
    );

[dormant]
1) This driver is not actively supported or enhanced by ADOdb project members, but you can provide fixes and enhancements if you have the expertise
2) We have never tried it except against Microsoft LDAP servers from Windows
v5/database/ldap.txt · Last modified: 2016/01/12 17:31 by mnewnham

### Page Tools

- Show pagesource
- Old revisions
- Backlinks
- Rename Page
- Back to top