[network-manager-pptp/NM_0_8] Fix saving secrets in system scope



commit eef9a394169faf70e4172388932eabcc0e7647c6
Author: Ozan ÃaÄlayan <ozan pardus org tr>
Date:   Wed Aug 17 13:51:43 2011 +0300

    Fix saving secrets in system scope

 properties/nm-pptp.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/properties/nm-pptp.c b/properties/nm-pptp.c
index 39f2447..bc43a79 100644
--- a/properties/nm-pptp.c
+++ b/properties/nm-pptp.c
@@ -408,6 +408,17 @@ update_connection (NMVpnPluginUiWidgetInterface *iface,
 	if (priv->advanced)
 		g_hash_table_foreach (priv->advanced, hash_copy_advanced, s_vpn);
 
+	/* System secrets get stored in the connection, user secrets are saved
+	 * via the save_secrets() hook.
+	 */
+	if (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM) {
+		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);
+		}
+	}
+
 	nm_connection_add_setting (connection, NM_SETTING (s_vpn));
 	valid = TRUE;
 



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