예제 #1
0
파일: password.c 프로젝트: Tux/claws-mail
static const gchar *master_passphrase()
{
	gchar *input;
	gboolean end = FALSE;

	if (!prefs_common_get_prefs()->use_master_passphrase) {
		return PASSCRYPT_KEY;
	}

	if (_master_passphrase != NULL) {
		debug_print("Master passphrase is in memory, offering it.\n");
		return _master_passphrase;
	}

	while (!end) {
		input = input_dialog_with_invisible(_("Input master passphrase"),
				_("Input master passphrase"), NULL);

		if (input == NULL) {
			debug_print("Cancel pressed at master passphrase dialog.\n");
			break;
		}

		if (master_passphrase_is_correct(input)) {
			debug_print("Entered master passphrase seems to be correct, remembering it.\n");
			_master_passphrase = input;
			end = TRUE;
		} else {
			alertpanel_error(_("Incorrect master passphrase."));
		}
	}

	return _master_passphrase;
}
예제 #2
0
gchar *input_dialog_query_password(const gchar *server, const gchar *user)
{
	gchar *message;
	gchar *pass;

	message = g_strdup_printf(_("Input password for %s on %s:"),
				  user, server);
	pass = input_dialog_with_invisible(_("Input password"), message, NULL);
	g_free(message);

	return pass;
}
예제 #3
0
gchar *input_dialog_query_password_keep(const gchar *server, const gchar *user, gchar **keep)
{
	gchar *message;
	gchar *pass;

	if (server && user)
		message = g_strdup_printf(_("Input password for %s on %s:"),
				  user, server);
	else if (server)
		message = g_strdup_printf(_("Input password for %s:"),
				  server);
	else if (user)
		message = g_strdup_printf(_("Input password for %s:"),
				  user);
	else
		message = g_strdup_printf(_("Input password:"******"Input password"), 
					message, NULL,
					_("Remember password for this session"), 
					&state);
			if (state) {
				*keep = g_strdup (pass);
				debug_print("keeping session password for account\n");
			}
			prefs_common.session_passwords = state;
		}
	}
	else {
		pass = input_dialog_with_invisible(_("Input password"), message, NULL);
	}		
	g_free(message);

	return pass;
}