changeset 646:cd38f25b7c5e

2004-12-20 Brian Masney <masneyb@gftp.org> * lib/protocols.c (gftp_parse_bookmark) - if the bookmark's password is set to @EMAIL@, expand it to the users' email address
author masneyb
date Tue, 21 Dec 2004 01:25:40 +0000
parents ffb8d0e6c165
children c197c8fb1e62
files ChangeLog lib/protocols.c
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Dec 13 22:03:31 2004 +0000
+++ b/ChangeLog	Tue Dec 21 01:25:40 2004 +0000
@@ -1,3 +1,7 @@
+2004-12-20 Brian Masney <masneyb@gftp.org>
+	* lib/protocols.c (gftp_parse_bookmark) - if the bookmark's password is
+	set to @EMAIL@, expand it to the users' email address
+
 2004-12-12 Brian Masney <masneyb@gftp.org>
 	* lib/rfc959.c - renamed pasv_behind_router option to
 	ignore_pasv_address. This is a better explanation of what it does
@@ -3152,7 +3156,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.379 2004/12/12 12:09:56 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.380 2004/12/21 01:25:40 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/protocols.c	Mon Dec 13 22:03:31 2004 +0000
+++ b/lib/protocols.c	Tue Dec 21 01:25:40 2004 +0000
@@ -642,6 +642,7 @@
   gftp_logging_func logging_function;
   gftp_bookmarks_var * tempentry;
   char *default_protocol, *utf8;
+  const char *email;
   int i, init_ret;
 
   g_return_val_if_fail (request != NULL, GFTP_EFATAL);
@@ -670,7 +671,15 @@
     gftp_set_username (request, tempentry->user);
 
   if (tempentry->pass != NULL)
-    gftp_set_password (request, tempentry->pass);
+    {
+      if (strcmp (tempentry->pass, "@EMAIL@") == 0)
+        {
+          gftp_lookup_request_option (request, "email", &email);
+          gftp_set_password (request, email);
+        }
+      else
+        gftp_set_password (request, tempentry->pass);
+    }
 
   if (tempentry->acct != NULL)
     gftp_set_account (request, tempentry->acct);