From 179151ebc9790be2df48d2e3d53eb10bf41524a1 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sun, 9 Nov 2008 16:49:30 +0000 Subject: [PATCH] =?UTF-8?q?-=20LSattr=5Fhtml=5Fselect=5Flist=20:=20utilisa?= =?UTF-8?q?tion=20de=20LSldapObject=20::=20search()=20=09plus=20l=C3=A9g?= =?UTF-8?q?=C3=A8re=20que=20LSldapObject=20::=20listObjects()=20pour=20for?= =?UTF-8?q?mer=20la=20liste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../class/class.LSattr_html_select_list.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/trunk/includes/class/class.LSattr_html_select_list.php b/trunk/includes/class/class.LSattr_html_select_list.php index 5e94d99f..c1e00fbc 100644 --- a/trunk/includes/class/class.LSattr_html_select_list.php +++ b/trunk/includes/class/class.LSattr_html_select_list.php @@ -94,16 +94,26 @@ class LSattr_html_select_list extends LSattr_html{ else { $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}')) { for($i=0;$i dn]=$list[$i] -> getDisplayValue($val['display_attribute']); + $retInfos[$list[$i]['dn']]=getFData($val['display_attribute'],$list[$i]['attrs']); } } else { for($i=0;$i attrs[$val['value_attribute']] -> getValue(); - $retInfos[$key[0]]=$list[$i] -> getDisplayValue($val['display_attribute']); + $key = $list[$i]['attrs'][$val['value_attribute']]; + if(is_array($key)) { + $key = $key[0]; + } + $retInfos[$key]=getFData($val['display_attribute'],$list[$i]['attrs']); } } }