user password code is now implemented on the server not on the folder...

This commit is contained in:
mscott%netscape.com 1999-08-31 04:42:22 +00:00
Родитель 7b2cea9125
Коммит 0007738fb3
2 изменённых файлов: 0 добавлений и 49 удалений

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

@ -2878,53 +2878,6 @@ nsImapMailFolder::SetImapHostPassword(nsIImapProtocol* aProtocol,
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsImapMailFolder::GetPasswordForUser(nsIImapProtocol* aProtocol,
const char* userName)
{
nsresult rv = NS_OK;
NS_WITH_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID, &rv);
nsCOMPtr<nsIMsgIncomingServer> server;
if (NS_SUCCEEDED(rv))
rv = GetServer(getter_AddRefs(server));
if (NS_SUCCEEDED(rv))
{
PRUnichar * uniPassword;
PRBool okayValue = PR_TRUE;
char * promptText = nsnull;
PRUnichar *passwordPrompt = IMAPGetStringByID(IMAP_ENTER_PASSWORD_PROMPT);
char *hostName = nsnull;
GetHostname(&hostName);
// lossy, but we need to use PR_smprintf
nsCString cStrPasswordPrompt(passwordPrompt);
if (hostName)
promptText = PR_smprintf(cStrPasswordPrompt, userName, (const char *) hostName);
else
promptText = PL_strdup("Enter your password here: ");
PR_FREEIF(hostName);
dialog->PromptPassword(nsAutoString(promptText).GetUnicode(), &uniPassword, &okayValue);
PR_FREEIF(promptText);
if (!okayValue) // if the user pressed cancel, just return NULL;
return nsnull;
nsCAutoString password = uniPassword;
// passwords will always be ascii, right?
// this ugly cast is ok...there is a bug in the idl compiler that is preventing
// the char * argument to SetPassword from being const.
server->SetPassword((char *) password.GetBuffer());
}
return rv;
}
NS_IMETHODIMP
nsImapMailFolder::SetBiffStateAndUpdate(nsIImapProtocol* aProtocol,
nsMsgBiffState biffState)

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

@ -272,8 +272,6 @@ public:
NS_IMETHOD FinishImapConnection(nsIImapProtocol* aProtocol);
NS_IMETHOD SetImapHostPassword(nsIImapProtocol* aProtocol,
GenericInfo* aInfo);
NS_IMETHOD GetPasswordForUser(nsIImapProtocol* aProtocol,
const char* userName);
NS_IMETHOD SetBiffStateAndUpdate(nsIImapProtocol* aProtocol,
nsMsgBiffState biffState);
NS_IMETHOD GetStoredUIDValidity(nsIImapProtocol* aProtocol,