fix bug 43886, single signon no longer works, r=jefft

git-svn-id: svn://10.0.0.236/trunk@73323 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
morse%netscape.com
2000-06-27 21:13:50 +00:00
parent 2e42013815
commit 73cb88057f
9 changed files with 21 additions and 17 deletions

View File

@@ -315,7 +315,7 @@ char * PromptUserCallback(void *arg, char *prompt, int isPasswd)
if (NS_SUCCEEDED(rv)) {
rv = dialog->PromptPassword(nsnull, NS_ConvertASCIItoUCS2(prompt).GetUnicode(),
NS_ConvertASCIItoUCS2(" ").GetUnicode(), // hostname
PR_TRUE, &password, &value);
nsIPrompt::SAVE_PASSWORD_NEVER, &password, &value);
if (NS_SUCCEEDED(rv) && value) {
nsString a(password);

View File

@@ -367,7 +367,7 @@ si_CheckGetPassword
if (dialogTitle == nsnull || nsCRT::strlen(dialogTitle) == 0)
prompt_string = Wallet_Localize("PromptForPassword");
PRUnichar * check_string;
if (savePassword != SINGSIGN_SAVE_PERMANENTLY) {
if (savePassword != SINGSIGN_SAVE_PASSWORD_PERMANENTLY) {
check_string = nsnull;
} else if (SI_GetBoolPref(pref_Crypto, PR_FALSE)) {
check_string = Wallet_Localize("SaveThisValueEncrypted");
@@ -428,7 +428,7 @@ si_CheckGetData
if (dialogTitle == nsnull || nsCRT::strlen(dialogTitle) == 0)
prompt_string = Wallet_Localize("PromptForData");
PRUnichar * check_string;
if (savePassword != SINGSIGN_SAVE_PERMANENTLY) {
if (savePassword != SINGSIGN_SAVE_PASSWORD_PERMANENTLY) {
check_string = nsnull;
} else if (SI_GetBoolPref(pref_Crypto, PR_FALSE)) {
check_string = Wallet_Localize("SaveThisValueEncrypted");
@@ -491,7 +491,7 @@ si_CheckGetUsernamePassword
PRUnichar * user_string = Wallet_Localize("UserName");
PRUnichar * password_string = Wallet_Localize("Password");
PRUnichar * check_string;
if (savePassword != SINGSIGN_SAVE_PERMANENTLY) {
if (savePassword != SINGSIGN_SAVE_PASSWORD_PERMANENTLY) {
check_string = nsnull;
} else if (SI_GetBoolPref(pref_Crypto, PR_FALSE)) {
check_string = Wallet_Localize("SaveTheseValuesEncrypted");

View File

@@ -36,8 +36,8 @@
/* Duplicates defines as in nsIPrompt.idl -- keep in sync! */
#define SINGSIGN_SAVE_PASSWORD_NEVER 0
#define SINGSIGN_SAVE_FOR_SESSION 1
#define SINGSIGN_SAVE_PERMANENTLY 2
#define SINGSIGN_SAVE_PASSWORD_FOR_SESSION 1
#define SINGSIGN_SAVE_PASSWORD_PERMANENTLY 2
class nsIPrompt;
XP_BEGIN_PROTOS
@@ -57,17 +57,20 @@ SINGSIGN_RestoreSignonData(nsIPrompt* dialog, const char* passwordRealm, const P
extern nsresult
SINGSIGN_PromptUsernameAndPassword
(const PRUnichar *dialogTitle, const PRUnichar *text, PRUnichar **user, PRUnichar **pwd,
const char* passwordRealm, nsIPrompt* dialog, PRBool *returnValue, PRUint32 savePassword = SINGSIGN_SAVE_PERMANENTLY);
const char* passwordRealm, nsIPrompt* dialog, PRBool *returnValue,
PRUint32 savePassword = SINGSIGN_SAVE_PASSWORD_PERMANENTLY);
extern nsresult
SINGSIGN_PromptPassword
(const PRUnichar *dialogTitle, const PRUnichar *text, PRUnichar **pwd, const char* passwordRealm,
nsIPrompt* dialog, PRBool *returnValue, PRUint32 savePassword = SINGSIGN_SAVE_PERMANENTLY);
(const PRUnichar *dialogTitle, const PRUnichar *text, PRUnichar **pwd,
const char* passwordRealm, nsIPrompt* dialog, PRBool *returnValue,
PRUint32 savePassword = SINGSIGN_SAVE_PASSWORD_PERMANENTLY);
extern nsresult
SINGSIGN_Prompt
(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *defaultText, PRUnichar **resultText,
const char* passwordRealm, nsIPrompt* dialog, PRBool *returnValue, PRUint32 savePassword = SINGSIGN_SAVE_PERMANENTLY);
const char* passwordRealm, nsIPrompt* dialog, PRBool *returnValue,
PRUint32 savePassword = SINGSIGN_SAVE_PASSWORD_PERMANENTLY);
extern PRBool
SINGSIGN_RemoveUser

View File

@@ -632,7 +632,7 @@ nsMsgIncomingServer::GetPasswordWithUI(const PRUnichar * aPromptMessage, const
rv = GetServerURI(getter_Copies(serverUri));
if (NS_FAILED(rv)) return rv;
rv = dialog->PromptPassword(aPromptTitle, aPromptMessage,
NS_ConvertToString(serverUri).GetUnicode(), PR_TRUE,
NS_ConvertToString(serverUri).GetUnicode(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
getter_Copies(uniPassword), okayValue);
if (NS_FAILED(rv)) return rv;

View File

@@ -209,7 +209,7 @@ nsSmtpServer::GetPasswordWithUI(const PRUnichar * aPromptMessage, const
rv = GetServerURI(getter_Copies(serverUri));
if (NS_FAILED(rv)) return rv;
rv = aDialog->PromptPassword(aPromptTitle, aPromptMessage,
NS_ConvertToString(serverUri).GetUnicode(), PR_TRUE,
NS_ConvertToString(serverUri).GetUnicode(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
getter_Copies(uniPassword), &okayValue);
if (NS_FAILED(rv)) return rv;

View File

@@ -2494,7 +2494,7 @@ nsresult nsPop3Protocol::ProcessProtocolState(nsIURI * url, nsIInputStream * aIn
password = SI_PromptPassword
(ce->window_id,
prompt, usernameAndHost,
PR_FALSE, !TestFlag(POP3_PASSWORD_FAILED));
nsIPrompt::SAVE_PASSWORD_PERMANENTLY, !TestFlag(POP3_PASSWORD_FAILED));
ClearFlag(POP3_PASSWORD_FAILED);
PR_Free(usernameAndHost);
#else

View File

@@ -1408,7 +1408,7 @@ nsMsgNewsFolder::GetGroupPasswordWithUI(const PRUnichar * aPromptMessage, const
if (NS_FAILED(rv)) return rv;
nsAutoString realm = NS_ConvertToString(signonURL);
rv = dialog->PromptPassword(aPromptTitle, aPromptMessage, realm.GetUnicode(), PR_TRUE,
rv = dialog->PromptPassword(aPromptTitle, aPromptMessage, realm.GetUnicode(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
getter_Copies(uniGroupPassword), &okayValue);
if (NS_FAILED(rv)) return rv;

View File

@@ -825,7 +825,7 @@ nsFtpConnectionThread::S_user() {
nsAutoString realm = NS_ConvertToString(host); // XXX i18n
rv = proxyprompter->PromptUsernameAndPassword(nsnull,
message.GetUnicode(),
realm.GetUnicode(), PR_FALSE,
realm.GetUnicode(), nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
&user, &passwd, &retval);
// if the user canceled or didn't supply a username we want to fail
@@ -910,7 +910,8 @@ nsFtpConnectionThread::S_pass() {
rv = proxyprompter->PromptPassword(title.GetUnicode(),
message.GetUnicode(),
NS_ConvertASCIItoUCS2(prePath).GetUnicode(),
PR_FALSE, &passwd, &retval);
nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
&passwd, &retval);
// we want to fail if the user canceled or didn't enter a password.
if (!retval || (passwd && !*passwd) )

View File

@@ -1844,7 +1844,7 @@ nsHTTPChannel::Authenticate(const char *iChallenge, PRBool iProxyAuth)
rv = mPrompter->PromptUsernameAndPassword(nsnull,
message.GetUnicode(),
prePath.GetUnicode(),
PR_FALSE,
nsIPrompt::SAVE_PASSWORD_PERMANENTLY,
getter_Copies(userBuf),
getter_Copies(passwdBuf),
&retval);