From:             rr dot rossmann at me dot com
Operating system: OS X
PHP version:      5.4.10
Package:          LDAP related
Bug Type:         Bug
Bug description:Parallel search does not accept array of attribute arrays

Description:
------------
When doing an ldap parallel search, it is not possible to specify the
attributes I want to retrieve per-query, only per operation.

I want to read a set of properties for a read operation of i.e.
OU=Computers,DC=example,DC=com and a different set of properties for
OU=Users,DC=example,DC=com . I want to do a parallel read operation by
combining all the query parameters (links, search bases etc.) into arrays,
but I cannot group the attributes arrays as such; I can only provide one
array with the attributes, otherwise only DN is returned in the resultset.

Test script:
---------------
$con = ldap_connect( 'example.com' );

ldap_set_option( $con, LDAP_OPT_PROTOCOL_VERSION, 3 );
ldap_set_option( $con, LDAP_OPT_REFERRALS, 0 );

ldap_bind( $con, 'User', 'password' );

// use the same connection for both read queries
$connections = array( $con, $con );

// Read attribs from Computers and Users containers
$dns = array( 'OU=Computers,DC=example,DC=com',
'OU=Users,DC=example,DC=com' );

// Needed for the read operation
$filters = array( '(objectclass=*)', '(objectclass=*)' );

$attribSet1 = array( 'name', 'objectclass' ); // attribs I want from
Computers
$attribSet2 = array( 'cn', 'objectcategory' ); // attribs I want from
Users

// Combining the attributes like this causes the erroneous behaviour
$getThese = array( $attribSet1 , $attribSet2 );

// Do a parallel read operation
$result_ids = ldap_read( $connections, $dns, $filters, $getThese );

$data0 = ldap_get_entries( $con, $result_ids[0] );
$data1 = ldap_get_entries( $con, $result_ids[1] );

print_r( $data0 ); // Only DN attribute retrieved
print_r( $data1 ); // Only DN attribute retrieved

/*
Doing the read query like this works, but I have to specify the attribute
set for the whole operation:
$result_ids = ldap_read( $connections, $dns, $filters, $getThese[0] );
*/

Expected result:
----------------
for print_r( $data0 ); I expect to have these attributes present:
name, objectclass

for print_r( $data1 ); I expect to have these attributes present:
cn, objectcategory

Actual result:
--------------
I get only dn attribute, which is returned for every ldap query

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63820&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63820&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63820&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63820&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63820&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63820&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63820&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63820&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63820&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63820&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63820&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63820&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63820&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63820&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63820&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63820&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63820&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63820&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63820&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63820&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63820&r=mysqlcfg

Reply via email to