summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e4478f3)
raw | patch | inline | side by side (parent: e4478f3)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 09:01:48 +0000 (09:01 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 09:01:48 +0000 (09:01 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6223 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 1a8ec8050393c2e349d4c20e942884d7d49c4538..087dd265e9ccae9a3a259b66c40063ae4f495240 100644 (file)
--- a/include/class_ldap.inc
+++ b/include/class_ldap.inc
$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;
}
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']);
}