-
Notifications
You must be signed in to change notification settings - Fork 204
adLDAP Developer API Reference
This documentation relates to version 4.0 branch of adLDAP. Version 4 is not backwards compatible with code written for prior versions. For documentation on versions prior to version 4.0, please visit this page
This API is intended to be an accurate representation of the current version of the class. A great deal of knowledge is involved in the LDAP schema, so we actively encourage people to add to this documentation if you are able to improve it....
Version 4.0 of adLDAP is a complete re-write of the library and is not backwards compatible with older versions. Please take time to read the documentation to see how to use this class.
- PHP 5
- LDAP extensions to PHP
- An Active Directory domain controller to connect to, preferably with a user account with domain administrator rights
- OpenSSL support in PHP if you wish to set or change/set passwords on a user account
Read the documentation on connecting and disconnecting from your domain controller for more information on different ways of calling adLDAP.
-
Copy the contents of the
src
folder to your server -
Edit the configuring variables in the class itself if you so wish to
-
From your script add the following code
require_once(dirname(FILE) . '/adLDAP.php'); $adldap = new adLDAP();
It would be better to wrap it in a try/catch though
try {
$adldap = new adLDAP();
}
catch (adLDAPException $e) {
echo $e;
exit();
}
You can alternatively override the configuration when the class is called by specifying an array with the options.
You can call adLDAP as follows $adldap = new adLDAP($options);
where $options
is an array with one or more of the following keys
accountSuffix baseDn domainControllers adminUsername adminPassword realPrimaryGroup useSSL useTLS recursiveGroups adPort
See the 'examples' and 'connecting and disconnecting' section for more information