From 23694d6f4514a90de3b7fd668c05f5d6cd5ec5fa Mon Sep 17 00:00:00 2001 From: Sushma Rai Date: Tue, 18 Jan 2005 08:52:21 +0000 Subject: Initializing host name with a dummy name svn path=/trunk/; revision=28431 --- plugins/exchange-account-setup/ChangeLog | 6 ++++++ plugins/exchange-account-setup/exchange-ask-password.c | 18 +++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/exchange-account-setup/ChangeLog b/plugins/exchange-account-setup/ChangeLog index 40ae5c72ee..286e029728 100644 --- a/plugins/exchange-account-setup/ChangeLog +++ b/plugins/exchange-account-setup/ChangeLog @@ -1,3 +1,9 @@ +2005-01-18 Sushma Rai + + * exchange-ask-password.c (org_gnome_exchange_read_url): + Setting dummy host name, which will be reset to proper + hostname once the user is authenticated. + 2005-01-18 Sushma Rai * org-gnome-exchange-account-setup.eplug.in: Moved two account diff --git a/plugins/exchange-account-setup/exchange-ask-password.c b/plugins/exchange-account-setup/exchange-ask-password.c index 5f1d6b283e..a70b23ddef 100644 --- a/plugins/exchange-account-setup/exchange-ask-password.c +++ b/plugins/exchange-account-setup/exchange-ask-password.c @@ -82,7 +82,6 @@ validate_exchange_user (void *data) E_ACCOUNT_SOURCE_URL); account_url = g_strdup (source_url); provider = camel_provider_get (account_url, NULL); - g_free (account_url); account_url = NULL; if (!provider) { return FALSE; /* This should never happen */ } @@ -104,6 +103,7 @@ validate_exchange_user (void *data) E_ACCOUNT_TRANSPORT_URL, url_string); } camel_url_free (url); + g_free (account_url); return valid; } @@ -164,9 +164,10 @@ org_gnome_exchange_read_url(EPlugin *epl, EConfigHookItemFactoryData *data) { EMConfigTargetAccount *target_account; EConfig *config; - char *account_url = NULL, *exchange_url = NULL; + char *account_url = NULL, *exchange_url = NULL, *temp_url; const char *source_url; GtkWidget *owa_entry = NULL, *parent; + CamelURL *url; config = data->config; target_account = (EMConfigTargetAccount *)data->config->target; @@ -175,14 +176,25 @@ org_gnome_exchange_read_url(EPlugin *epl, EConfigHookItemFactoryData *data) E_ACCOUNT_SOURCE_URL); account_url = g_strdup (source_url); exchange_url = g_strrstr (account_url, "exchange"); - g_free (account_url); if (exchange_url) { if (data->old) return data->old; + /* hack for making page check work when host is not there */ + url = camel_url_new_with_base (NULL, account_url); + if (url->host == NULL) { + camel_url_set_host (url, "localhost"); + temp_url = camel_url_to_string (url, 0); + e_account_set_string (target_account->account, + E_ACCOUNT_SOURCE_URL, temp_url); + g_free (temp_url); + } + camel_url_free (url); + parent = data->parent; owa_entry = add_owa_entry (parent, config, target_account); } + g_free (account_url); return owa_entry; } -- cgit v1.2.3