aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-account-setup
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/exchange-account-setup')
-rw-r--r--plugins/exchange-account-setup/ChangeLog150
-rw-r--r--plugins/exchange-account-setup/Makefile.am22
-rw-r--r--plugins/exchange-account-setup/exchange-account-setup.c356
-rw-r--r--plugins/exchange-account-setup/exchange-ask-password.c357
-rw-r--r--plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in36
5 files changed, 0 insertions, 921 deletions
diff --git a/plugins/exchange-account-setup/ChangeLog b/plugins/exchange-account-setup/ChangeLog
deleted file mode 100644
index 8ea9c9ac26..0000000000
--- a/plugins/exchange-account-setup/ChangeLog
+++ /dev/null
@@ -1,150 +0,0 @@
-2005-01-28 Not Zed <NotZed@Ximian.com>
-
- ** related to bug #71520.
-
- * exchange-account-setup.c: All but re-written.
- Fixed the license of the file.
- Fixed a translation string.
- Modified return condition check.
- Fixed problem over writing current account with the old data.
- Removed duplicated code.
- Removed the hack for handling NULL hostname, now using
- CAMEL_URL_HIDDEN_HOST url flag in the provider.
- Using E_ACCOUNT_SOURCE_SAVE_PASSWD for remember password.
- Removed the way owa url entry was added to table in config section,
- Now econfig supports tables.
-
- * exchange-ask-password.c: removed, functionality moved to
- exchange-account-setup.c.
-
-2005-01-25 Sushma Rai <rsushma@novell.com>
-
- * exchange-account-setup.c (create_page): Fixed empty
- string being marked for translation problem. #71644
-
-2005-01-23 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Added plugins
- for handling hiding auth type section in druid.
-
- * exchange-account-setup.c (add_owa_entry_to_editor): Changed the
- button label to "Authenticate" from OK
-
- * exchange-ask-password.c (add_owa_entry): Changed the button label
- to Authenticate.
- (org_gnome_exchange_handle_auth): Hiding Auth section in receive page.
- (org_gnome_exchange_handle_send_auth_option): Hiding the Auth section
- in send page
-
-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
- password if user has selected that option, while creating the account.
-
-2005-01-18 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c (validate_exchange_user): Reading the return
- value of user validation function. Fixes #71385
-
-2005-01-18 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c (validate_exchange_user): Filling up
- user name so that page check doesn't fail. Fixes #71384
-
-2005-01-18 Sushma Rai <rsushma@novell.com>
-
- * 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 <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Moved two account
- editor plugins unser same hook class.
-
- * exchange-ask-password.c: Reorganized the code.
- Used accessor functions to read and set EAccount values.
- Removed editor specific factory function add_owa_entry_to_editor()
- from here.
-
- * exchange-account-setup.c: Reorganized the code.
- Moved add_owa_entry_to_editor() and it's sub functions into this file.
- (org_gnome_exchange_account_setup): Reading source url and transport
- url values stored in gconf and filling up the EAccount structure.
- This fixes the problem of page check failure, as improper source url
- and transport url values, as we don't read host name in the editor.
- (org_gnome_exchange_set_url): Similar.
-
-2005-01-17 Sushma Rai <rsushma@novell.com>
-
- * Makefile.am: Linking to camel libs. Fixes plugin loading problem
- due to undefined camel symbol, during evolution startup.
-
-2005-01-13 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Combined
- all the plugins into one.
-
-2005-01-12 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c: (validate_exchange_user):
- Added one more error condition check.
-
-2005-01-12 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Factory
- method to add owa url entry to account editor.
-
- * exchange-ask-password.c: (org_gnome_exchange_set_url)
- (add_owa_entry_to_editor): Adds owa url entry to the
- account editor for Exchange account.
- (validate_exchange_user): Using the CamelProvider private
- function defined by Exchange camel provider.
-
-2005-01-11 Sushma Rai <rsushma@novell.com>
-
- * org-gnome-exchange-account-setup.eplug.in: Removed page check plugin
-
- * exchange-ask-password.c: Added a button to prompt for password
- instead of listening on page next signal
-
-2005-01-11 Not Zed <NotZed@Ximian.com>
-
- * Makefile.am: fix LDFLAGS variable name.
-
-2005-01-10 Sushma Rai <rsushma@novell.com>
-
- * exchange-ask-password.c: (validate_exchange_user):
- Corrected argument order.
-
-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
- user credentials once owa url and user name are entered.
-
- * org-gnome-exchange-account-setup.eplug.in: Added page check plugin.
-
-2005-01-09 Sushma Rai <rsushma@novell.com>
-
- * Intial ckeckin, Plugin for Exchange account specific settings
diff --git a/plugins/exchange-account-setup/Makefile.am b/plugins/exchange-account-setup/Makefile.am
deleted file mode 100644
index c0ecbca72b..0000000000
--- a/plugins/exchange-account-setup/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-INCLUDES = -I . \
- -I$(top_srcdir) \
- $(EVOLUTION_MAIL_CFLAGS) \
- $(CAMEL_CFLAGS) \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\"
-
-@EVO_PLUGIN_RULE@
-
-plugin_DATA = org-gnome-exchange-account-setup.eplug
-plugin_LTLIBRARIES = liborg-gnome-exchange-account-settings.la
-
-liborg_gnome_exchange_account_settings_la_SOURCES = \
- exchange-account-setup.c
-
-liborg_gnome_exchange_account_settings_la_LIBADD = \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(CAMEL_LIBS)
-
-liborg_gnome_exchange_account_settings_la_LDFLAGS = -module -avoid-version
-
-EXTRA_DIST = org-gnome-exchange-account-setup.eplug.in
diff --git a/plugins/exchange-account-setup/exchange-account-setup.c b/plugins/exchange-account-setup/exchange-account-setup.c
deleted file mode 100644
index b1bfd959cf..0000000000
--- a/plugins/exchange-account-setup/exchange-account-setup.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Sushma Rai <rsushma@novell.com>
- * Copyright (C) 2004 Novell, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-#include <glib/gi18n.h>
-#include <glade/glade.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkdialog.h>
-#include <gconf/gconf-client.h>
-#include <camel/camel-provider.h>
-#include <camel/camel-url.h>
-#include "mail/em-account-editor.h"
-#include "mail/em-config.h"
-#include "e-util/e-account.h"
-
-GtkWidget* org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data);
-GtkWidget *org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data);
-gboolean org_gnome_exchange_check_options(EPlugin *epl, EConfigHookPageCheckData *data);
-
-/* NB: This should be given a better name, it is NOT a camel service, it is only a camel-exchange one */
-typedef gboolean (CamelProviderValidateUserFunc) (CamelURL *camel_url, const char *url, gboolean *remember_password, CamelException *ex);
-typedef struct {
- CamelProviderValidateUserFunc *validate_user;
-}CamelProviderValidate;
-
-/* only used in editor */
-GtkWidget *
-org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- const char *source_url;
- CamelURL *url;
- GtkWidget *oof_page;
- GtkWidget *oof_table;
- GtkWidget *oof_description, *label_status, *label_empty;
- GtkWidget *radiobutton_inoff, *radiobutton_oof;
- GtkWidget *vbox_oof, *vbox_oof_message;
- GtkWidget *oof_frame;
- GtkWidget *scrolledwindow_oof;
- GtkWidget *textview_oof;
- char *txt;
-
- target_account = (EMConfigTargetAccount *)data->config->target;
- source_url = e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL);
- url = camel_url_new(source_url, NULL);
- if (url == NULL
- || strcmp(url->protocol, "exchange") != 0) {
- if (url)
- camel_url_free(url);
- return NULL;
- }
-
- if (data->old) {
- camel_url_free(url);
- return data->old;
- }
-
- /* FIXME: This out of office data never goes anywhere */
-
- oof_page = gtk_vbox_new (FALSE, 6);
- gtk_container_set_border_width (GTK_CONTAINER (oof_page), 12);
-
- /* Description section */
-
- oof_description = gtk_label_new (_("The message specified below will be automatically sent to \neach person who sends mail to you while you are out of the office."));
- gtk_label_set_justify (GTK_LABEL (oof_description), GTK_JUSTIFY_LEFT);
- gtk_label_set_line_wrap (GTK_LABEL (oof_description), TRUE);
- gtk_misc_set_alignment (GTK_MISC (oof_description), 0.5, 0.5);
- gtk_misc_set_padding (GTK_MISC (oof_description), 0, 18);
-
- gtk_box_pack_start (GTK_BOX (oof_page), oof_description, FALSE, TRUE, 0);
-
- /* Table with out of office radio buttons */
-
- oof_table = gtk_table_new (2, 2, FALSE);
- gtk_table_set_col_spacings (GTK_TABLE (oof_table), 6);
- gtk_table_set_row_spacings (GTK_TABLE (oof_table), 6);
- gtk_box_pack_start (GTK_BOX (oof_page), oof_table, FALSE, FALSE, 0);
-
- /* translators: exchange out of office status header */
- txt = g_strdup_printf("<b>%s</b>", _("Status:"));
- label_status = gtk_label_new (txt);
- g_free(txt);
- gtk_label_set_justify (GTK_LABEL (label_status), GTK_JUSTIFY_CENTER);
- gtk_misc_set_alignment (GTK_MISC (label_status), 0, 0.5);
- gtk_misc_set_padding (GTK_MISC (label_status), 0, 0);
- gtk_label_set_use_markup (GTK_LABEL (label_status), TRUE);
- gtk_table_attach (GTK_TABLE (oof_table), label_status, 0, 1, 0, 1,
- GTK_FILL, GTK_FILL, 0, 0);
-
- radiobutton_inoff = gtk_radio_button_new_with_label (NULL,
- _("I am in the office"));
- gtk_table_attach (GTK_TABLE (oof_table), radiobutton_inoff, 1, 2, 0, 1,
- GTK_FILL, GTK_FILL, 0, 0);
-
- label_empty = gtk_label_new ("");
- gtk_label_set_justify (GTK_LABEL (label_empty), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (label_empty), 0, 0.5);
- gtk_misc_set_padding (GTK_MISC (label_empty), 0, 0);
- gtk_label_set_use_markup (GTK_LABEL (label_empty), FALSE);
- gtk_table_attach (GTK_TABLE (oof_table), label_empty, 0, 1, 1, 2,
- GTK_FILL, GTK_FILL, 0, 0);
-
- radiobutton_oof = gtk_radio_button_new_with_label_from_widget (
- GTK_RADIO_BUTTON (radiobutton_inoff),
- _("I am out of the office"));
-
-
- gtk_table_attach (GTK_TABLE (oof_table), radiobutton_oof, 1, 2, 1, 2,
- GTK_FILL, GTK_FILL, 0, 0);
-
- /* frame containg oof message text box */
-
- vbox_oof = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (oof_page), vbox_oof, FALSE, FALSE, 0);
-
- oof_frame = gtk_frame_new ("");
- gtk_container_set_border_width (GTK_CONTAINER (oof_frame), 1);
- gtk_frame_set_shadow_type (GTK_FRAME (oof_frame), GTK_SHADOW_ETCHED_IN);
- gtk_frame_set_label (GTK_FRAME (oof_frame), _("Out of office Message:"));
- gtk_box_pack_start (GTK_BOX (vbox_oof), oof_frame, FALSE, FALSE, 0);
-
- vbox_oof_message = gtk_vbox_new (FALSE, 6);
- gtk_container_add (GTK_CONTAINER (oof_frame), vbox_oof_message);
-
- scrolledwindow_oof = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_oof),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type (
- GTK_SCROLLED_WINDOW (scrolledwindow_oof),
- GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (vbox_oof_message),
- scrolledwindow_oof, TRUE, TRUE, 0);
-
- textview_oof = gtk_text_view_new();
- gtk_text_view_set_justification (GTK_TEXT_VIEW (textview_oof),
- GTK_JUSTIFY_LEFT);
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (textview_oof),
- GTK_WRAP_WORD);
- gtk_text_view_set_editable (GTK_TEXT_VIEW (textview_oof), TRUE);
- gtk_container_add (GTK_CONTAINER (scrolledwindow_oof), textview_oof);
- gtk_widget_show_all (scrolledwindow_oof);
-
- gtk_widget_show_all (oof_page);
-
- gtk_notebook_insert_page (GTK_NOTEBOOK (data->parent), oof_page, gtk_label_new(_("Exchange Settings")), 4);
-
- return oof_page;
-}
-
-static void
-owa_authenticate_user(GtkWidget *button, EConfig *config)
-{
- EMConfigTargetAccount *target_account = (EMConfigTargetAccount *)config->target;
- CamelProviderValidate *validate;
- CamelURL *url=NULL;
- CamelProvider *provider = NULL;
- gboolean remember_password;
- char *url_string;
- const char *source_url, *id_name;
- char *at, *user;
-
- source_url = e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL);
- provider = camel_provider_get (source_url, NULL);
- if (!provider || provider->priv == NULL) {
- /* can't happen? */
- return;
- }
-
- url = camel_url_new(source_url, NULL);
- validate = provider->priv;
- if (url->user == NULL) {
- id_name = e_account_get_string (target_account->account, E_ACCOUNT_ID_ADDRESS);
- if (id_name) {
- at = strchr(id_name, '@');
- user = g_alloca(at-id_name+1);
- memcpy(user, id_name, at-id_name);
- user[at-id_name] = 0;
- camel_url_set_user (url, user);
- }
- }
-
- /* validate_user() CALLS GTK!!!
-
- THIS IS TOTALLY UNNACCEPTABLE!!!!!!!!
-
- It must use camel_session_ask_password, and it should return an exception for any problem,
- which should then be shown using e-error */
-
- if (validate->validate_user(url, camel_url_get_param(url, "owa_url"), &remember_password, NULL)) {
- url_string = camel_url_to_string (url, 0);
- e_account_set_string(target_account->account, E_ACCOUNT_SOURCE_URL, url_string);
- e_account_set_string(target_account->account, E_ACCOUNT_TRANSPORT_URL, url_string);
- e_account_set_bool(target_account->account, E_ACCOUNT_SOURCE_SAVE_PASSWD, remember_password);
- g_free(url_string);
- }
-
- camel_url_free (url);
-}
-
-static void
-owa_editor_entry_changed(GtkWidget *entry, EConfig *config)
-{
- const char *uri, *ssl = NULL;
- CamelURL *url, *owaurl = NULL;
- char *url_string;
- EMConfigTargetAccount *target = (EMConfigTargetAccount *)config->target;
- GtkWidget *button = g_object_get_data((GObject *)entry, "authenticate-button");
- int active = FALSE;
-
- /* NB: we set the button active only if we have a parsable uri entered */
-
- url = camel_url_new(e_account_get_string(target->account, E_ACCOUNT_SOURCE_URL), NULL);
- uri = gtk_entry_get_text((GtkEntry *)entry);
- if (uri && uri[0]) {
- camel_url_set_param(url, "owa_url", uri);
- owaurl = camel_url_new(uri, NULL);
- if (owaurl) {
- active = TRUE;
-
- /* i'm not sure why we need this, "ssl connection mode" is redundant
- since we have it in the owa-url protocol */
- if (!strcmp(owaurl->protocol, "https"))
- ssl = "always";
- camel_url_free(owaurl);
- }
- } else {
- camel_url_set_param(url, "owa_url", NULL);
- }
-
- camel_url_set_param(url, "use_ssl", ssl);
- gtk_widget_set_sensitive(button, active);
-
- url_string = camel_url_to_string(url, 0);
- e_account_set_string(target->account, E_ACCOUNT_SOURCE_URL, url_string);
- g_free(url_string);
-}
-
-static void
-destroy_label(GtkWidget *old, GtkWidget *label)
-{
- gtk_widget_destroy(label);
-}
-
-/* used by editor and druid - same code */
-GtkWidget *
-org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- const char *source_url, *owa_url;
- GtkWidget *owa_entry;
- CamelURL *url;
- int row;
- GtkWidget *hbox, *label, *button;
-
- target_account = (EMConfigTargetAccount *)data->config->target;
- source_url = e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL);
- url = camel_url_new(source_url, NULL);
- if (url == NULL
- || strcmp(url->protocol, "exchange") != 0) {
- if (url)
- camel_url_free(url);
-
- if (data->old
- && (label = g_object_get_data((GObject *)data->old, "authenticate-label")))
- gtk_widget_destroy(label);
-
- /* TODO: we could remove 'owa-url' from the url,
- but that will lose it if we come back. Maybe a commit callback could do it */
-
- return NULL;
- }
-
- if (data->old) {
- camel_url_free(url);
- return data->old;
- }
-
- owa_url = camel_url_get_param(url, "owa_url");
-
- row = ((GtkTable *)data->parent)->nrows;
-
- hbox = gtk_hbox_new (FALSE, 6);
- label = gtk_label_new_with_mnemonic(_("_OWA Url:"));
- gtk_widget_show(label);
-
- owa_entry = gtk_entry_new();
- if (owa_url)
- gtk_entry_set_text(GTK_ENTRY (owa_entry), owa_url);
- gtk_label_set_mnemonic_widget((GtkLabel *)label, owa_entry);
-
- button = gtk_button_new_with_mnemonic (_("A_uthenticate"));
- gtk_widget_set_sensitive (button, owa_url && owa_url[0]);
-
- gtk_box_pack_start (GTK_BOX (hbox), owa_entry, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
- gtk_widget_show_all(hbox);
-
- gtk_table_attach (GTK_TABLE (data->parent), label, 0, 1, row, row+1, 0, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (data->parent), hbox, 1, 2, row, row+1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
-
- g_signal_connect (owa_entry, "changed", G_CALLBACK(owa_editor_entry_changed), data->config);
- g_object_set_data((GObject *)owa_entry, "authenticate-button", button);
- g_signal_connect (button, "clicked", G_CALLBACK(owa_authenticate_user), data->config);
-
- /* Track the authenticate label, so we can destroy it if e-config is to destroy the hbox */
- g_object_set_data((GObject *)hbox, "authenticate-label", label);
-
- return hbox;
-}
-
-gboolean
-org_gnome_exchange_check_options(EPlugin *epl, EConfigHookPageCheckData *data)
-{
- EMConfigTargetAccount *target = (EMConfigTargetAccount *)data->config->target;
- int status = TRUE;
-
- /* We assume that if the host is set, then the setting is valid.
- The host gets set when the provider validate() call is made */
- if (data->pageid == NULL || strcmp(data->pageid, "20.receive_options") == 0) {
- CamelURL *url;
-
- url = camel_url_new(e_account_get_string(target->account, E_ACCOUNT_SOURCE_URL), NULL);
- /* Note: we only care about exchange url's, we WILL get called on all other url's too. */
- if (url != NULL
- && strcmp(url->protocol, "exchange") == 0
- && (url->host == NULL || url->host[0] == 0))
- status = FALSE;
-
- if (url)
- camel_url_free(url);
- }
-
- return status;
-}
diff --git a/plugins/exchange-account-setup/exchange-ask-password.c b/plugins/exchange-account-setup/exchange-ask-password.c
deleted file mode 100644
index c21bd67c07..0000000000
--- a/plugins/exchange-account-setup/exchange-ask-password.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Sushma Rai <rsushma@novell.com>
- * Copyright (C) 2004 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#include <string.h>
-#include <libgnome/gnome-i18n.h>
-#include <glade/glade.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkdialog.h>
-#include <camel/camel-provider.h>
-#include <camel/camel-url.h>
-#include "mail/em-account-editor.h"
-#include "mail/em-config.h"
-#include "e-util/e-account.h"
-#include "e-util/e-passwords.h"
-#include "e-util/e-config.h"
-
-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);
-gboolean org_gnome_exchange_check_options (EPlugin *epl, EConfigHookPageCheckData *data);
-
-const char *owa_entry_text = NULL;
-
-typedef gboolean (CamelProviderValidateUserFunc) (CamelURL *camel_url, const char *url, gboolean *remember_password, CamelException *ex);
-
-typedef struct {
- CamelProviderValidateUserFunc *validate_user;
-}CamelProviderValidate;
-
-int
-e_plugin_lib_enable (EPluginLib *ep, int enable)
-{
- if (enable) {
- }
- return 0;
-}
-
-void
-exchange_options_commit (EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- return;
-}
-
-static gboolean
-validate_exchange_user (void *data)
-{
- EMConfigTargetAccount *target_account = data;
- CamelProviderValidate *validate;
- CamelURL *url=NULL;
- CamelProvider *provider = NULL;
- gboolean valid = FALSE, *remember_password;
- char *account_url, *url_string;
- const char *source_url, *id_name;
- static int count = 0;
- char *at, *user;
-
- if (count)
- return valid;
-
- source_url = e_account_get_string (target_account->account,
- E_ACCOUNT_SOURCE_URL);
- account_url = g_strdup (source_url);
- provider = camel_provider_get (account_url, NULL);
- if (!provider) {
- return FALSE; /* This should never happen */
- }
- url = camel_url_new_with_base (NULL, account_url);
- validate = provider->priv;
- if (validate) {
-
- if (url->user == NULL) {
- id_name = e_account_get_string (target_account->account,
- E_ACCOUNT_ID_ADDRESS);
- if (id_name) {
- at = strchr(id_name, '@');
- user = g_alloca(at-id_name+1);
- memcpy(user, id_name, at-id_name);
- user[at-id_name] = 0;
-
- camel_url_set_user (url, user);
- }
- }
- valid = validate->validate_user (url, owa_entry_text,
- remember_password, NULL);
- }
-
- /* FIXME: need to check for return value */
- if (valid) {
- count ++;
- url_string = camel_url_to_string (url, 0);
- e_account_set_string (target_account->account,
- E_ACCOUNT_SOURCE_URL, url_string);
- e_account_set_string (target_account->account,
- E_ACCOUNT_TRANSPORT_URL, url_string);
- target_account->account->source->save_passwd = *remember_password;
- }
-
- camel_url_free (url);
- g_free (account_url);
- return valid;
-}
-
-static void
-ok_button_clicked (GtkWidget *button, void *data)
-{
- gboolean valid = FALSE;
-
- valid = validate_exchange_user (data); // FIXME: return value
-}
-
-static void
-owa_entry_changed (GtkWidget *entry, void *data)
-{
- GtkWidget *button = data;
-
- /* FIXME: return owa_entry_text instead of making it global */
- owa_entry_text = gtk_entry_get_text (GTK_ENTRY (entry));
- if (owa_entry_text)
- gtk_widget_set_sensitive (button, TRUE);
-}
-
-static GtkWidget *
-add_owa_entry (GtkWidget *parent,
- EConfig *config,
- EMConfigTargetAccount *target_account)
-{
- GtkWidget *section, *owa_entry;
- GtkWidget *hbox, *hbox_inner, *label, *button;
- GList *container_list, *l;
- GValue rows = { 0, };
- GValue cols = { 0, };
- gint n_rows, n_cols;
-
- /* Since configure section in the receive page is not plugin enabled
- * traversing through the container hierarchy to get the reference
- * to the table, to which owa_url entry has to be added.
- * This needs to be changed once we can access configure section from
- * the plugin.
- */
-
- container_list = gtk_container_get_children (GTK_CONTAINER (parent));
- l = g_list_nth (container_list, 1); /* vboxsourceborder */
- container_list = gtk_container_get_children (GTK_CONTAINER (l->data));
- l = g_list_nth (container_list, 0); /* sourcevbox */
- container_list = gtk_container_get_children (GTK_CONTAINER (l->data));
- l = g_list_nth (container_list, 2); /* source frame */
- container_list = gtk_container_get_children (GTK_CONTAINER (l->data));
- l = g_list_nth (container_list, 1); /* hbox173 */
- container_list = gtk_container_get_children (GTK_CONTAINER (l->data));
- l = g_list_nth (container_list, 1); /* table 13 */
- container_list = gtk_container_get_children (GTK_CONTAINER (l->data));
- l = g_list_nth (container_list, 0); /* table 4*/
-
- g_value_init (&rows, G_TYPE_INT);
- g_value_init (&cols, G_TYPE_INT);
- g_object_get_property (G_OBJECT (l->data), "n-rows", &rows);
- g_object_get_property (G_OBJECT (l->data), "n-columns", &cols);
- n_rows = g_value_get_int (&rows);
- n_cols = g_value_get_int (&cols);
-
- hbox = gtk_hbox_new (FALSE, 6);
- gtk_widget_show (hbox);
-
- hbox_inner = gtk_hbox_new (FALSE, 6);
- gtk_widget_show (hbox_inner);
-
- owa_entry = gtk_entry_new ();
- gtk_widget_show (owa_entry);
-
- button = gtk_button_new_with_mnemonic (_("A_uthenticate"));
- gtk_widget_set_sensitive (button, FALSE);
- gtk_widget_show (button);
-
- gtk_box_pack_start (GTK_BOX (hbox_inner), owa_entry, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (hbox_inner), button, TRUE, TRUE, 0);
-
- label = gtk_label_new_with_mnemonic(_("_OWA Url:"));
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_widget_show (label);
-
- gtk_box_pack_start (GTK_BOX (hbox), hbox_inner, TRUE, TRUE, 0);
-
- gtk_table_attach (GTK_TABLE (l->data), label, 0, n_cols-1, n_rows, n_rows+1, GTK_FILL, GTK_FILL, 0, 0);
- gtk_table_attach (GTK_TABLE (l->data), hbox, n_cols-1, n_cols, n_rows, n_rows+1, GTK_FILL, GTK_FILL, 0, 0);
-
- gtk_widget_show (GTK_WIDGET (l->data));
-
- g_signal_connect (owa_entry, "changed",
- G_CALLBACK (owa_entry_changed), button);
- g_signal_connect (button, "clicked",
- G_CALLBACK (ok_button_clicked), target_account);
-
- section = gtk_vbox_new (FALSE, 0);
- gtk_widget_hide (section);
- return section; /* FIXME: return entry */
-}
-
-GtkWidget *
-org_gnome_exchange_read_url (EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- EConfig *config;
- char *account_url = NULL, *exchange_url = NULL;
- const char *source_url;
- GtkWidget *owa_entry = NULL, *parent;
-
- config = data->config;
- target_account = (EMConfigTargetAccount *)data->config->target;
-
- 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");
-
- if (exchange_url) {
- if (data->old)
- return data->old;
-
- parent = data->parent;
- owa_entry = add_owa_entry (parent, config, target_account);
- }
- g_free (account_url);
- return owa_entry;
-}
-
-
-GtkWidget *
-org_gnome_exchange_handle_auth (EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- EConfig *config;
- char *account_url = NULL, *exchange_url = NULL, *url_string;
- const char *source_url;
- char *auth_type;
- GtkWidget *auth_section=NULL, *parent, *section;
-
- config = data->config;
- target_account = (EMConfigTargetAccount *)data->config->target;
-
- 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");
-
- if (exchange_url) {
- parent = data->parent;
-
- /* We don't need auth section while creating the account. But
- * we need that in the Editor. And since we get the child vbox
- * from the plugin, we are finding the parent section and
- * hiding it. This is a temporary fix and this needs to be handled
- * in the proper way. */
- section = gtk_widget_get_parent (gtk_widget_get_parent (parent));
- gtk_widget_hide (section);
- }
- auth_section = gtk_entry_new ();
- gtk_widget_hide (auth_section);
- return auth_section;
-}
-
-GtkWidget *
-org_gnome_exchange_handle_send_auth_option (EPlugin *epl, EConfigHookItemFactoryData *data)
-{
- EMConfigTargetAccount *target_account;
- EConfig *config;
- char *account_url = NULL, *exchange_url = NULL, *url_string;
- const char *source_url;
- char *auth_type;
- GtkWidget *auth_section=NULL, *parent, *section;
-
- config = data->config;
- target_account = (EMConfigTargetAccount *)data->config->target;
-
- 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");
-
- if (exchange_url) {
- parent = data->parent;
- /* We don't need auth section while creating the account. But
- * we need that in the Editor. And since we get the child vbox
- * from the plugin, we are finding the parent section and
- * hiding it. This is a temporary fix and this needs to be handled
- * in the proper way. */
- section = gtk_widget_get_parent (
- gtk_widget_get_parent (gtk_widget_get_parent(parent)));
- gtk_widget_hide (section);
- }
- auth_section = gtk_entry_new ();
- gtk_widget_hide (auth_section);
- return auth_section;
-}
-
-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;
-}
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
deleted file mode 100644
index ab56919037..0000000000
--- a/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0"?>
-<e-plugin-list>
- <e-plugin
- type="shlib"
- id="org.gnome.evolution.plugin.exchange-account-settings"
- location="@PLUGINDIR@/liborg-gnome-exchange-account-settings.so"
- load-on-startup="true"
- name="Exchange Account Setup"
- description="A pluign for Exchange account specific settings">
-
- <hook class="org.gnome.evolution.mail.config:1.0">
- <group
- target="account"
- id="org.gnome.evolution.mail.config.accountEditor"
- check="org_gnome_exchange_check_options">
- <item type="page"
- path="40.oof"
- label="Exchange Settings"
- factory="org_gnome_exchange_settings"/>
- <item type="item_table"
- path="10.receive/10.config/20.owa"
- factory="org_gnome_exchange_owa_url"/>
- </group>
-
- <group
- target="account"
- id="org.gnome.evolution.mail.config.accountDruid"
- check="org_gnome_exchange_check_options">
- <item type="item_table"
- path="10.receive/10.config/20.owa"
- factory="org_gnome_exchange_owa_url"/>
- </group>
- </hook>
-
- </e-plugin>
-</e-plugin-list>