- LSselect && LSattr_html_select_object : Optimisation des recherches en utilisant

LSldapObject :: listObjectsName()
This commit is contained in:
Benjamin Renard 2008-11-09 01:40:18 +00:00
parent 77bfd98a32
commit 4dca97074b
2 changed files with 11 additions and 11 deletions

View file

@ -159,10 +159,10 @@ class LSattr_html_select_object extends LSattr_html{
if ($filter!='') {
$filter='(|'.$filter.')';
$obj = new $conf['object_type']();
$listobj = $obj -> listObjects($filter);
foreach($listobj as $one) {
$DNs[]=$one -> getDn();
$retInfos[$one -> getDn()] = $one -> getDisplayValue($conf['display_attribute']);
$listobj = $obj -> listObjectsName($filter,NULL,array(),$conf['display_attribute']);
foreach($listobj as $dn => $name) {
$DNs[]=$dn;
$retInfos[$dn] = $name;
}
}
}

View file

@ -202,31 +202,31 @@ if($LSsession -> startLSsession()) {
'action' => 'refresh'
);
$list=$object -> listObjects($filter,$topDn,$params);
$list=$object -> listObjectsName($filter,$topDn,$params);
$nbObjects=count($list);
$searchData['LSobject_list_nbresult']=$nbObjects;
$c=0;
foreach($list as $thisObject) {
if ($GLOBALS['LSsession'] -> canAccess($LSobject,$thisObject->getValue('dn'))) {
foreach($list as $objDn => $objName) {
if ($GLOBALS['LSsession'] -> canAccess($LSobject,$objDn)) {
$c++;
unset($actions);
$subDn_name=false;
if ($doSubDn) {
$subDn_name = $thisObject -> getSubDnName();
$subDn_name = $object -> getSubDnName($objDn);
}
$objectList[]=array(
'dn' => $thisObject->getValue('dn'),
'displayValue' => $thisObject->getDisplayValue(),
'dn' => $objDn,
'displayValue' => $objName,
'subDn' => $subDn_name
);
}
else {
LSdebug($thisObject->getValue('dn'));
LSdebug($dn);
}
}
$searchData['objectList']=$objectList;