/*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2003-2012 Michael Rasmussen and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2003-2018 Michael Rasmussen and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
*/
/*
#include "utils.h"
#include "adbookbase.h"
#include "editaddress_other_attributes_ldap.h"
+#include "log.h"
/**
* Structure to hold user defined attributes
rc = ldap_search_ext_s(ld, ctl->baseDN, LDAP_SCOPE_ONELEVEL, filter, NULL, 0, NULL, NULL, NULL, 0, &res);
if (rc) {
- g_printerr("ldap_search for attr=%s\" failed[0x%x]: %s\n",attr, rc, ldaputil_get_error(ld));
+ log_error(LOG_PROTOCOL, _("LDAP error (search): for attribute '%s': %d (%s)\n"),
+ attr, rc, ldaputil_get_error(ld));
retVal = -2;
}
else {
server->retVal = LDAPRC_ALREADY_EXIST;
break;
default:
- g_printerr("ldap_modify for dn=%s\" failed[0x%x]: %s\n", dn, rc, ldaputil_get_error(ld));
+ log_error(LOG_PROTOCOL, _("LDAP error (modify): for DN '%s': %d (%s)\n"),
+ dn, rc, ldaputil_get_error(ld));
if (rc == 0x8)
server->retVal = LDAPRC_STRONG_AUTH;
else
server->retVal = LDAPRC_ALREADY_EXIST;
break;
default:
- g_printerr("ldap_modify for dn=%s\" failed[0x%x]: %s\n",
+ log_error(LOG_PROTOCOL, _("LDAP error (modify): for DN '%s': %d (%s)\n"),
base_dn, rc, ldaputil_get_error(ld));
if (rc == 0x8)
server->retVal = LDAPRC_STRONG_AUTH;
*/
}
else {
- g_printerr("Current dn: %s\n", dn);
- g_printerr("new dn: %s\n", newRdn);
- g_printerr("LDAP Error(ldap_modrdn2_s) failed[0x%x]: %s\n", rc, ldaputil_get_error(ld));
+ log_error(LOG_PROTOCOL, _("LDAP error (rename): from '%s' to '%s': %d (%s)\n"),
+ dn, newRdn, rc, ldaputil_get_error(ld));
g_free(newRdn);
clean_up(ld, server, contact);
return;
mods[cnt] = NULL;
rc = ldap_modify_ext_s(ld, dn, mods, NULL, NULL);
if (rc) {
- g_printerr("ldap_modify for dn=%s\" failed[0x%x]: %s\n",
- dn, rc, ldaputil_get_error(ld));
+ log_error(LOG_PROTOCOL, _("LDAP error (modify): for DN '%s': %d (%s)\n"),
+ dn, rc, ldaputil_get_error(ld));
server->retVal = LDAPRC_NAMING_VIOLATION;
}
if (mail)
server->retVal = LDAPRC_SUCCESS;
rc = ldap_delete_ext_s(ld, dn, NULL, NULL);
if (rc) {
- g_printerr("ldap_modify for dn=%s\" failed[0x%x]: %s\n",
+ log_error(LOG_PROTOCOL, _("LDAP error (modify): for DN '%s': %d (%s)\n"),
dn, rc, ldaputil_get_error(ld));
server->retVal = LDAPRC_NODN;
}