diff options
author | Sivaiah Nallagatla <snallagatla@novell.com> | 2004-08-21 14:58:22 +0800 |
---|---|---|
committer | Sivaiah Nallagatla <siva@src.gnome.org> | 2004-08-21 14:58:22 +0800 |
commit | ff843b723fda75e754aa94645066560c59bd6648 (patch) | |
tree | 09ac31ce090fb7e6442b069375eac6011c577176 | |
parent | 64943d5f70bcdcb7439c1c08c7901e7faa82d13e (diff) | |
download | gsoc2013-evolution-ff843b723fda75e754aa94645066560c59bd6648.tar.gz gsoc2013-evolution-ff843b723fda75e754aa94645066560c59bd6648.tar.zst gsoc2013-evolution-ff843b723fda75e754aa94645066560c59bd6648.zip |
if any of the settings required for soap interaction changes try
2004-08-21 Sivaiah Nallagatla <snallagatla@novell.com>
* providers/groupwise/camel-gw-listener.c (account_changed) :
if any of the settings required for soap interaction changes
try connecting to server and resetup the ESources
* providers/groupwise/camel-groupwise-provider.c ": don't
check soap ssl setting by default to be in consistent with
IMAP
svn path=/trunk/; revision=26982
-rw-r--r-- | camel/ChangeLog | 9 | ||||
-rw-r--r-- | camel/providers/groupwise/camel-groupwise-provider.c | 2 | ||||
-rw-r--r-- | camel/providers/groupwise/camel-gw-listener.c | 81 | ||||
-rw-r--r-- | plugins/groupwise-account-setup/camel-gw-listener.c | 81 |
4 files changed, 100 insertions, 73 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 06e78025c4..af7997221c 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,12 @@ +2004-08-21 Sivaiah Nallagatla <snallagatla@novell.com> + + * providers/groupwise/camel-gw-listener.c (account_changed) : + if any of the settings required for soap interaction changes + try connecting to server and resetup the ESources + * providers/groupwise/camel-groupwise-provider.c ": don't + check soap ssl setting by default to be in consistent with + IMAP + 2004-08-16 Not Zed <NotZed@Ximian.com> * providers/groupwise/camel-groupwise-provider.c diff --git a/camel/providers/groupwise/camel-groupwise-provider.c b/camel/providers/groupwise/camel-groupwise-provider.c index bf0d7e4073..4a426bc3d5 100644 --- a/camel/providers/groupwise/camel-groupwise-provider.c +++ b/camel/providers/groupwise/camel-groupwise-provider.c @@ -75,7 +75,7 @@ CamelProviderConfEntry groupwise_conf_entries[] = { N_("Post Office Agent SOAP Port:"), "7181" }, { CAMEL_PROVIDER_CONF_CHECKBOX, "soap_ssl", NULL, - N_("Use Secure Connection (SSL)"), "1"}, + N_("Use Secure Connection (SSL)"), "0"}, { CAMEL_PROVIDER_CONF_HIDDEN, "auth-domain", NULL, NULL, "Groupwise" }, diff --git a/camel/providers/groupwise/camel-gw-listener.c b/camel/providers/groupwise/camel-gw-listener.c index b2b7556e07..b7a7300e6b 100644 --- a/camel/providers/groupwise/camel-gw-listener.c +++ b/camel/providers/groupwise/camel-gw-listener.c @@ -690,13 +690,14 @@ static void account_changed (EAccountList *account_listener, EAccount *account) { gboolean is_gw_account; - CamelURL *url; - char *relative_uri, *old_relative_uri; - const char *soap_port; + CamelURL *old_url, *new_url; + char *relative_uri; + const char *old_soap_port, *new_soap_port; GwAccountInfo *existing_account_info; - const char *use_ssl; - const char *poa_address; - + const char *old_use_ssl, *new_use_ssl; + gboolean old_ssl, new_ssl; + const char *old_poa_address, *new_poa_address; + is_gw_account = is_groupwise_account (account); existing_account_info = lookup_account_info (account->uid); @@ -726,44 +727,52 @@ account_changed (EAccountList *account_listener, EAccount *account) account_removed (account_listener, account); return; } + old_ssl = new_ssl = FALSE; /* some info of groupwise account is changed . update the sources with new info if required */ - url = camel_url_new (existing_account_info->source_url, NULL); - poa_address = camel_url_get_param (url, "poa"); - if (!poa_address || strlen (poa_address) ==0) - return; - old_relative_uri = g_strdup_printf ("%s@%s/", url->user, poa_address); - camel_url_free (url); - - url = camel_url_new (account->source->url, NULL); - - poa_address = camel_url_get_param (url, "poa"); - if (!poa_address || strlen (poa_address) ==0) + old_url = camel_url_new (existing_account_info->source_url, NULL); + old_poa_address = camel_url_get_param (old_url, "poa"); + old_soap_port = camel_url_get_param (old_url, "soap_port"); + old_use_ssl = camel_url_get_param (old_url, "soap_ssl"); + if (old_use_ssl) + old_ssl = TRUE; + new_url = camel_url_new (account->source->url, NULL); + + new_poa_address = camel_url_get_param (new_url, "poa"); + if (!new_poa_address || strlen (new_poa_address) ==0) return; - soap_port = camel_url_get_param (url, "soap_port"); - if (!soap_port || strlen (soap_port) == 0) - soap_port = "7181"; - use_ssl = camel_url_get_param (url, "soap_ssl"); - if (use_ssl) - use_ssl = "always"; - - relative_uri = g_strdup_printf ("%s@%s/", url->user, poa_address); - - if (strcmp (existing_account_info->name, account->name) != 0 || strcmp (existing_account_info->source_url, account->source->url) != 0) { + new_soap_port = camel_url_get_param (new_url, "soap_port"); + if (!new_soap_port || strlen (new_soap_port) == 0) + new_soap_port = "7181"; + + new_use_ssl = camel_url_get_param (new_url, "soap_ssl"); + if (new_use_ssl){ + new_use_ssl = "always"; + new_ssl = TRUE; + } - - modify_esource ("/apps/evolution/calendar/sources", existing_account_info, account->name, url->user, relative_uri, soap_port, use_ssl); - modify_esource ("/apps/evolution/tasks/sources", existing_account_info, account->name, url->user, relative_uri, soap_port, use_ssl); + if ((old_poa_address && strcmp (old_poa_address, new_poa_address)) + || (old_soap_port && strcmp (old_soap_port, new_soap_port)) + || strcmp (old_url->user, new_url->user) + || ( old_ssl ^ new_ssl)) { + + account_removed (account_listener, account); + account_added (account_listener, account); + } else if (strcmp (existing_account_info->name, account->name)) { + + relative_uri = g_strdup_printf ("%s@%s/", new_url->user, new_poa_address); + modify_esource ("/apps/evolution/calendar/sources", existing_account_info, account->name, new_url->user, relative_uri, new_soap_port, new_use_ssl); + modify_esource ("/apps/evolution/tasks/sources", existing_account_info, account->name, new_url->user, relative_uri, new_soap_port, new_use_ssl); modify_addressbook_sources (account, existing_account_info); - g_free (existing_account_info->name); - g_free (existing_account_info->source_url); - existing_account_info->name = g_strdup (account->name); - existing_account_info->source_url = g_strdup (account->source->url); g_free (relative_uri); - g_free (old_relative_uri); } - camel_url_free (url); + g_free (existing_account_info->name); + g_free (existing_account_info->source_url); + existing_account_info->name = g_strdup (account->name); + existing_account_info->source_url = g_strdup (account->source->url); + camel_url_free (old_url); + camel_url_free (new_url); } diff --git a/plugins/groupwise-account-setup/camel-gw-listener.c b/plugins/groupwise-account-setup/camel-gw-listener.c index b2b7556e07..b7a7300e6b 100644 --- a/plugins/groupwise-account-setup/camel-gw-listener.c +++ b/plugins/groupwise-account-setup/camel-gw-listener.c @@ -690,13 +690,14 @@ static void account_changed (EAccountList *account_listener, EAccount *account) { gboolean is_gw_account; - CamelURL *url; - char *relative_uri, *old_relative_uri; - const char *soap_port; + CamelURL *old_url, *new_url; + char *relative_uri; + const char *old_soap_port, *new_soap_port; GwAccountInfo *existing_account_info; - const char *use_ssl; - const char *poa_address; - + const char *old_use_ssl, *new_use_ssl; + gboolean old_ssl, new_ssl; + const char *old_poa_address, *new_poa_address; + is_gw_account = is_groupwise_account (account); existing_account_info = lookup_account_info (account->uid); @@ -726,44 +727,52 @@ account_changed (EAccountList *account_listener, EAccount *account) account_removed (account_listener, account); return; } + old_ssl = new_ssl = FALSE; /* some info of groupwise account is changed . update the sources with new info if required */ - url = camel_url_new (existing_account_info->source_url, NULL); - poa_address = camel_url_get_param (url, "poa"); - if (!poa_address || strlen (poa_address) ==0) - return; - old_relative_uri = g_strdup_printf ("%s@%s/", url->user, poa_address); - camel_url_free (url); - - url = camel_url_new (account->source->url, NULL); - - poa_address = camel_url_get_param (url, "poa"); - if (!poa_address || strlen (poa_address) ==0) + old_url = camel_url_new (existing_account_info->source_url, NULL); + old_poa_address = camel_url_get_param (old_url, "poa"); + old_soap_port = camel_url_get_param (old_url, "soap_port"); + old_use_ssl = camel_url_get_param (old_url, "soap_ssl"); + if (old_use_ssl) + old_ssl = TRUE; + new_url = camel_url_new (account->source->url, NULL); + + new_poa_address = camel_url_get_param (new_url, "poa"); + if (!new_poa_address || strlen (new_poa_address) ==0) return; - soap_port = camel_url_get_param (url, "soap_port"); - if (!soap_port || strlen (soap_port) == 0) - soap_port = "7181"; - use_ssl = camel_url_get_param (url, "soap_ssl"); - if (use_ssl) - use_ssl = "always"; - - relative_uri = g_strdup_printf ("%s@%s/", url->user, poa_address); - - if (strcmp (existing_account_info->name, account->name) != 0 || strcmp (existing_account_info->source_url, account->source->url) != 0) { + new_soap_port = camel_url_get_param (new_url, "soap_port"); + if (!new_soap_port || strlen (new_soap_port) == 0) + new_soap_port = "7181"; + + new_use_ssl = camel_url_get_param (new_url, "soap_ssl"); + if (new_use_ssl){ + new_use_ssl = "always"; + new_ssl = TRUE; + } - - modify_esource ("/apps/evolution/calendar/sources", existing_account_info, account->name, url->user, relative_uri, soap_port, use_ssl); - modify_esource ("/apps/evolution/tasks/sources", existing_account_info, account->name, url->user, relative_uri, soap_port, use_ssl); + if ((old_poa_address && strcmp (old_poa_address, new_poa_address)) + || (old_soap_port && strcmp (old_soap_port, new_soap_port)) + || strcmp (old_url->user, new_url->user) + || ( old_ssl ^ new_ssl)) { + + account_removed (account_listener, account); + account_added (account_listener, account); + } else if (strcmp (existing_account_info->name, account->name)) { + + relative_uri = g_strdup_printf ("%s@%s/", new_url->user, new_poa_address); + modify_esource ("/apps/evolution/calendar/sources", existing_account_info, account->name, new_url->user, relative_uri, new_soap_port, new_use_ssl); + modify_esource ("/apps/evolution/tasks/sources", existing_account_info, account->name, new_url->user, relative_uri, new_soap_port, new_use_ssl); modify_addressbook_sources (account, existing_account_info); - g_free (existing_account_info->name); - g_free (existing_account_info->source_url); - existing_account_info->name = g_strdup (account->name); - existing_account_info->source_url = g_strdup (account->source->url); g_free (relative_uri); - g_free (old_relative_uri); } - camel_url_free (url); + g_free (existing_account_info->name); + g_free (existing_account_info->source_url); + existing_account_info->name = g_strdup (account->name); + existing_account_info->source_url = g_strdup (account->source->url); + camel_url_free (old_url); + camel_url_free (new_url); } |