From b56c3325a4f895224555a0f5034619758d1c684a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 21 Dec 2009 12:19:02 +0000 Subject: [PATCH] Fix: view LDAP attributes of entry --- htdocs/lib/ldap.lib.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/htdocs/lib/ldap.lib.php b/htdocs/lib/ldap.lib.php index 6e73cfbf40f..689b8e5fcce 100644 --- a/htdocs/lib/ldap.lib.php +++ b/htdocs/lib/ldap.lib.php @@ -116,7 +116,7 @@ function show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass) * @param unknown_type $hide * @return unknown */ -function show_ldap_content($result,$level,$count,$var,$hide=0) +function show_ldap_content($result,$level,$count,$var,$hide=0,$subcount=0) { global $bc, $conf; @@ -129,9 +129,7 @@ function show_ldap_content($result,$level,$count,$var,$hide=0) if ("$key" == "objectclass") continue; if ("$key" == "count") continue; if ("$key" == "dn") continue; - if ("$val" == "objectclass") continue; - //if ("$val" == $lastkey[$level]) continue; $lastkey[$level]=$key; @@ -141,22 +139,23 @@ function show_ldap_content($result,$level,$count,$var,$hide=0) if (! is_numeric($key)) { $var=!$var; - print ''; + print ''; print ''; print $key; print ''; if (strtolower($key) == 'userpassword') $hide=1; } - show_ldap_content($val,$level+1,$count,$var,$hide); + show_ldap_content($val,$level+1,$count,$var,$hide,$val["count"]); } - else + else if ($subcount) { + $subcount--; $newstring=@htmlentities($val,ENT_COMPAT,'UTF-8'); // Make entity encoding if ($hide) print preg_replace('/./i','*',$newstring); else print $newstring; - if ("$val" == $lastkey[$level]) print '
'; + print '
'; } - if ("$val" != $lastkey[$level]) print ''; + if ("$val" != $lastkey[$level] && !$subcount) print ''; } return 1; }