summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ba3be3)
raw | patch | inline | side by side (parent: 7ba3be3)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 09:42:12 +0000 (09:42 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 09:42:12 +0000 (09:42 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6225 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 0c45b1d4859469805709d143348d9a96afa04ffb..c1869a9f966efdf8bc9e4dfc09fb8dda14136b61 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['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']);
}
unset($result[$attr[0][$i]]['count']);
}
-print_a($result);
-
return ($result);
}