Bug #32008 --> add a requiresPassword method which we can use to

prevent us from always asking the user for a password whenever
 we need to logon to an external service.
r=bienvenu
This commit is contained in:
mscott%netscape.com 2000-03-21 06:11:51 +00:00
Родитель 18119c7d6a
Коммит 7cd3da05a1
1 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -1595,14 +1595,19 @@ nsresult nsImapIncomingServer::RequestOverrideInfo(nsIMsgWindow *aMsgWindow)
{ {
nsXPIDLCString password; nsXPIDLCString password;
nsXPIDLCString userName; nsXPIDLCString userName;
PRBool requiresPassword = PR_TRUE;
GetUsername(getter_Copies(userName)); GetUsername(getter_Copies(userName));
GetPassword(getter_Copies(password)); m_logonRedirector->RequiresPassword(userName, &requiresPassword);
if (requiresPassword)
{
GetPassword(getter_Copies(password));
if (!((const char *) password) || nsCRT::strlen((const char *) password) == 0) if (!((const char *) password) || nsCRT::strlen((const char *) password) == 0)
PromptForPassword(getter_Copies(password), aMsgWindow); PromptForPassword(getter_Copies(password), aMsgWindow);
if (password) }
rv = m_logonRedirector->Logon(userName, password, logonRedirectorRequester, nsMsgLogonRedirectionServiceIDs::Imap);
rv = m_logonRedirector->Logon(userName, password, logonRedirectorRequester, nsMsgLogonRedirectionServiceIDs::Imap);
} }
} }