don't allow post-to-insecure-from-secure warning to be turned off: bug 50168 r=javi sr=blizzard

This commit is contained in:
jgmyers%netscape.com 2001-05-07 23:56:06 +00:00
Родитель 54c7bc2961
Коммит 796fc57294
3 изменённых файлов: 17 добавлений и 15 удалений

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

@ -88,10 +88,6 @@
<checkbox id="warnInsecurePost" label="&warn.insecurepost;" <checkbox id="warnInsecurePost" label="&warn.insecurepost;"
pref="true" preftype="bool" prefstring="security.warn_submit_insecure" pref="true" preftype="bool" prefstring="security.warn_submit_insecure"
prefattribute="checked"/> prefattribute="checked"/>
<checkbox id="warnInsecurePostFromSecure"
label="&warn.insecurepostfromsecure;"
pref="true" preftype="bool" prefstring="security.warn_insecure_post_from_secure"
prefattribute="checked" checked="true" disabled="true"/>
<checkbox id="warnSecureRedirect" label="&warn.secureredirect;" <checkbox id="warnSecureRedirect" label="&warn.secureredirect;"
pref="true" preftype="bool" prefstring="security.warn_secure_redirect" pref="true" preftype="bool" prefstring="security.warn_secure_redirect"
prefattribute="checked"/> prefattribute="checked"/>

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

@ -36,8 +36,6 @@
<!ENTITY warn.enteringweak "Entering a site that uses weak encryption"> <!ENTITY warn.enteringweak "Entering a site that uses weak encryption">
<!ENTITY warn.insecurepost <!ENTITY warn.insecurepost
"Sending form data from an insecure page to an insecure page"> "Sending form data from an insecure page to an insecure page">
<!ENTITY warn.insecurepostfromsecure
"Sending form data from a secure page to an insecure page">
<!ENTITY warn.secureredirect "Redirection from one secure site to another"> <!ENTITY warn.secureredirect "Redirection from one secure site to another">
<!ENTITY warn.secureredirecttoinsecure <!ENTITY warn.secureredirecttoinsecure
"Redirection from a secure site to an insecure site"> "Redirection from a secure site to an insecure site">

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

@ -496,7 +496,7 @@ nsNSSDialogs::ConfirmPostToInsecureFromSecure(nsIInterfaceRequestor *ctx, PRBool
{ {
nsresult rv; nsresult rv;
rv = ConfirmDialog(ctx, INSECURE_SUBMIT_PREF, rv = ConfirmDialog(ctx, nsnull,
NS_LITERAL_STRING("PostToInsecure").get(), _result); NS_LITERAL_STRING("PostToInsecure").get(), _result);
return rv; return rv;
@ -509,9 +509,11 @@ nsNSSDialogs::ConfirmDialog(nsIInterfaceRequestor *ctx, const char *prefName,
nsresult rv; nsresult rv;
// Get user's preference for this alert // Get user's preference for this alert
PRBool prefValue; PRBool prefValue = PR_TRUE;
rv = mPref->GetBoolPref(prefName, &prefValue); if (prefName) {
if (NS_FAILED(rv)) prefValue = PR_TRUE; rv = mPref->GetBoolPref(prefName, &prefValue);
if (NS_FAILED(rv)) prefValue = PR_TRUE;
}
// Stop if confirm is not requested // Stop if confirm is not requested
if (!prefValue) { if (!prefValue) {
@ -530,14 +532,20 @@ nsNSSDialogs::ConfirmDialog(nsIInterfaceRequestor *ctx, const char *prefName,
getter_Copies(windowTitle)); getter_Copies(windowTitle));
mStringBundle->GetStringFromName(messageName, mStringBundle->GetStringFromName(messageName,
getter_Copies(message)); getter_Copies(message));
mStringBundle->GetStringFromName(NS_LITERAL_STRING("DontShowAgain").get(), if (!windowTitle || !message) return NS_ERROR_FAILURE;
getter_Copies(dontShowAgain));
if (!windowTitle || !message || !dontShowAgain) return NS_ERROR_FAILURE; if (prefName) {
mStringBundle->GetStringFromName(NS_LITERAL_STRING("DontShowAgain").get(),
getter_Copies(dontShowAgain));
if (!dontShowAgain) return NS_ERROR_FAILURE;
rv = prompt->ConfirmCheck(windowTitle, message, dontShowAgain, &prefValue, _result); rv = prompt->ConfirmCheck(windowTitle, message, dontShowAgain, &prefValue, _result);
} else {
rv = prompt->Confirm(windowTitle, message, _result);
}
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
if (!prefValue) { if (prefName && !prefValue) {
mPref->SetBoolPref(prefName, PR_FALSE); mPref->SetBoolPref(prefName, PR_FALSE);
} }