v5:database:ldap
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
v5:database:ldap [2023/11/18 12:29] – [Usage] Refer to example.com. Link to ldap.com for query filter syntax dregad | v5:database:ldap [2023/11/18 23:45] (current) – mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== LDAP ====== | ====== LDAP ====== | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
+ | <WRAP important> | ||
+ | Use of ADODB_FETCH_NUM is strongly discouraged because AD records returned in queries may not all contain the same number of fields | ||
+ | </ | ||
+ | |||
<WRAP right box round 300px> | <WRAP right box round 300px> | ||
== Specification == | == Specification == | ||
^Driver Name|ldap| | ^Driver Name|ldap| | ||
^Data Provider|ldap| | ^Data Provider|ldap| | ||
- | ^Status|Inactive((This driver is not actively supported or enhanced by ADOdb project members, but you can provide fixes and enhancements if you have the expertise))| | + | ^Status|Active((This driver is actively supported or enhanced by ADOdb project members))| |
^Windows|Yes| | ^Windows|Yes| | ||
^Unix|Perhaps((We have never tried it except against Microsoft LDAP servers from Windows))| | ^Unix|Perhaps((We have never tried it except against Microsoft LDAP servers from Windows))| | ||
Line 13: | Line 17: | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | The '' | + | From ADOdb Versions 5.22.8 and 5.23.0, |
- | ===== Available Methods ===== | + | |
- | The following methods are available for use with the LDAP driver: | + | |
- | * [[v5: | ||
- | * [[v5: | ||
- | * [[v5: | ||
- | * [[v5: | ||
- | * [[v5: | ||
- | * [[v5: | ||
- | | ||
- | Calls to other methods when used with this driver may produce unexpected results or program failure. | ||
===== Usage ===== | ===== Usage ===== | ||
You must use standard [[https:// | You must use standard [[https:// | ||
+ | ------------------------------------------------------------ | ||
<code php> | <code php> | ||
- | $db = newAdoConnection(' | + | DEFINE(' |
+ | |||
+ | $db = ADOnewConnection(' | ||
+ | |||
+ | $db-> | ||
$baseDN | $baseDN | ||
$adServer = ' | $adServer = ' | ||
Line 38: | Line 37: | ||
$db-> | $db-> | ||
- | $result = $db->execute('(samaccountname=adodb)' | + | /* |
+ | * Find the first 2 records where the given name is adodb | ||
+ | */ | ||
+ | $result = $db->selectLimit('(givenname=adodb)' | ||
+ | while ($r = $result-> | ||
+ | { | ||
+ | print_r($r); | ||
+ | | ||
+ | } | ||
</ | </ | ||
+ | Returns the following data. Note that some elements may contain **array** or **binary** data. In this example, the 1st record contains 29 columns, and the second 30. | ||
+ | |||
+ | < | ||
+ | Array | ||
+ | ( | ||
+ | [CN] => ADODb Tester | ||
+ | [SN] => Tester | ||
+ | [GIVENNAME] => ADODb | ||
+ | [DISTINGUISHEDNAME] => CN=ADODb Tester, | ||
+ | [INSTANCETYPE] => 4 | ||
+ | [WHENCREATED] => 20231116231826.0Z | ||
+ | [WHENCHANGED] => 20231116231828.0Z | ||
+ | [DISPLAYNAME] => ADODb Tester | ||
+ | [USNCREATED] => 12794 | ||
+ | [USNCHANGED] => 12801 | ||
+ | [NAME] => ADODb Tester | ||
+ | [OBJECTGUID] => | ||
+ | [USERACCOUNTCONTROL] => 66048 | ||
+ | [BADPWDCOUNT] => 0 | ||
+ | [CODEPAGE] => 0 | ||
+ | [COUNTRYCODE] => 0 | ||
+ | [BADPASSWORDTIME] => 0 | ||
+ | [LASTLOGOFF] => 0 | ||
+ | [LASTLOGON] => 0 | ||
+ | [PWDLASTSET] => 133446503074682533 | ||
+ | [PRIMARYGROUPID] => 513 | ||
+ | [OBJECTSID] => | ||
+ | [ACCOUNTEXPIRES] => 9223372036854775807 | ||
+ | [LOGONCOUNT] => 0 | ||
+ | [SAMACCOUNTNAME] => adodb | ||
+ | [SAMACCOUNTTYPE] => 805306368 | ||
+ | [USERPRINCIPALNAME] => adodb@test.loc | ||
+ | [OBJECTCATEGORY] => CN=Person, | ||
+ | [DSCOREPROPAGATIONDATA] => Array | ||
+ | ( | ||
+ | [0] => 20231116231827.0Z | ||
+ | [1] => 16010101000000.0Z | ||
+ | ) | ||
+ | |||
+ | [OBJECTCLASS] => Array | ||
+ | ( | ||
+ | [0] => top | ||
+ | [1] => person | ||
+ | [2] => organizationalPerson | ||
+ | [3] => user | ||
+ | ) | ||
+ | |||
+ | ) | ||
+ | Array | ||
+ | ( | ||
+ | [CN] => ADOdb N. Tester | ||
+ | [SN] => Tester | ||
+ | [GIVENNAME] => ADOdb | ||
+ | [INITIALS] => N | ||
+ | [DISTINGUISHEDNAME] => CN=ADOdb N. Tester, | ||
+ | [INSTANCETYPE] => 4 | ||
+ | [WHENCREATED] => 20231118172808.0Z | ||
+ | [WHENCHANGED] => 20231118172809.0Z | ||
+ | [DISPLAYNAME] => ADOdb N. Tester | ||
+ | [USNCREATED] => 16413 | ||
+ | [USNCHANGED] => 16420 | ||
+ | [NAME] => ADOdb N. Tester | ||
+ | [OBJECTGUID] => | ||
+ | [USERACCOUNTCONTROL] => 66048 | ||
+ | [BADPWDCOUNT] => 0 | ||
+ | [CODEPAGE] => 0 | ||
+ | [COUNTRYCODE] => 0 | ||
+ | [BADPASSWORDTIME] => 0 | ||
+ | [LASTLOGOFF] => 0 | ||
+ | [LASTLOGON] => 0 | ||
+ | [PWDLASTSET] => 133448020890659722 | ||
+ | [PRIMARYGROUPID] => 513 | ||
+ | [OBJECTSID] => | ||
+ | [ACCOUNTEXPIRES] => 9223372036854775807 | ||
+ | [LOGONCOUNT] => 0 | ||
+ | [SAMACCOUNTNAME] => adodb2 | ||
+ | [SAMACCOUNTTYPE] => 805306368 | ||
+ | [USERPRINCIPALNAME] => adodb2@test.loc | ||
+ | [OBJECTCATEGORY] => CN=Person, | ||
+ | [DSCOREPROPAGATIONDATA] => Array | ||
+ | ( | ||
+ | [0] => 20231118172809.0Z | ||
+ | [1] => 16010101000000.0Z | ||
+ | ) | ||
+ | |||
+ | [OBJECTCLASS] => Array | ||
+ | ( | ||
+ | [0] => top | ||
+ | [1] => person | ||
+ | [2] => organizationalPerson | ||
+ | [3] => user | ||
+ | ) | ||
+ | |||
+ | ) | ||
+ | </ | ||
==== URI Connections ==== | ==== URI Connections ==== | ||
The **// | The **// | ||
Line 70: | Line 172: | ||
- | From ADOdb 5.22.7, default values set are as follows | + | From ADOdb 5.22.8 and 5.23.0, default values set are as follows |
^Parameter^Value^ | ^Parameter^Value^ | ||
Line 113: | Line 215: | ||
</ | </ | ||
- | {{tag>[dormant | + | {{tag> |
v5/database/ldap.1700306948.txt.gz · Last modified: 2023/11/18 12:29 by dregad