Mercurial > gftp.yaz
comparison lib/protocols.c @ 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 | efe90b739e98 |
children | 8ff1c1647b95 |
comparison
equal
deleted
inserted
replaced
645:ffb8d0e6c165 | 646:cd38f25b7c5e |
---|---|
640 const char * bookmark, int *refresh_local) | 640 const char * bookmark, int *refresh_local) |
641 { | 641 { |
642 gftp_logging_func logging_function; | 642 gftp_logging_func logging_function; |
643 gftp_bookmarks_var * tempentry; | 643 gftp_bookmarks_var * tempentry; |
644 char *default_protocol, *utf8; | 644 char *default_protocol, *utf8; |
645 const char *email; | |
645 int i, init_ret; | 646 int i, init_ret; |
646 | 647 |
647 g_return_val_if_fail (request != NULL, GFTP_EFATAL); | 648 g_return_val_if_fail (request != NULL, GFTP_EFATAL); |
648 g_return_val_if_fail (bookmark != NULL, GFTP_EFATAL); | 649 g_return_val_if_fail (bookmark != NULL, GFTP_EFATAL); |
649 | 650 |
668 | 669 |
669 if (tempentry->user != NULL) | 670 if (tempentry->user != NULL) |
670 gftp_set_username (request, tempentry->user); | 671 gftp_set_username (request, tempentry->user); |
671 | 672 |
672 if (tempentry->pass != NULL) | 673 if (tempentry->pass != NULL) |
673 gftp_set_password (request, tempentry->pass); | 674 { |
675 if (strcmp (tempentry->pass, "@EMAIL@") == 0) | |
676 { | |
677 gftp_lookup_request_option (request, "email", &email); | |
678 gftp_set_password (request, email); | |
679 } | |
680 else | |
681 gftp_set_password (request, tempentry->pass); | |
682 } | |
674 | 683 |
675 if (tempentry->acct != NULL) | 684 if (tempentry->acct != NULL) |
676 gftp_set_account (request, tempentry->acct); | 685 gftp_set_account (request, tempentry->acct); |
677 | 686 |
678 gftp_set_hostname (request, tempentry->hostname); | 687 gftp_set_hostname (request, tempentry->hostname); |