summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 71164a7)
raw | patch | inline | side by side (parent: 71164a7)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 09:28:01 +0000 (09:28 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 09:28:01 +0000 (09:28 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6224 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_ldap.inc | patch | blob | history |
diff --git a/include/class_ldap.inc b/include/class_ldap.inc
index 087dd265e9ccae9a3a259b66c40063ae4f495240..0c45b1d4859469805709d143348d9a96afa04ffb 100644 (file)
--- a/include/class_ldap.inc
+++ b/include/class_ldap.inc
function get_naming_contexts($server, $admin= "", $password= "")
{
$attr= $this->get_root_dse($server, $admin, $password);
-
- return ($attr[0]['namingcontexts']);
+ return ($attr['namingcontexts']);
}
$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);
}