Changeset 4006:dc0c95e52a22 for account.c
Legend:
- Unmodified
- Added
- Removed
-
account.c
r3873 r4006 1 1 /* 2 * Copyright (C) 2000- 3Brendan Cully <brendan@kublai.com>2 * Copyright (C) 2000-5 Brendan Cully <brendan@kublai.com> 3 3 * 4 4 * This program is free software; you can redistribute it and/or modify … … 27 27 #include "url.h" 28 28 29 /* mutt_account_match: compare account info (host/port/user ) */29 /* mutt_account_match: compare account info (host/port/user/login) */ 30 30 int mutt_account_match (const ACCOUNT* a1, const ACCOUNT* a2) 31 31 { 32 32 const char* user = NONULL (Username); 33 const char* login = NONULL (Username); 33 34 34 35 if (a1->type != a2->type) … … 40 41 41 42 #ifdef USE_IMAP 42 if (a1->type == M_ACCT_TYPE_IMAP && ImapUser) 43 user = ImapUser; 43 if (a1->type == M_ACCT_TYPE_IMAP) 44 { 45 if (ImapUser) 46 user = ImapUser; 47 if (ImapLogin) 48 login = ImapLogin; 49 } 44 50 #endif 45 51 … … 127 133 } 128 134 129 /* mutt_account_getuser: retrieve username into ACCOUNT, if nec cessary */135 /* mutt_account_getuser: retrieve username into ACCOUNT, if necessary */ 130 136 int mutt_account_getuser (ACCOUNT* account) 131 137 { … … 157 163 } 158 164 159 /* mutt_account_getpass: fetch password into ACCOUNT, if neccessary */ 165 int mutt_account_getlogin (ACCOUNT* account) 166 { 167 /* already set */ 168 if (account->flags & M_ACCT_LOGIN) 169 return 0; 170 #ifdef USE_IMAP 171 else if (account->type == M_ACCT_TYPE_IMAP) 172 { 173 if (ImapLogin) 174 strfcpy (account->login, ImapLogin, sizeof (account->login)); 175 else 176 strfcpy (account->login, ImapUser, sizeof (account->login)); 177 } 178 #endif 179 180 account->flags |= M_ACCT_LOGIN; 181 182 return 0; 183 } 184 185 /* mutt_account_getpass: fetch password into ACCOUNT, if necessary */ 160 186 int mutt_account_getpass (ACCOUNT* account) 161 187 { … … 175 201 { 176 202 snprintf (prompt, sizeof (prompt), _("Password for %s@%s: "), 177 account-> user, account->host);203 account->login, account->host); 178 204 account->pass[0] = '\0'; 179 205 if (mutt_get_password (prompt, account->pass, sizeof (account->pass)))
