From 7ba3be3f724a7124c28eaf71c2f9625f3becabbe Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 2 May 2007 09:28:01 +0000 Subject: [PATCH] Added white page git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6224 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ldap.inc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 087dd265e..0c45b1d48 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -1370,8 +1370,7 @@ class LDAP{ function get_naming_contexts($server, $admin= "", $password= "") { $attr= $this->get_root_dse($server, $admin, $password); - - return ($attr[0]['namingcontexts']); + return ($attr['namingcontexts']); } @@ -1389,9 +1388,21 @@ class LDAP{ $sr = @ldap_read ($ds, "", "objectClass=*", array("+")); $attr= @ldap_get_entries($ds,$sr); - print_a($attr); + /* Return empty array, if nothing was set */ + if (!isset($attr[0])){ + return array(); + } + + /* Rework array... */ + $result= array(); + for ($i= 0; $i<$attr[0]['count']; $i++){ + $result[$attr[0][$i]]= $attr[0][$attr[0][$i]]; + unset($result[$attr[0][$i]]['count']); + } + +print_a($result); - return ($attr); + return ($result); } -- 2.30.2