note 107340 added to function.ldap-search
| From: | Jean-Loup | Date: | Wed, 01 Feb 2012 18:27:38 +0000 |
| Subject: | note 107340 added to function.ldap-search | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185819@lists.php.net to get a copy of this message | ||
Example of parallel search :
<?php
$basedn=array('dmdName=users,dc=foo,dc=fr','dmdName=users,dc=bar,dc=com'); //
two basedn
$filter='(&(objectClass=inetOrgPerson)(uid=*))'; // single filter
$attributes=array('dn','uid','sn');
$cnx = ldap_connect('localhost',389); // single connection
ldap_set_option($cnx, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_bind($cnx,'uid=root,dc=foo,dc=fr','password'); // authentication on two
BDB
ldap_bind($cnx,'uid=root,dc=bar,dc=com','password');
$search = ldap_search(array($cnx,$cnx),$basedn,$filter,$attributes); // search
// result
for($i=0;$i<count($search);$i++){
print_r(ldap_get_entries($cnx,$search[$i]));
print "\n";
}
?>
----
Server IP: 195.221.21.36
Probable Submitter: 82.247.171.28
----
Manual Page -- http://www.php.net/manual/en/function.ldap-search.php
Edit -- https://master.php.net/note/edit/107340
Del: integrated -- https://master.php.net/note/delete/107340/integrated
Del: useless -- https://master.php.net/note/delete/107340/useless
Del: bad code -- https://master.php.net/note/delete/107340/bad+code
Del: spam -- https://master.php.net/note/delete/107340/spam
Del: non-english -- https://master.php.net/note/delete/107340/non-english
Del: in docs -- https://master.php.net/note/delete/107340/in+docs
Del: other reasons-- https://master.php.net/note/delete/107340
Reject -- https://master.php.net/note/reject/107340
Search -- https://master.php.net/manage/user-notes.php