summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 12f4329)
raw | patch | inline | side by side (parent: 12f4329)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 08:34:57 +0000 (08:34 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 08:34:57 +0000 (08:34 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6220 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 3c0dfe2572e3606cb58443bae0bfc1d11335d1df..8c5698a44833f6e3ffa7507271770bb526b59769 100644 (file)
--- a/include/class_ldap.inc
+++ b/include/class_ldap.inc
$tag= "";
/* Load schema if available... */
- if(isset($config->data['MAIN']['SCHEMA_CHECK'])){
- $classes= $this->get_objectclasses();
- }
+ $classes= $this->get_objectclasses();
foreach ($l as $part){
$cdn= "$part,$cdn";
$na= array();
/* Automatic or traditional? */
- if(isset($config->data['MAIN']['SCHEMA_CHECK'])){
+ if(count($classes)){
/* Get name of first matching objectClass */
$ocname= "";
}
}
+
function recursive_remove()
{
$delarray= array();
}
}
+
function get_naming_contexts($server, $admin= "", $password= "")
{
/* Build LDAP connection */
$r= ldap_bind ($ds, $admin, $password);
/* Get base to look for naming contexts */
- $sr = @ldap_read ($ds, "", "objectClass=*", array("namingContexts"));
+ $sr = @ldap_read ($ds, "", "objectClass=*", array("namingContexts", ));
$attr= @ldap_get_entries($ds,$sr);
return ($attr[0]['namingcontexts']);
}
+ function get_root_dse($server, $admin= "", $password= "")
+ {
+ /* 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);
+
+ print_a($attr);
+
+ return ($attr);
+ }
+
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: