From 0a0bcf6bf4bdae5668eb457b37907a06df9cdafa Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 2 May 2007 08:34:57 +0000 Subject: [PATCH] Ignore config switch. Always figure out the best way to create the missing trees. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6220 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ldap.inc | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 3c0dfe257..8c5698a44 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -656,9 +656,7 @@ class LDAP{ $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"; @@ -694,7 +692,7 @@ class LDAP{ $na= array(); /* Automatic or traditional? */ - if(isset($config->data['MAIN']['SCHEMA_CHECK'])){ + if(count($classes)){ /* Get name of first matching objectClass */ $ocname= ""; @@ -777,6 +775,7 @@ class LDAP{ } } + function recursive_remove() { $delarray= array(); @@ -1360,6 +1359,7 @@ class LDAP{ } } + function get_naming_contexts($server, $admin= "", $password= "") { /* Build LDAP connection */ @@ -1371,13 +1371,33 @@ class LDAP{ $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: -- 2.30.2