From: cajus Date: Wed, 2 May 2007 09:42:12 +0000 (+0000) Subject: Removed white screen X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9e9e337cef0aba290ce0be61bbce7f68987a4e2c;p=gosa.git Removed white screen git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6225 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 0c45b1d48..c1869a9f9 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -1369,8 +1369,19 @@ class LDAP{ function get_naming_contexts($server, $admin= "", $password= "") { - $attr= $this->get_root_dse($server, $admin, $password); - return ($attr['namingcontexts']); + /* Build LDAP connection */ + $ds= ldap_connect ($server); + if (!$ds) { + die ("Can't bind to LDAP. No check possible!"); + } + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + $r= ldap_bind ($ds, $admin, $password); + + /* Get base to look for naming contexts */ + $sr = @ldap_read ($ds, "", "objectClass=*", array("+")); + $attr= @ldap_get_entries($ds,$sr); + + return ($attr[0]['namingcontexts']); } @@ -1400,8 +1411,6 @@ class LDAP{ unset($result[$attr[0][$i]]['count']); } -print_a($result); - return ($result); }