Commit 3422f17c authored by Antenore Gatta's avatar Antenore Gatta

SSH tunnel enabled only when set

parent d0ec6517
......@@ -856,13 +856,8 @@ static void remmina_file_editor_create_ssh_tab(RemminaFileEditor* gfe, RemminaPr
/* SSH Authentication frame */
p = remmina_public_combo_get_active_text(GTK_COMBO_BOX(priv->protocol_combo));
g_print("p = %s\n", p);
gint n;
n = g_strcmp0(p, "SSH");
g_print("Comp of p = %d\n", n);
if (!(g_strcmp0(p, "SFTP") == 0 || g_strcmp0(p, "SSH") == 0))
{
g_print("p is %s, quindi visualizzo\n", p);
remmina_public_create_group (GTK_GRID(grid), _("SSH Authentication"), row + 8, 6, 1);
row++;
......@@ -1020,22 +1015,13 @@ static void remmina_file_editor_update_ssh(RemminaFileEditor* gfe)
remmina_public_combo_get_active_text(GTK_COMBO_BOX(priv->ssh_charset_combo)));
}
if (g_strcmp0(remmina_file_get_string(priv->remmina_file, "protocol"), "SFTP") == 0
|| g_strcmp0(remmina_file_get_string(priv->remmina_file, "protocol"), "SSH") == 0)
{
ssh_enabled = TRUE;
}
else
{
ssh_enabled = (priv->ssh_enabled_check ?
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->ssh_enabled_check)) : FALSE);
remmina_file_set_int(
priv->remmina_file,
"ssh_loopback",
(priv->ssh_loopback_check ?
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->ssh_loopback_check)) :
FALSE));
}
ssh_enabled = (priv->ssh_enabled_check ?
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->ssh_enabled_check)) : FALSE);
remmina_file_set_int( priv->remmina_file,
"ssh_loopback",
(priv->ssh_loopback_check ?
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->ssh_loopback_check)) :
FALSE));
remmina_file_set_int(priv->remmina_file, "ssh_enabled", ssh_enabled);
remmina_file_set_string(priv->remmina_file, "ssh_username",
(ssh_enabled ? gtk_entry_get_text(GTK_ENTRY(priv->ssh_username_entry)) : NULL));
......
......@@ -302,6 +302,7 @@ remmina_ssh_auth (RemminaSSH *ssh, const gchar *password)
ssh->password = g_strdup (password);
}
g_print ("Sono dentro remmina_ssh_auth e auth vale %d\n", ssh->auth);
switch (ssh->auth)
{
......
......@@ -650,12 +650,12 @@ remmina_plugin_ssh_call_feature (RemminaProtocolWidget *gp, const RemminaProtoco
}
/* Array of key/value pairs for ssh auth type*/
static gpointer ssh_auth_type[] =
static gpointer ssh_auth[] =
{
"password", N_("Password"),
"ssh_agent", N_("SSH agent"),
"ssh_pubkey_auto", N_("Public key (automatic)"),
"ssh_identity", N_("SSH identfy file"),
"0", N_("Password"),
"1", N_("SSH agent"),
"2", N_("Public key (automatic)"),
"3", N_("SSH identfy file"),
NULL
};
......@@ -736,7 +736,7 @@ static const RemminaProtocolSetting remmina_ssh_basic_settings[] =
{ REMMINA_PROTOCOL_SETTING_TYPE_SERVER, "ssh_server", NULL, FALSE, NULL, NULL },
{ REMMINA_PROTOCOL_SETTING_TYPE_TEXT, "ssh_username", N_("User name"), FALSE, NULL, NULL },
{ REMMINA_PROTOCOL_SETTING_TYPE_PASSWORD, "ssh_password", N_("User password"), FALSE, NULL, NULL },
{ REMMINA_PROTOCOL_SETTING_TYPE_SELECT, "ssh_auth_type", N_("Authentication type"), FALSE, ssh_auth_type, NULL },
{ REMMINA_PROTOCOL_SETTING_TYPE_SELECT, "ssh_auth", N_("Authentication type"), FALSE, ssh_auth, NULL },
{ REMMINA_PROTOCOL_SETTING_TYPE_FILE, "ssh_privatekey", N_("Identity file"), FALSE, NULL, NULL },
{ REMMINA_PROTOCOL_SETTING_TYPE_END, NULL, NULL, FALSE, NULL, NULL }
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment