Source for file connecting.php
Documentation is available at connecting.php
* This file shows you how to connect to a ldap server using Net_LDAP2.
* It also establishes connections for the other examples;
* they include this file to get a ldap link.
// Class includes; this assumes Net_LDAP2 installed in PHPs include path
// or under subfolder "Net" in the local directory.
require_once 'Net/LDAP2.php';
// host can be a single server (string) or multiple ones - if we define more
// servers here (array), we can implement a basic fail over scenario.
// If no credentials (binddn and bindpw) are given, Net_LDAP2 establishes
// See the documentation for more information on the configuration items!
// 'host' => 'ldap.example.org',
'host' => array ('ldap1.example.org', 'ldap2.example.org'),
// 'binddn' => 'cn=admin,o=example,dc=org',
// 'bindpw' => 'your-secret-password',
'base' => 'o=example,dc=org',
// Connect to configured ldap server
// It is important to check for errors.
// Nearly every method of Net_LDAP2 returns a Net_LDAP2_Error object
// if something went wrong. Through this object, you can retrieve detailed
// information on what exactly happened.
// Here we drop a die with the error message, so the other example
// files will not be calles unless we have a valid link.
die ('BIND FAILED: '. $ldap->getMessage ());
Documentation generated on Mon, 11 Mar 2019 16:03:54 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|