mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-23 02:19:07 +01:00
- LSattr_html_select_list : utilisation de LSldapObject :: search()
plus légère que LSldapObject :: listObjects() pour former la liste
This commit is contained in:
parent
41767dde3d
commit
179151ebc9
1 changed files with 14 additions and 4 deletions
|
@ -94,16 +94,26 @@ class LSattr_html_select_list extends LSattr_html{
|
||||||
else {
|
else {
|
||||||
$param=array();
|
$param=array();
|
||||||
}
|
}
|
||||||
$list = $obj -> listObjects($val['filter'],$this -> config['possible_values']['basedn'],$param);
|
|
||||||
|
$param['attributes'] = getFieldInFormat($val['display_attribute']);
|
||||||
|
|
||||||
|
if ($val['value_attribute']!='dn') {
|
||||||
|
$param['attributes'][] = $val['value_attribute'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$list = $obj -> search($val['filter'],$this -> config['possible_values']['basedn'],$param);
|
||||||
if(($val['value_attribute']=='dn')||($val['value_attribute']=='%{dn}')) {
|
if(($val['value_attribute']=='dn')||($val['value_attribute']=='%{dn}')) {
|
||||||
for($i=0;$i<count($list);$i++) {
|
for($i=0;$i<count($list);$i++) {
|
||||||
$retInfos[$list[$i] -> dn]=$list[$i] -> getDisplayValue($val['display_attribute']);
|
$retInfos[$list[$i]['dn']]=getFData($val['display_attribute'],$list[$i]['attrs']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for($i=0;$i<count($list);$i++) {
|
for($i=0;$i<count($list);$i++) {
|
||||||
$key = $list[$i] -> attrs[$val['value_attribute']] -> getValue();
|
$key = $list[$i]['attrs'][$val['value_attribute']];
|
||||||
$retInfos[$key[0]]=$list[$i] -> getDisplayValue($val['display_attribute']);
|
if(is_array($key)) {
|
||||||
|
$key = $key[0];
|
||||||
|
}
|
||||||
|
$retInfos[$key]=getFData($val['display_attribute'],$list[$i]['attrs']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue