aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSushma Rai <rsushma@src.gnome.org>2005-01-10 19:03:18 +0800
committerSushma Rai <rsushma@src.gnome.org>2005-01-10 19:03:18 +0800
commit25364488bb4d8ecb5313025e4b915dbc1de10ffa (patch)
treea997b5b78189f9cb4953f6c07c20fa094b01d51e /plugins
parent1c3ec60fffcd59005900c41d45a640610d387287 (diff)
downloadgsoc2013-evolution-25364488bb4d8ecb5313025e4b915dbc1de10ffa.tar
gsoc2013-evolution-25364488bb4d8ecb5313025e4b915dbc1de10ffa.tar.gz
gsoc2013-evolution-25364488bb4d8ecb5313025e4b915dbc1de10ffa.tar.bz2
gsoc2013-evolution-25364488bb4d8ecb5313025e4b915dbc1de10ffa.tar.lz
gsoc2013-evolution-25364488bb4d8ecb5313025e4b915dbc1de10ffa.tar.xz
gsoc2013-evolution-25364488bb4d8ecb5313025e4b915dbc1de10ffa.tar.zst
gsoc2013-evolution-25364488bb4d8ecb5313025e4b915dbc1de10ffa.zip
Plugin to read the exchange OWA URL instead of host name
svn path=/trunk/; revision=28310
Diffstat (limited to 'plugins')
-rw-r--r--plugins/exchange-account-setup/ChangeLog8
-rw-r--r--plugins/exchange-account-setup/exchange-ask-password.c71
-rw-r--r--plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in31
3 files changed, 101 insertions, 9 deletions
diff --git a/plugins/exchange-account-setup/ChangeLog b/plugins/exchange-account-setup/ChangeLog
index 61e0b4b7b0..7c5b15895f 100644
--- a/plugins/exchange-account-setup/ChangeLog
+++ b/plugins/exchange-account-setup/ChangeLog
@@ -1,3 +1,11 @@
+2005-01-10 Sushma Rai <rsushma@novell.com>
+
+ * org-gnome-exchange-account-setup.eplug.in: Added plugin to read
+ OWA url entry to the account set up druid.
+
+ * exchange-ask-password.c: Create a entry for OWA URL and reads the
+ URL value.
+
2005-01-09 Sushma Rai <rsushma@novell.com>
* exchange-ask-password.c: Pops up password dialog and validates
diff --git a/plugins/exchange-account-setup/exchange-ask-password.c b/plugins/exchange-account-setup/exchange-ask-password.c
index 1474613959..635feb4966 100644
--- a/plugins/exchange-account-setup/exchange-ask-password.c
+++ b/plugins/exchange-account-setup/exchange-ask-password.c
@@ -40,6 +40,9 @@
int e_plugin_lib_enable (EPluginLib *ep, int enable);
gboolean org_gnome_exchange_ask_password (EPlugin *epl, EConfigHookPageCheckData *data);
+GtkWidget *org_gnome_exchange_read_url(EPlugin *epl, EConfigHookItemFactoryData *data);
+
+char *owa_entry_text = NULL;
static gboolean
validate_exchange_user (EConfig *ec, const char *pageid, void *data)
@@ -62,7 +65,7 @@ validate_exchange_user (EConfig *ec, const char *pageid, void *data)
return FALSE; /* This should never happen */
}
- valid = camel_provider_validate_user (provider, url, NULL);
+ valid = camel_provider_validate_user (owa_entry_text, provider, url, NULL);
if (valid) {
count ++;
url_string = camel_url_to_string (url, 0);
@@ -71,7 +74,31 @@ validate_exchange_user (EConfig *ec, const char *pageid, void *data)
return valid;
}
-#if 0
+static void
+owa_entry_changed (GtkWidget *entry, void *data)
+{
+ /* FIXME: return owa_entry_text instead of making it global */
+ owa_entry_text = gtk_entry_get_text (GTK_ENTRY (entry));
+}
+
+static GtkWidget *
+add_owa_entry (GtkWidget *parent)
+{
+ GtkWidget *section, *owa_entry;
+
+ section = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (section);
+ gtk_box_pack_start (GTK_BOX (parent), section, FALSE, FALSE, 0);
+
+ owa_entry = gtk_entry_new ();
+ gtk_widget_show (owa_entry);
+ gtk_box_pack_start (GTK_BOX (section), owa_entry, FALSE, FALSE, 0);
+
+ g_signal_connect (owa_entry, "changed", G_CALLBACK(owa_entry_changed), NULL);
+
+ return section; /* FIXME: return entry */
+}
+
int
e_plugin_lib_enable (EPluginLib *ep, int enable)
{
@@ -79,7 +106,45 @@ e_plugin_lib_enable (EPluginLib *ep, int enable)
}
return 0;
}
-#endif
+
+GtkWidget *
+org_gnome_exchange_read_url(EPlugin *epl, EConfigHookItemFactoryData *data)
+{
+ EMConfigTargetAccount *target_account;
+ char *account_url = NULL, *exchange_url = NULL, *temp_url;
+ GtkWidget *owa_entry, *parent;
+ CamelURL *url=NULL;
+
+ 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) {
+ printf ("org_gnome_exchange_read_url \n");
+ 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) {
+ url->host = g_strdup("localhost");
+ /* FIXME: extract host name from url and use it*/
+ temp_url = camel_url_to_string (url, 0);
+ target_account->account->source->url = g_strdup(temp_url);
+ g_free (temp_url);
+ }
+
+ parent = data->parent;
+ owa_entry = add_owa_entry(parent);
+ g_free (account_url);
+ return owa_entry;
+ }
+ else {
+ g_free (account_url);
+ return NULL;
+ }
+}
gboolean
org_gnome_exchange_ask_password(EPlugin *epl, EConfigHookPageCheckData *data)
diff --git a/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in b/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in
index bb5c3a4f99..299ad6f9b7 100644
--- a/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in
+++ b/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in
@@ -22,22 +22,41 @@
<e-plugin
type="shlib"
+ id="org.gnome.evolution.plugin.exchange-read-url"
+ location="@PLUGINDIR@/liborg-gnome-exchange-account-settings.so"
+ load-on-startup="true"
+ name="Exchange OWA URL"
+ description="A pluign to read OWA url in account druid">
+
+ <hook class="org.gnome.evolution.mail.config:1.0">
+ <group
+ target="account"
+ id="org.gnome.evolution.mail.config.accountDruid">
+ <item type="section"
+ path="10.receive/30.config"
+ label="OWA Url"/>
+ <item type="item"
+ path="10.receive/30.config/00.owa"
+ factory="org_gnome_exchange_read_url"/>
+ </group>
+ </hook>
+ </e-plugin>
+
+ <e-plugin
+ type="shlib"
id="org.gnome.evolution.plugin.exchange-ask-password"
location="@PLUGINDIR@/liborg-gnome-exchange-account-settings.so"
load-on-startup="true"
- name="Exchange Password Dialog"
+ name="Exchange User Authentication"
description="A pluign to read password once the user enters identity information">
+
<hook class="org.gnome.evolution.mail.config:1.0">
<group
target="account"
id="org.gnome.evolution.mail.config.accountDruid"
check="org_gnome_exchange_ask_password">
-
- <item
- path="90.dummy"/>
+ <item path="90.dummy"/>
</group>
</hook>
</e-plugin>
-
-
</e-plugin-list>