aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorSivaiah Nallagatla <snallagatla@novell.com>2004-04-21 20:24:33 +0800
committerSivaiah Nallagatla <siva@src.gnome.org>2004-04-21 20:24:33 +0800
commitba29b8e23b67d5d409ec5fa195e048ba4849a18e (patch)
tree99619be03d006cf4cb57be42897370235cc653a9 /addressbook
parent6c891b3943a98a3d040d134c69cd9837e099831a (diff)
downloadgsoc2013-evolution-ba29b8e23b67d5d409ec5fa195e048ba4849a18e.tar.gz
gsoc2013-evolution-ba29b8e23b67d5d409ec5fa195e048ba4849a18e.tar.zst
gsoc2013-evolution-ba29b8e23b67d5d409ec5fa195e048ba4849a18e.zip
added a new function to striff off any parameters present after ';' in the
2004-04-21 Sivaiah Nallagatla <snallagatla@novell.com> * gui/component/addressbook.c (remove_parameters_from_uri) : added a new function to striff off any parameters present after ';' in the uri (load_source_auth_cb) (addressbook_authenticate) : call above function to remove anything after ';' before passing uri to e-password calls svn path=/trunk/; revision=25560
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/gui/component/addressbook.c27
2 files changed, 31 insertions, 3 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 1d4322a017..3acec61928 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,10 @@
+2004-04-21 Sivaiah Nallagatla <snallagatla@novell.com>
+
+ * gui/component/addressbook.c (remove_parameters_from_uri) : added
+ a new function to striff off any parameters present after ';' in the uri
+ (load_source_auth_cb) (addressbook_authenticate) : call above function to
+ remove anything after ';' before passing uri to e-password calls
+
2004-04-21 Hans Petter Jansson <hpj@ximian.com>
* gui/contact-editor/e-contact-editor.h (EContactEditor): Remove
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 4e1afeef1d..d9628eeb50 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -52,6 +52,22 @@ free_load_source_data (LoadSourceData *data)
g_free (data);
}
+/*this function removes of anything present after semicolon
+in uri*/
+
+static gchar*
+remove_parameters_from_uri (gchar *uri)
+{
+ gchar **components;
+ gchar *new_uri = NULL;
+
+ components = g_strsplit (uri, ";", 2);
+ if (components[0])
+ new_uri = g_strdup (components[0]);
+ g_strfreev (components);
+ return new_uri;
+}
+
static void
load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
{
@@ -79,10 +95,11 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
}
else {
gchar *uri = e_source_get_uri (data->source);
-
- e_passwords_forget_password ("Addressbook", uri);
+ gchar *stripped_uri = remove_parameters_from_uri (uri);
+ e_passwords_forget_password ("Addressbook", stripped_uri);
addressbook_authenticate (book, TRUE, data->source, load_source_auth_cb, closure);
-
+
+ g_free (stripped_uri);
g_free (uri);
return;
}
@@ -121,6 +138,10 @@ addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *sourc
const gchar *auth;
const gchar *user;
gchar *uri = e_source_get_uri (source);
+ gchar *stripped_uri = remove_parameters_from_uri (uri);
+
+ g_free (uri);
+ uri = stripped_uri;
password = e_passwords_get_password ("Addressbook", uri);