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

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

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

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

@ -16,9 +16,6 @@
--> -->
<!-- Values for newserver.xul --> <!-- Values for newserver.xul -->
<!ENTITY newserver.title "Security Error: Unknown CA"> <!ENTITY newserver.title "">
<!ENTITY newserver.message2 "Although the Certificate Authority is unrecognized, you can choose to explicitly accept the certificate used by this web site."> <!ENTITY alwaysAccept.label "Remember this certificate permanently">
<!ENTITY newserver.message3 "Before accepting this certificate, you should examine this site's certificate carefully."> <!ENTITY continue.label "Continue">
<!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">

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

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