2007-12-19 14:45:48 +01:00
|
|
|
=== modified file 'calendar/common/authentication.c'
|
|
|
|
--- calendar/common/authentication.c 2007-12-18 20:23:31 +0000
|
|
|
|
+++ calendar/common/authentication.c 2007-12-18 20:35:33 +0000
|
|
|
|
@@ -30,6 +30,7 @@
|
|
|
|
#include <libedataserver/e-source.h>
|
2007-01-09 17:43:57 +01:00
|
|
|
#include <libedataserverui/e-passwords.h>
|
|
|
|
#include "authentication.h"
|
|
|
|
+#include <libedataserver/e-url.h>
|
|
|
|
|
|
|
|
static GHashTable *source_lists_hash = NULL;
|
|
|
|
|
2007-12-19 14:45:48 +01:00
|
|
|
@@ -55,6 +56,44 @@
|
2007-01-09 17:43:57 +01:00
|
|
|
return password;
|
2007-12-19 14:45:48 +01:00
|
|
|
}
|
|
|
|
|
2007-01-09 17:43:57 +01:00
|
|
|
+static char *
|
|
|
|
+build_pass_key (ECal *ecal)
|
|
|
|
+{
|
|
|
|
+ char *euri_str;
|
|
|
|
+ const char *uri;
|
|
|
|
+ EUri *euri;
|
|
|
|
+
|
|
|
|
+ uri = e_cal_get_uri (ecal);
|
|
|
|
+
|
|
|
|
+ euri = e_uri_new (uri);
|
|
|
|
+ euri_str = e_uri_to_string (euri, FALSE);
|
|
|
|
+
|
|
|
|
+ e_uri_free (euri);
|
|
|
|
+ return euri_str;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void
|
|
|
|
+auth_cal_forget_password (ECal *ecal)
|
|
|
|
+{
|
|
|
|
+ ESource *source = NULL;
|
|
|
|
+ const char *auth_domain = NULL, *component_name = NULL, *auth_type = NULL;
|
|
|
|
+ char *key = NULL;
|
|
|
|
+
|
|
|
|
+ source = e_cal_get_source (ecal);
|
|
|
|
+ auth_domain = e_source_get_property (source, "auth-domain");
|
|
|
|
+ component_name = auth_domain ? auth_domain : "Calendar";
|
|
|
|
+
|
|
|
|
+ auth_type = e_source_get_property (source, "auth-type");
|
|
|
|
+ if (auth_type)
|
|
|
|
+ key = build_pass_key (ecal);
|
|
|
|
+ else
|
|
|
|
+ key = e_source_get_uri (source);
|
|
|
|
+
|
|
|
|
+ e_passwords_forget_password (component_name, key);
|
|
|
|
+
|
|
|
|
+ g_free (key);
|
2007-12-19 14:45:48 +01:00
|
|
|
+}
|
|
|
|
+
|
2007-01-09 17:43:57 +01:00
|
|
|
ECal *
|
2007-12-19 14:45:48 +01:00
|
|
|
auth_new_cal_from_default (ECalSourceType type)
|
|
|
|
{
|
|
|
|
|
|
|
|
=== modified file 'calendar/common/authentication.h'
|
|
|
|
--- calendar/common/authentication.h 2007-12-18 20:23:31 +0000
|
|
|
|
+++ calendar/common/authentication.h 2007-12-18 20:35:33 +0000
|
2007-01-09 17:43:57 +01:00
|
|
|
@@ -30,5 +30,6 @@
|
|
|
|
ECal *auth_new_cal_from_default (ECalSourceType type);
|
|
|
|
ECal *auth_new_cal_from_source (ESource *source, ECalSourceType type);
|
|
|
|
ECal *auth_new_cal_from_uri (const char *uri, ECalSourceType type);
|
|
|
|
+void auth_cal_forget_password (ECal *ecal);
|
|
|
|
|
|
|
|
#endif
|
2007-12-19 14:45:48 +01:00
|
|
|
|
|
|
|
=== modified file 'calendar/gui/e-tasks.c'
|
|
|
|
--- calendar/gui/e-tasks.c 2007-12-18 20:23:31 +0000
|
|
|
|
+++ calendar/gui/e-tasks.c 2007-12-18 20:35:33 +0000
|
|
|
|
@@ -962,6 +962,9 @@
|
2007-01-09 17:43:57 +01:00
|
|
|
priv = tasks->priv;
|
|
|
|
|
|
|
|
source = e_cal_get_source (ecal);
|
|
|
|
+
|
|
|
|
+ if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED)
|
|
|
|
+ auth_cal_forget_password (ecal);
|
|
|
|
|
|
|
|
switch (status) {
|
|
|
|
case E_CALENDAR_STATUS_OK :
|
2007-12-19 14:45:48 +01:00
|
|
|
@@ -1008,6 +1011,9 @@
|
2007-01-09 17:43:57 +01:00
|
|
|
|
|
|
|
source = e_cal_get_source (ecal);
|
2007-12-19 14:45:48 +01:00
|
|
|
|
2007-01-09 17:43:57 +01:00
|
|
|
+ if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED)
|
|
|
|
+ auth_cal_forget_password (ecal);
|
2007-12-19 14:45:48 +01:00
|
|
|
+
|
2007-01-09 17:43:57 +01:00
|
|
|
switch (status) {
|
|
|
|
case E_CALENDAR_STATUS_OK :
|
2007-12-19 14:45:48 +01:00
|
|
|
g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL);
|
|
|
|
|
|
|
|
=== modified file 'calendar/gui/gnome-cal.c'
|
|
|
|
--- calendar/gui/gnome-cal.c 2007-12-18 20:23:31 +0000
|
|
|
|
+++ calendar/gui/gnome-cal.c 2007-12-18 20:35:33 +0000
|
|
|
|
@@ -2642,6 +2642,10 @@
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED && source_type == E_CAL_SOURCE_TYPE_EVENT)
|
|
|
|
+ auth_cal_forget_password (ecal);
|
|
|
|
+
|
|
|
|
switch (status) {
|
|
|
|
case E_CALENDAR_STATUS_OK:
|
|
|
|
break;
|
|
|
|
|