better error messages if ldap_add() fails

This commit is contained in:
Roland Gruber 2003-11-13 18:52:44 +00:00
parent e00ffb4cc0
commit d1541119ad
1 changed files with 2 additions and 2 deletions

View File

@ -275,10 +275,10 @@ elseif ($_POST['sub_save']) {
if ($_POST['dom_nextUserRID']) $attr['sambaNextUserRid'] = $_POST['dom_nextUserRID'];
$attr['sambaAlgorithmicRidBase'] = $_POST['dom_RIDbase'];
// write to LDAP
if (ldap_add($_SESSION['ldap']->server(), $DN, $attr)) {
if (@ldap_add($_SESSION['ldap']->server(), $DN, $attr)) {
StatusMessage("INFO", "Domain has been created.", $DN);
}
else StatusMessage("ERROR", "", "Failed to add domain!");
else StatusMessage("ERROR", "", "Failed to add domain!" . "\n<br>" . ldap_error($_SESSION['ldap']->server()));
}
echo "<p>&nbsp;</p>\n";
echo "<p><a href=\"lists/listdomains.php\">" . _("Back to domain list") . "</a></p>\n";