adLDAP - LDAP authentication with PHP for Active Directory Logo



When instantiating adLDAP it will automatically make a connection to your Domain Controller using the settings defined within the class itself, see configuring variables

require_once(dirname(__FILE__) . '/adLDAP.php');
$adldap = new adLDAP();

The settings can also be overridden when the class is first called by specifying an array with your options.

Called like $adldap = new adLDAP($options); Where $options is an array with one or more of the following keys

  • string account_suffix
  • string base_dn
  • array domain_controllers
  • string admin_username
  • string admin_password
  • boolean real_primarygroup
  • boolean use_ssl
  • boolean use_tls
  • boolean recursive_groups
  • integer ad_port
  • boolean sso
require_once(dirname(__FILE__) . '/adLDAP.php');
$adldap = new adLDAP(array('base_dn'=>'DC=domain,DC=local', 'account_suffix'=>'@domain.local'));


adLDAP will NOT automatically disconnect at the end of the script. There is a need to specifically close your connection unless you need to perform a re-connection


Performs a connection to your domain controller. You should never need to call these functions directly unless you specifically wish to change connection parameters mid-script.

For example

require_once(dirname(__FILE__) . '/adLDAP.php');
$adldap = new adLDAP();
/* Some code here */
/* Some code here */

Disconnect from the domain controller.

documentation_connections.txt · Last modified: 2015/06/03 11:14 by
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki