From: cajus Date: Wed, 2 May 2007 09:01:48 +0000 (+0000) Subject: Added return values X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=71164a7278ea9607f9a22173ee67304baa48ce95;p=gosa.git Added return values git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6223 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 1a8ec8050..087dd265e 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -773,8 +773,13 @@ class LDAP{ $this->cd($cdn); $this->add($na); show_ldap_error($this->get_error(), sprintf(_("Creating subtree '%s' failed."),$cdn)); + if (!preg_match('/success/i', $this->error)){ + return FALSE; + } } } + + return TRUE; } @@ -1364,17 +1369,7 @@ 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); + $attr= $this->get_root_dse($server, $admin, $password); return ($attr[0]['namingcontexts']); }