[network-manager-pptp] gui: fix password saving/retrieval



commit 5b37c4c4aed02599b323ca84ccca289c141aca58
Author: Mikhail Efremov <sem altlinux org>
Date:   Mon Apr 4 21:29:42 2011 -0500

    gui: fix password saving/retrieval

 auth-dialog/main.c   |    3 ++-
 properties/nm-pptp.c |    6 ++++++
 2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index da7436e..5045201 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -226,7 +226,8 @@ main (int argc, char *argv[])
 		return 1;
 
 	/* dump the passwords to stdout */
-	printf ("%s\n%s\n", NM_PPTP_KEY_PASSWORD, password);
+	if (password)
+		printf ("%s\n%s\n", NM_PPTP_KEY_PASSWORD, password);
 	printf ("\n\n");
 
 	if (password) {
diff --git a/properties/nm-pptp.c b/properties/nm-pptp.c
index 5f609ba..b0edea9 100644
--- a/properties/nm-pptp.c
+++ b/properties/nm-pptp.c
@@ -388,6 +388,12 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
 	if (str && strlen (str))
 		nm_setting_vpn_add_data_item (s_vpn, NM_PPTP_KEY_USER, str);
 
+	/* User password */
+	widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "user_password_entry"));
+	str = gtk_entry_get_text (GTK_ENTRY (widget));
+	if (str && strlen (str))
+		nm_setting_vpn_add_secret (s_vpn, NM_PPTP_KEY_PASSWORD, str);
+
 	/* Domain */
 	widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "domain_entry"));
 	str = gtk_entry_get_text (GTK_ENTRY (widget));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]