X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_ldap.inc;h=b3ae4983b38e7ac0bfd609cd4e391325114fc3b2;hb=f9e2a15ea3578c6c86efef30a0c8ebededefbb9e;hp=a93aa96c060f6376ce8bcbaf52aaf58100358618;hpb=fcca53e341721af298696d91f3cf1a49811bb4fa;p=gosa.git diff --git a/include/class_ldap.inc b/include/class_ldap.inc index a93aa96c0..b3ae4983b 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -991,7 +991,7 @@ class LDAP{ $ndn = split("#", $lineone[0]); $line = base64_decode($ndn[1]); - $dnn = split (":",$line); + $dnn = split (":",$line,2); $current_line = $ndn[0]; $dn = $dnn[0]; $value = $dnn[1]; @@ -1233,6 +1233,25 @@ class LDAP{ } } } + + function get_naming_contexts($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("namingContexts")); + $attr= @ldap_get_entries($ds,$sr); + + return ($attr[0]['namingcontexts']); + } + + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: