diff options
-rw-r--r-- | plugins/exchange-operations/ChangeLog | 6 | ||||
-rw-r--r-- | plugins/exchange-operations/exchange-folder-subscription.c | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog index bbf4a22930..014968dc71 100644 --- a/plugins/exchange-operations/ChangeLog +++ b/plugins/exchange-operations/ChangeLog @@ -1,3 +1,9 @@ +2006-07-22 Sushma Rai <rsushma@novell.com> + + * exchange-folder-subscription.c (subscribe_to_folder): Checking if a + user is subscribing to his own folder. Fixes #311322. + Patch submitted by "Vandana Shenoy .B <shvandana@novell.com>" + 2006-07-18 Andre Klapper <a9016009@gmx.de> * exchange-change-password.glade: diff --git a/plugins/exchange-operations/exchange-folder-subscription.c b/plugins/exchange-operations/exchange-folder-subscription.c index 122366d9fb..2c75af875b 100644 --- a/plugins/exchange-operations/exchange-folder-subscription.c +++ b/plugins/exchange-operations/exchange-folder-subscription.c @@ -189,6 +189,7 @@ subscribe_to_folder (GtkWidget *dialog, gint response, gpointer data) { SubscriptionInfo *subscription_info = data; gchar *user_email_address = NULL, *folder_name = NULL, *path = NULL; + char *subscriber_email; EFolder *folder = NULL; EDestinationStore *destination_store; GList *destinations; @@ -213,6 +214,18 @@ subscribe_to_folder (GtkWidget *dialog, gint response, gpointer data) if (user_email_address != NULL && *user_email_address != '\0') break; + /* check if user is trying to subscribe to his own folder */ + subscriber_email = exchange_account_get_email_id (subscription_info->account); + if (subscriber_email != NULL && *subscriber_email != '\0') { + if (g_str_equal (subscriber_email, user_email_address)) { + e_error_run (NULL, ERROR_DOMAIN ":folder-exists-error", NULL); + g_free (user_email_address); + gtk_widget_destroy (dialog); + destroy_subscription_info (subscription_info); + return; + } + } + /* It would be nice to insensitivize the OK button appropriately instead of doing this, but unfortunately we can't do this for the Bonobo control. */ |