ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:database:ldap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
v5:database:ldap [2023/06/04 11:41] – ↷ Links adapted because of a move operation dregadv5:database:ldap [2023/11/17 15:39] mnewnham
Line 17: Line 17:
 The following methods are available for use with the LDAP driver: The following methods are available for use with the LDAP driver:
  
 +  * [[v5:reference:connection:getassoc|execute()]]
   * [[v5:reference:connection:getassoc|getAssoc()]]   * [[v5:reference:connection:getassoc|getAssoc()]]
   * [[v5:reference:connection:selectdb|selectDb()]]   * [[v5:reference:connection:selectdb|selectDb()]]
   * [[v5:reference:connection:serverinfo|serverInfo()]]   * [[v5:reference:connection:serverinfo|serverInfo()]]
   * [[v5:reference:connection:getrowassoc|getRowAssoc()]]   * [[v5:reference:connection:getrowassoc|getRowAssoc()]]
 +  * [[v5:reference:connection:setConnectionParameter|setConnectionParameter()]]
      
 Calls to other methods when used with this driver may produce unexpected results or program failure.  Calls to other methods when used with this driver may produce unexpected results or program failure. 
Line 26: Line 28:
 <code php> <code php>
 $db = newAdoConnection('ldap'); $db = newAdoConnection('ldap');
 +$baseDN   = 'dc=test,dc=loc';
 +$adServer = '192.168.1.16';
 +$user     = 'adodb@test.loc';
 +$password = 'adodb!';
 +
 +$db->connect($adServer,$user,$password,$baseDN);
 +
 +$result = $db->execute('(samaccountname=adodb)');
  
 </code> </code>
  
-===== Custom Functionality ===== +===== Connection Parameters ===== 
-If defined prior to connection, the following variables will be passed as input bind variables. + 
-Valid Domain Values for LDAP Connection Options:+The following values may be injected into the connection via the use of [[v5:reference:connection:getrowassoc|setConnectionParameter()]] 
  
 ^ OPTION_NAME ^ Type ^ ^ OPTION_NAME ^ Type ^
Line 47: Line 58:
 | ''LDAP_OPT_CLIENT_CONTROLS'' | array | | ''LDAP_OPT_CLIENT_CONTROLS'' | array |
  
-Make sure to set this BEFORE calling Connect() + 
-Example:+From ADOdb 5.22.7, default values set are as follows 
 + 
 +^Parameter^Value^ 
 +|LDAP_OPT_PROTOCOL_VERSION|3| 
 +|LDAP_OPT_REFERRALS|0| 
 + 
 +These values can be changed with **//setConnectionParameter()//** 
 + 
 +The following usage method is deprecated in PHP8.2 and will not work with PHP 8.3. Use **//setConnectionParameter()//** instead.  
 <code php> <code php>
 $LDAP_CONNECT_OPTIONS = Array( $LDAP_CONNECT_OPTIONS = Array(
Line 64: Line 84:
  ),  ),
  Array (  Array (
- "OPTION_NAME"=>LDAP_OPT_PROTOCOL_VERSION,+ "OPTION_NAME"=>,
  "OPTION_VALUE"=>3  "OPTION_VALUE"=>3
  ),  ),
v5/database/ldap.txt · Last modified: 2023/11/18 23:45 by mnewnham