/*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2001-2013 Match Grun and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2001-2015 Match Grun 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 "manage_window.h"
#include "gtkutils.h"
#include "prefs_gtk.h"
+#include "passwordstore.h"
#define PAGE_BASIC 0
#define PAGE_SEARCH 1
ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ldapedit.enable_ssl));
#endif
- g_strchomp( sHost ); g_strchug( sHost );
- g_strchomp( sBind ); g_strchug( sBind );
- g_strchomp( sPass ); g_strchug( sPass );
+ g_strstrip( sHost );
+ g_strstrip( sBind );
+ g_strstrip( sPass );
if( *sHost != '\0' ) {
/* Test connection to server */
debug_print("ldap server: %s\nport: %d\nssl: %d\ntls: %d\nbindDN: %s\n", sHost, iPort, ssl, tls, sBind);
ssl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ldapedit.enable_ssl));
#endif
- g_strchomp( sHost ); g_strchug( sHost );
- g_strchomp( sBind ); g_strchug( sBind );
- g_strchomp( sPass ); g_strchug( sPass );
+ g_strstrip( sHost );
+ g_strstrip( sBind );
+ g_strstrip( sPass );
debug_print("ldap server: %s\nport: %d\nssl: %d\ntls: %d\nbindDN: %s\n", sHost, iPort, ssl, tls, sBind);
selectDN = edit_ldap_basedn_selection( sHost, iPort, sBase, iTime, sBind, sPass, ssl, tls );
if( selectDN ) {
CLAWS_SET_TIP(entry_server, _(
"This is the hostname of the server. For example, " \
- "\"ldap.mydomain.com\" may be appropriate for the " \
- "\"mydomain.com\" organization. An IP address may also be " \
+ "\"ldap.example.org\" may be appropriate for the " \
+ "\"exmaple.org\" organization. An IP address may also be " \
"used. You may specify \"localhost\" if running an LDAP " \
"server on the same computer as Claws Mail." ));
"If connection fails, be sure to check the correct "
"configuration in ldap.conf (TLS_CACERTDIR and TLS_REQCERT fields)." ));
-#ifdef G_OS_UNIX /* Win32's ldap_start_tls_s() does not work, for some reason. */
gtk_box_pack_start (GTK_BOX (hbox_spin), enable_tls_checkbtn, TRUE, FALSE, 0);
-#endif
gtk_box_pack_start (GTK_BOX (hbox_spin), enable_ssl_checkbtn, TRUE, FALSE, 0);
#endif
static void edit_ldap_set_fields( LdapServer *server ) {
LdapControl *ctl;
gchar *crit;
- gchar *pwd;
if( ldapsvr_get_name( server ) )
gtk_entry_set_text(GTK_ENTRY(ldapedit.entry_name),
if( ctl->bindDN )
gtk_entry_set_text(
GTK_ENTRY(ldapedit.entry_bindDN), ctl->bindDN );
- if( ctl->bindPass ) {
- pwd = ldapctl_get_bind_password( ctl );
- gtk_entry_set_text( GTK_ENTRY(ldapedit.entry_bindPW), pwd );
- g_free(pwd);
- }
+ gtk_entry_set_text( GTK_ENTRY(ldapedit.entry_bindPW),
+ passwd_store_get(PWS_CORE, "LDAP", ctl->hostName));
gtk_spin_button_set_value(
GTK_SPIN_BUTTON(ldapedit.spinbtn_timeout), ctl->timeOut );
gtk_spin_button_set_value(
ldapctl_set_host( ctl, sHost );
ldapctl_set_base_dn( ctl, sBase );
ldapctl_set_bind_dn( ctl, sBind );
- ldapctl_set_bind_password( ctl, sPass, TRUE, TRUE );
ldapctl_set_port( ctl, iPort );
ldapctl_set_max_entries( ctl, iMaxE );
ldapctl_set_timeout( ctl, iTime );
addrindex_save_data(addrIndex);
+ passwd_store_set(PWS_CORE, "LDAP", sHost, sPass, FALSE);
+ passwd_store_write_config();
+
/* Save attributes */
editldap_parse_criteria( sCrit, ctl );
g_free( sHost );
g_free( sBase );
g_free( sBind );
- g_free( sPass );
g_free( sCrit );
+ if (sPass != NULL && strlen(sPass) > 0)
+ memset(sPass, 0, strlen(sPass));
+ g_free( sPass );
+
return ads;
}