Changeset 3186
- Timestamp:
- 08/31/10 16:23:09 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/workflow/inc/class.WorkflowLDAP.inc.php
r3167 r3186 513 513 function getNames($entitiesID) 514 514 { 515 516 /* if parameter is not array make a new array with value in entitiesID */ 517 if(!is_array($entitiesID)) 518 $entitiesID = array($entitiesID); 519 515 520 /* check if the required information is in cache */ 516 521 $methodName = 'getNames'; … … 530 535 /* load the entity information ten entities at a time. This approach was proven to be faster on some systems */ 531 536 $result = array(); 537 532 538 while (count($entitiesID) > 0) 533 539 { 534 540 $selectedEntitiesID = array_splice($entitiesID, 0, 10); 535 $resourceIdentifier = ldap_search($this->dataSource, $this->ldapContext, "(|" . implode('', array_map(create_function('$a', 'return "(|(&(uidnumber={$a})(|(phpgwaccounttype=u)(phpgwaccounttype=l)))(&(gidnumber={$a})(phpgwaccounttype=g)))";'), array_unique($selectedEntitiesID))) . ')', array('cn', 'uidnumber', 'gidnumber', 'phpgwaccounttype')); 541 542 /* if parameter is null make array without values */ 543 if(!is_array($entitiesID)) 544 $entitiesID = array(); 545 $resourceIdentifier = ldap_search( 546 $this->dataSource, 547 $this->ldapContext, 548 sprintf( 549 '(&(|%s)(|(phpgwaccounttype=u)(phpgwaccounttype=l)(phpgwaccounttype=g)))', 550 implode( 551 '', 552 array_map( 553 create_function('$a', 'return "(uidnumber={$a})(gidnumber={$a})";'), 554 array_unique($selectedEntitiesID) 555 ) 556 ) 557 ), 558 array('cn', 'uidnumber', 'gidnumber', 'phpgwaccounttype') 559 ); 560 536 561 $result = array_merge($result, ldap_get_entries($this->dataSource, $resourceIdentifier)); 537 562 unset($result['count']); 538 563 } 564 539 565 540 566 $output = array();
Note: See TracChangeset
for help on using the changeset viewer.