aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/common
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2008-02-18 04:29:58 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2008-02-18 04:29:58 +0800
commit4653e2bdddb1afcbc2ce15270dfb42411a5334df (patch)
treeb597ca40e4aa465366596f9ee4f12bc4fa7fff8d /calendar/common
parentf588b4ffedc140a2ded75617fce656eac39466a4 (diff)
downloadgsoc2013-evolution-4653e2bdddb1afcbc2ce15270dfb42411a5334df.tar
gsoc2013-evolution-4653e2bdddb1afcbc2ce15270dfb42411a5334df.tar.gz
gsoc2013-evolution-4653e2bdddb1afcbc2ce15270dfb42411a5334df.tar.bz2
gsoc2013-evolution-4653e2bdddb1afcbc2ce15270dfb42411a5334df.tar.lz
gsoc2013-evolution-4653e2bdddb1afcbc2ce15270dfb42411a5334df.tar.xz
gsoc2013-evolution-4653e2bdddb1afcbc2ce15270dfb42411a5334df.tar.zst
gsoc2013-evolution-4653e2bdddb1afcbc2ce15270dfb42411a5334df.zip
** Fix for bnc #160049. Patch from OpenSUSE.
2008-02-18 Srinivasa Ragavan <sragavan@novell.com> ** Fix for bnc #160049. Patch from OpenSUSE. * common/authentication.c: (build_pass_key), (auth_cal_forget_password): * common/authentication.h: * gui/e-tasks.c: (client_cal_opened_cb), (default_client_cal_opened_cb): * gui/gnome-cal.c: (client_cal_opened_cb): svn path=/trunk/; revision=35035
Diffstat (limited to 'calendar/common')
-rw-r--r--calendar/common/authentication.c39
-rw-r--r--calendar/common/authentication.h1
2 files changed, 40 insertions, 0 deletions
diff --git a/calendar/common/authentication.c b/calendar/common/authentication.c
index f11a0ed1ff..b21cded8e4 100644
--- a/calendar/common/authentication.c
+++ b/calendar/common/authentication.c
@@ -30,6 +30,7 @@
#include <libedataserver/e-source.h>
#include <libedataserverui/e-passwords.h>
#include "authentication.h"
+#include <libedataserver/e-url.h>
static GHashTable *source_lists_hash = NULL;
@@ -55,6 +56,44 @@ auth_func_cb (ECal *ecal, const char *prompt, const char *key, gpointer user_dat
return password;
}
+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);
+}
+
ECal *
auth_new_cal_from_default (ECalSourceType type)
{
diff --git a/calendar/common/authentication.h b/calendar/common/authentication.h
index 2b5804c039..63906eff20 100644
--- a/calendar/common/authentication.h
+++ b/calendar/common/authentication.h
@@ -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