balsa r8001 - in trunk: . libbalsa src
- From: pawels svn gnome org
- To: svn-commits-list gnome org
- Subject: balsa r8001 - in trunk: . libbalsa src
- Date: Fri, 21 Nov 2008 17:30:23 +0000 (UTC)
Author: pawels
Date: Fri Nov 21 17:30:22 2008
New Revision: 8001
URL: http://svn.gnome.org/viewvc/balsa?rev=8001&view=rev
Log:
* src/save-restore.c: connect signal to ask interactively for SMTP passwords.
* src/balsa-app.c: display the type of the password (imap/smtp).
* libbalsa/smtp-server.c: ask for password when one needs one.
Modified:
trunk/ChangeLog
trunk/libbalsa/smtp-server.c
trunk/src/balsa-app.c
trunk/src/save-restore.c
Modified: trunk/libbalsa/smtp-server.c
==============================================================================
--- trunk/libbalsa/smtp-server.c (original)
+++ trunk/libbalsa/smtp-server.c Fri Nov 21 17:30:22 2008
@@ -107,8 +107,15 @@
int i;
for (i = 0; i < fields; i++) {
- if (request[i].flags & AUTH_PASS)
+ if (request[i].flags & AUTH_PASS) {
+ /* We need to return a const pointer, this is why we
+ ignore the result from get_password, and take and
+ advantage of the fact that this function sets the
+ passwd field of the server. */
+ if(!server->passwd)
+ g_free(libbalsa_server_get_password(server, NULL));
result[i] = server->passwd;
+ }
else if (request[i].flags & AUTH_USER)
result[i] = (server->user
&& *server->user) ? server->user : NULL;
@@ -203,6 +210,9 @@
smtp_server = g_object_new(LIBBALSA_TYPE_SMTP_SERVER, NULL);
+ /* Change the default. */
+ LIBBALSA_SERVER(smtp_server)->remember_passwd = TRUE;
+
return smtp_server;
}
@@ -234,8 +244,6 @@
void
libbalsa_smtp_server_save_config(LibBalsaSmtpServer * smtp_server)
{
- /* FIXME: isn't it a bit of a brute force? */
- LIBBALSA_SERVER(smtp_server)->remember_passwd = TRUE;
libbalsa_server_save_config(LIBBALSA_SERVER(smtp_server));
#if HAVE_SMTP_TLS_CLIENT_CERTIFICATE
Modified: trunk/src/balsa-app.c
==============================================================================
--- trunk/src/balsa-app.c (original)
+++ trunk/src/balsa-app.c Fri Nov 21 17:30:22 2008
@@ -83,8 +83,8 @@
mbox->name, server->user, server->host);
else
prompt =
- g_strdup_printf(_("Mailbox _password for %s %s:"), server->user,
- server->host);
+ g_strdup_printf(_("_Password for %s %s (%s):"), server->user,
+ server->host, server->protocol);
dialog = gtk_dialog_new_with_buttons(_("Password needed"),
GTK_WINDOW(balsa_app.main_window),
Modified: trunk/src/save-restore.c
==============================================================================
--- trunk/src/save-restore.c (original)
+++ trunk/src/save-restore.c Fri Nov 21 17:30:22 2008
@@ -488,6 +488,8 @@
libbalsa_conf_push_group(key);
smtp_server = libbalsa_smtp_server_new_from_config(value);
+ libbalsa_server_connect_signals(LIBBALSA_SERVER(smtp_server),
+ G_CALLBACK(ask_password), NULL);
libbalsa_conf_pop_group();
libbalsa_smtp_server_add_to_list(smtp_server, smtp_servers);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]