** Fixes bug #537415
authorMatthew Barnes <mbarnes@redhat.com>
Tue, 8 Jul 2008 14:52:08 +0000 (14:52 +0000)
committerMatthew Barnes <mbarnes@src.gnome.org>
Tue, 8 Jul 2008 14:52:08 +0000 (14:52 +0000)
2008-07-08  Matthew Barnes  <mbarnes@redhat.com>

** Fixes bug #537415

* libedataserverui/e-book-auth-util.c (load_source_auth_cb):
Break a busy loop between Evolution and Gnome-Keyring by only
reauthenticating when the EBookStatus is AUTHENTICATION_FAILED
or AUTHENTICATION_REQUIRED.  Fixes a case where we kept trying
to authenticate to an unspecified Global Catalog server, where
the EBookStatus was REPOSITORY_OFFLINE.

svn path=/trunk/; revision=9098

libedataserverui/ChangeLog
libedataserverui/e-book-auth-util.c

index c5da96d..60d6846 100644 (file)
@@ -1,3 +1,14 @@
+2008-07-08  Matthew Barnes  <mbarnes@redhat.com>
+
+       ** Fixes bug #537415
+
+       * e-book-auth-util.c (load_source_auth_cb):
+       Break a busy loop between Evolution and Gnome-Keyring by only
+       reauthenticating when the EBookStatus is AUTHENTICATION_FAILED
+       or AUTHENTICATION_REQUIRED.  Fixes a case where we kept trying
+       to authenticate to an unspecified Global Catalog server, where
+       the EBookStatus was REPOSITORY_OFFLINE.
+
 2008-06-11  Srinivasa Ragavan  <sragavan@novell.com>
 
        ** Fix for bug #534946
index aaa2558..a91ad71 100644 (file)
@@ -72,9 +72,10 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
 {
        LoadSourceData *data = closure;
 
-       if (status != E_BOOK_ERROR_OK) {
+       switch (status) {
+
                /* the user clicked cancel in the password dialog */
-               if (status == E_BOOK_ERROR_CANCELLED) {
+               case E_BOOK_ERROR_CANCELLED:
                        if (e_book_check_static_capability (book, "anon-access")) {
                                GtkWidget *dialog;
 
@@ -89,21 +90,16 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
                                                                 _("Accessing LDAP Server anonymously"));
                                g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
                                gtk_widget_show (dialog);
-                               if (data->open_func)
-                                       data->open_func (book, E_BOOK_ERROR_OK, data->open_func_data);
-                               free_load_source_data (data);
-                               return;
                        }
-               } else if (status == E_BOOK_ERROR_INVALID_SERVER_VERSION) {
-#if 0
-                       e_error_run (NULL, "addressbook:server-version", NULL);
-#endif
+                       break;
+
+               case E_BOOK_ERROR_INVALID_SERVER_VERSION:
                        status = E_BOOK_ERROR_OK;
-                       if (data->open_func)
-                               data->open_func (book, status, data->open_func_data);
-                       free_load_source_data (data);
-                       return;
-               } else {
+                       break;
+
+               case E_BOOK_ERROR_AUTHENTICATION_FAILED:
+               case E_BOOK_ERROR_AUTHENTICATION_REQUIRED:
+               {
                        const gchar *uri = e_book_get_uri (book);
                        gchar *stripped_uri = remove_parameters_from_uri (uri);
                        const gchar *auth_domain = e_source_get_property (data->source, "auth-domain");
@@ -120,6 +116,9 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
 
                        return;
                }
+
+               default:
+                       break;
        }
 
        if (data->open_func)