aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSushma Rai <rsushma@src.gnome.org>2005-01-22 18:32:33 +0800
committerSushma Rai <rsushma@src.gnome.org>2005-01-22 18:32:33 +0800
commit4086c097204a26496ab75dfd4d80134dda0aee42 (patch)
treea6b92727421d1cb05864620acdeca5c6642d47f5
parent9c061e8079de49dd587d552270fa5525f73acdf2 (diff)
downloadgsoc2013-evolution-4086c097204a26496ab75dfd4d80134dda0aee42.tar.gz
gsoc2013-evolution-4086c097204a26496ab75dfd4d80134dda0aee42.tar.zst
gsoc2013-evolution-4086c097204a26496ab75dfd4d80134dda0aee42.zip
Setting owa url value in account editor and handlig ssl connection.
svn path=/trunk/; revision=28508
-rw-r--r--plugins/exchange-account-setup/ChangeLog13
-rw-r--r--plugins/exchange-account-setup/exchange-account-setup.c43
-rw-r--r--plugins/exchange-account-setup/exchange-ask-password.c46
3 files changed, 86 insertions, 16 deletions
diff --git a/plugins/exchange-account-setup/ChangeLog b/plugins/exchange-account-setup/ChangeLog
index f2eaaac492..39e505743d 100644
--- a/plugins/exchange-account-setup/ChangeLog
+++ b/plugins/exchange-account-setup/ChangeLog
@@ -1,3 +1,16 @@
+2005-01-22 Sushma Rai <rsushma@novell.com>
+
+ * org-gnome-exchange-account-setup.eplug.in: Added
+ org_gnome_exchange_check_options plugin.
+
+ * exchange-ask-password.c (org_gnome_exchange_check_options):
+ Reads OWA URL value and sets use_ssl and owa_url values for source
+ account url.
+
+ * exchange-account-setup.c (org_gnome_exchange_set_url)
+ (add_owa_entry_to_editor): Reading owa url value from gconf and setting
+ owa url value in the account editor. Fixes #71378
+
2005-01-19 Sushma Rai <rsushma@novell.com>
* exchange-ask-password.c (validate_exchange_user): Fix for remembering
diff --git a/plugins/exchange-account-setup/exchange-account-setup.c b/plugins/exchange-account-setup/exchange-account-setup.c
index 0a4f820910..e7118b1cb9 100644
--- a/plugins/exchange-account-setup/exchange-account-setup.c
+++ b/plugins/exchange-account-setup/exchange-account-setup.c
@@ -31,6 +31,7 @@
#include <gtk/gtkdialog.h>
#include <gconf/gconf-client.h>
#include <libedataserver/e-source.h>
+#include <camel/camel-url.h>
#include "mail/em-account-editor.h"
#include "mail/em-config.h"
#include "e-util/e-account.h"
@@ -202,7 +203,7 @@ org_gnome_exchange_account_setup (EPlugin *epl, EConfigHookItemFactoryData *data
{
EMConfigTargetAccount *target_account;
GtkWidget *oof_page = NULL;
- const char *account_url=NULL, *source_url=NULL, *temp_url=NULL;
+ const char *account_url = NULL, *source_url = NULL, *temp_url = NULL;
char *exchange_url = NULL;
GConfClient *client;
EAccountList *account_list;
@@ -266,7 +267,7 @@ static void
owa_editor_entry_changed (GtkWidget *entry, void *data)
{
GtkWidget *button = data;
- char *owa_entry_text = NULL;
+ const char *owa_entry_text = NULL;
/* FIXME: return owa_entry_text instead of making it global */
owa_entry_text = gtk_entry_get_text (GTK_ENTRY (entry));
@@ -276,10 +277,11 @@ owa_editor_entry_changed (GtkWidget *entry, void *data)
static GtkWidget *
add_owa_entry_to_editor (GtkWidget *parent, EConfig *config,
- EMConfigTargetAccount *target_account)
+ EMConfigTargetAccount *target_account,
+ EAccountList *account_list, const char *url_value)
{
GtkWidget *section, *owa_entry;
- GtkWidget *hbox, *label;
+ GtkWidget *hbox, *label;
section = gtk_vbox_new (FALSE, 0);
gtk_widget_show (section);
@@ -292,6 +294,8 @@ add_owa_entry_to_editor (GtkWidget *parent, EConfig *config,
gtk_widget_show (label);
owa_entry = gtk_entry_new ();
+ if (url_value)
+ gtk_entry_set_text (GTK_ENTRY (owa_entry), url_value);
gtk_widget_show (owa_entry);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -339,13 +343,13 @@ org_gnome_exchange_set_url (EPlugin *epl, EConfigHookItemFactoryData *data)
{
EMConfigTargetAccount *target_account;
EConfig *config;
- char *account_url=NULL, *exchange_url = NULL;
- const char *source_url, *temp_url;
+ char *account_url = NULL, *exchange_url = NULL;
+ const char *source_url, *temp_url, *uid, *owa_url = NULL;
GtkWidget *owa_entry = NULL, *parent;
GConfClient *client;
- EAccountList *account_list;
- const char *uid;
+ EAccountList *account_list = NULL;
EAccount *gconf_account;
+ CamelURL *camel_url;
config = data->config;
target_account = (EMConfigTargetAccount *)data->config->target;
@@ -375,14 +379,12 @@ org_gnome_exchange_set_url (EPlugin *epl, EConfigHookItemFactoryData *data)
}
g_free (uid);
}
- g_object_unref (account_list);
}
- g_object_unref (client);
- source_url = e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL);
+ source_url = e_account_get_string (target_account->account,
+ 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)
@@ -393,11 +395,24 @@ org_gnome_exchange_set_url (EPlugin *epl, EConfigHookItemFactoryData *data)
if (!GTK_WIDGET_TOPLEVEL (parent))
parent = NULL;
*/
+ camel_url = camel_url_new_with_base (NULL, account_url);
+ owa_url = camel_url_get_param (camel_url, "owa_url");
+ camel_url_free (camel_url);
parent = data->parent;
- owa_entry = add_owa_entry_to_editor(parent, config, target_account);
- gtk_box_pack_start (GTK_BOX (parent), owa_entry, FALSE, FALSE, 0);
+ owa_entry = add_owa_entry_to_editor (parent,
+ config,
+ target_account,
+ account_list,
+ owa_url);
+ gtk_box_pack_start (GTK_BOX (parent), owa_entry,
+ FALSE, FALSE, 0);
gtk_widget_show (parent);
}
+ g_free (account_url);
+ if (account_list)
+ g_object_unref (account_list);
+ g_object_unref (client);
+
return owa_entry;
}
diff --git a/plugins/exchange-account-setup/exchange-ask-password.c b/plugins/exchange-account-setup/exchange-ask-password.c
index 01054e17fd..a41a9cdffe 100644
--- a/plugins/exchange-account-setup/exchange-ask-password.c
+++ b/plugins/exchange-account-setup/exchange-ask-password.c
@@ -39,7 +39,8 @@
int e_plugin_lib_enable (EPluginLib *ep, int enable);
void exchange_options_commit (EPlugin *epl, EConfigHookItemFactoryData *data);
-GtkWidget *org_gnome_exchange_read_url(EPlugin *epl, EConfigHookItemFactoryData *data);
+GtkWidget *org_gnome_exchange_read_url (EPlugin *epl, EConfigHookItemFactoryData *data);
+gboolean org_gnome_exchange_check_options (EPlugin *epl, EConfigHookPageCheckData *data);
char *owa_entry_text = NULL;
@@ -102,7 +103,8 @@ validate_exchange_user (void *data)
camel_url_set_user (url, user);
}
}
- valid = validate->validate_user (url, owa_entry_text, remember_password, NULL);
+ valid = validate->validate_user (url, owa_entry_text,
+ remember_password, NULL);
}
/* FIXME: need to check for return value */
@@ -202,3 +204,43 @@ org_gnome_exchange_read_url (EPlugin *epl, EConfigHookItemFactoryData *data)
g_free (account_url);
return owa_entry;
}
+
+gboolean
+org_gnome_exchange_check_options (EPlugin *epl, EConfigHookPageCheckData *data)
+{
+ EMConfigTargetAccount *target_account;
+ EConfig *config;
+ char *account_url = NULL, *exchange_url = NULL, *url_string;
+ char *use_ssl = NULL;
+ static int page_check_count = 0;
+ CamelURL *url;
+
+ if ((strcmp (data->pageid, "20.receive_options")) || page_check_count)
+ return TRUE;
+
+ config = data->config;
+ target_account = (EMConfigTargetAccount *)data->config->target;
+ account_url = g_strdup (target_account->account->source->url);
+ exchange_url = g_strrstr (account_url, "exchange");
+
+ if (exchange_url) {
+ page_check_count ++;
+
+ if (owa_entry_text){
+ if (!strncmp (owa_entry_text, "https:", 6))
+ use_ssl = "always";
+
+ url = camel_url_new_with_base (NULL, account_url);
+
+ if (use_ssl)
+ camel_url_set_param (url, "use_ssl", use_ssl);
+ camel_url_set_param (url, "owa_url", owa_entry_text);
+
+ url_string = camel_url_to_string (url, 0);
+ e_account_set_string (target_account->account,
+ E_ACCOUNT_SOURCE_URL, url_string);
+ camel_url_free (url);
+ }
+ }
+ return TRUE;
+}