diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2007-09-10 05:05:57 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2007-09-10 05:05:57 +0800 |
commit | ff3ee70182b39c2f50b26ed096fd934de9497a60 (patch) | |
tree | 82dc18cec77b5ba1202577e0971d977387533d7d | |
parent | 0245574d7861af23f7d1cde9f3208f0eb7581c21 (diff) | |
download | gsoc2013-evolution-ff3ee70182b39c2f50b26ed096fd934de9497a60.tar.gz gsoc2013-evolution-ff3ee70182b39c2f50b26ed096fd934de9497a60.tar.zst gsoc2013-evolution-ff3ee70182b39c2f50b26ed096fd934de9497a60.zip |
Fixes #274048 (bnc)
svn path=/trunk/; revision=34207
-rw-r--r-- | plugins/publish-calendar/ChangeLog | 6 | ||||
-rw-r--r-- | plugins/publish-calendar/publish-calendar.c | 17 |
2 files changed, 23 insertions, 0 deletions
diff --git a/plugins/publish-calendar/ChangeLog b/plugins/publish-calendar/ChangeLog index 0285c195f9..a25bbfdc76 100644 --- a/plugins/publish-calendar/ChangeLog +++ b/plugins/publish-calendar/ChangeLog @@ -1,3 +1,9 @@ +2007-09-10 Chenthill Palanisamy <pchenthill@novell.com> + + Fixes #274048 + * publish-calendar.c: (publish): Prompt for a password + if required. + 2007-07-30 Andre Klapper <a9016009@gmx.de> * publish-calendar.glade: diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c index 6e1e3f9cb6..742d64da3f 100644 --- a/plugins/publish-calendar/publish-calendar.c +++ b/plugins/publish-calendar/publish-calendar.c @@ -70,6 +70,8 @@ publish (EPublishUri *uri) GnomeVFSResult result; GnomeVFSHandle *handle; gchar *password; + const char *username; + gboolean req_pass = FALSE; if (g_slist_find (queued_publishes, uri)) queued_publishes = g_slist_remove (queued_publishes, uri); @@ -80,6 +82,21 @@ publish (EPublishUri *uri) vfs_uri = gnome_vfs_uri_new (uri->location); password = e_passwords_get_password ("Calendar", uri->location); + username = gnome_vfs_uri_get_user_name (vfs_uri); + req_pass = ((username && *username) && !(uri->service_type == TYPE_ANON_FTP && + !strcmp (username, "anonymous"))) ? TRUE:FALSE; + + if (!password && req_pass) { + gboolean remember; + char *prompt = g_strdup_printf (_("Enter the password for %s"), uri->location); + + password = e_passwords_ask_password (_("Enter password"), "", uri->location, prompt, + E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET|E_PASSWORDS_ONLINE, + &remember, + NULL); + g_free (prompt); + } + gnome_vfs_uri_set_password (vfs_uri, password); if (vfs_uri == NULL) { |