aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/publish-calendar/publish-calendar.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/publish-calendar/publish-calendar.c')
-rw-r--r--plugins/publish-calendar/publish-calendar.c17
1 files changed, 17 insertions, 0 deletions
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) {