Fix for Bug 91466, Checking in for Hakan Waara

r=javi, cotter sr=hewitt, a=dbaron

Re-work the Unknown CA dialog to make it less confusing.
This commit is contained in:
javi%netscape.com 2001-07-26 01:53:13 +00:00
Родитель 4e55e7c5f6
Коммит bc74c520b1
4 изменённых файлов: 61 добавлений и 70 удалений

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

@ -19,6 +19,7 @@
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
* Håkan Waara <hwaara@chello.se>
*/
@ -43,23 +44,35 @@ function onLoad()
var gBundleBrand = srGetStrBundle("chrome://global/locale/brand.properties");
var brandName = gBundleBrand.GetStringFromName("brandShortName");
var message1 = bundle.formatStringFromName("newServerMessage1",
[ cert.commonName, brandName ],
2);
var message4 = bundle.formatStringFromName("newServerMessage4",
[ cert.commonName ],
1);
setText("message1", message1);
setText("message4", message4);
//Set the focus so key press events work
document.getElementById('ok-button').focus();
var continueButton = bundle.GetStringFromName("continueButton");
document.getElementById("ok").label = continueButton;
var message =
bundle.formatStringFromName("newServerMessage",
[cert.commonName],
1);
var notRecognized =
bundle.formatStringFromName("certNotRecognized",
[brandName],
1);
setText("message", message);
setText("notRecognized", notRecognized);
}
function doHelpButton()
{
openHelp('chrome://help/content/help.xul?new_web_cert');
}
function doOK()
{
dialogParams.SetInt(1,1);
var radioGroup = document.getElementById("trustSiteCert");
dialogParams.SetInt(2,parseInt(radioGroup.selectedItem.value));
var checkbox = document.getElementById("alwaysAccept");
var alwaysAccept = checkbox.getAttribute("checked");
dialogParams.SetInt(2, (alwaysAccept ? 0 : 1));
window.close();
}

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

@ -14,6 +14,7 @@
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
- Håkan Waara <hwaara@chello.se>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
@ -25,65 +26,45 @@
%pippkiDTD;
]>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<window
id="ssl_warning" title="&newserver.title;"
<window id="ssl_warning" title="&newserver.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
debug="false"
height="400"
width="400"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 30em; height: 16em"
class="dialog"
onload="onLoad();"
>
<script src="chrome://global/content/strres.js" />
<script src="pippki.js" />
<script src="newserver.js" />
orient="vertical">
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="pippki.js" />
<script type="application/x-javascript" src="newserver.js" />
<script type="application/x-javascript" src="chrome://help/content/help.js" />
<keyset id="dialogKeys"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK()" />
<key id="return-key" keycode="VK_RETURN" oncommand="doOK()" />
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel()"/>
</keyset>
<vbox flex="1">
<hbox valign="top" autostretch="never">
<vbox style="margin: 5px;" flex="1">
<image class="alert-icon" style="margin: 5px"/>
<vbox flex="1" valign="middle">
<html id="message1" />
<separator/>
<html>&newserver.message2;</html>
<separator/>
<html>&newserver.message3;</html>
<separator/>
<html id="message4" />
<html id="message"/>
<separator class="thin"/>
<html id="notRecognized"/>
<separator/>
<radiogroup id="trustSiteCert" pref="false" orient="vertical">
<radio group="trustSiteCert"
label="&newserver.acceptperm;"
id="acceptRadio"
value="0"/>
<radio group="trustSiteCert"
label="&newserver.accepttemp;"
id="tmpAcceptRadio"
value="1" checked="true"/>
<radio group="trustSiteCert"
id="rejectRadio"
label="&newserver.reject;" value="2"/>
</radiogroup>
<vbox autostretch="never" flex="1" align="right">
<button id="examineCert-button" label="&examineCert.label;"
onclick="viewCert();"/>
</vbox>
<hbox>
<button id="examineCert-button" class="dialog" label="&examineCert.label;"
onclick="viewCert();"/>
</hbox>
<separator/>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;"
style="width: 10ex" onclick="doOK();" disabled="false" primary="true"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
style="width: 10ex" onclick="doCancel();" />
<button id="help-button" class="dialog" label="&help.label;"
style="width: 10ex" oncommand="openHelp('chrome://help/content/help.xul?new_web_cert');" />
<checkbox checked="false" id="alwaysAccept" label="&alwaysAccept.label;"/>
</vbox>
</hbox>
<hbox id="okCancelHelpButtonsRight" flex="1" autostretch="never"/>
</vbox>
</window>

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

@ -16,9 +16,6 @@
-->
<!-- Values for newserver.xul -->
<!ENTITY newserver.title "Security Error: Unknown CA">
<!ENTITY newserver.message2 "Although the Certificate Authority is unrecognized, you can choose to explicitly accept the certificate used by this web site.">
<!ENTITY newserver.message3 "Before accepting this certificate, you should examine this site's certificate carefully.">
<!ENTITY newserver.acceptperm "Accept this certificate permanently">
<!ENTITY newserver.accepttemp "Accept this certificate temporarily for this session">
<!ENTITY newserver.reject "Do not accept this certificate and do not connect to this web site">
<!ENTITY newserver.title "">
<!ENTITY alwaysAccept.label "Remember this certificate permanently">
<!ENTITY continue.label "Continue">

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

@ -21,7 +21,7 @@
# Bob Lord <lord@netscape.com>
#
newServerMessage1="%S" is a web site that uses a security certificate to identify itself. However, %S does not recognize the Certificate Authority that issued this certificate.
newServerMessage4=Are you willing to accept this certificate for the purpose of identifying the web site "%S"?
newServerMessage=There is a problem with the certificate that identifies "%S". Do you want to continue?
certNotRecognized=The certificate was issued by a certificate authority that %S does not recognize.
continueButton=Continue