Files
tubestation/browser/components/prefwindow/content/pref-advanced.xul
ben@bengoodger.com 29d70ad6c6 Fix Firebird bugs
217195 (patch by Jesse Ruderman) - security hole in markLinkVisited (exploited with link.href usage)

219875 (patch by Mike Connor) - localize strings for provisional security UI in Advanced Options panel
2003-09-23 19:34:25 +00:00

282 lines
11 KiB
XML

<?xml version="1.0"?>
#define PROVISIONAL_SECURITY_UI
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/skin/pref/pref.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/pref/pref.css" type="text/css"?>
<!DOCTYPE page [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
<!ENTITY % advancedDTD SYSTEM "chrome://browser/locale/pref/pref-advanced.dtd">
%brandDTD;
%advancedDTD;
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://browser/content/pref/pref-advanced.xul');"
headertitle="&lHeader;">
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["moveSystemCaret", "hideTabBar",
"loadInBackground", "useAutoScrolling",
"useSmoothScrolling", "enableAutoImageResizing",
"useSSL2", "useSSL3", "useTLS1", "useTypeAheadFind",
"linksOnlyTypeAheadFind"
#ifdef PROVISIONAL_SECURITY_UI
, "certSelection", "securityOCSPEnabled", "serviceURL", "signingCA"
#endif
];
#ifdef PROVISIONAL_SECURITY_UI
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIOCSPResponder = Components.interfaces.nsIOCSPResponder;
const nsISupportsArray = Components.interfaces.nsISupportsArray;
var certdb;
var ocspResponders;
#endif
function Startup() {
updatePrefs();
#ifdef PROVISIONAL_SECURITY_UI
var ocspEntry;
var i;
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
ocspResponders = certdb.getOCSPResponders();
var signersMenu = document.getElementById("signingCA");
var signersURL = document.getElementById("serviceURL");
for (i=0; i<ocspResponders.length; i++) {
ocspEntry = ocspResponders.queryElementAt(i, nsIOCSPResponder);
var menuItemNode = document.createElement("menuitem");
menuItemNode.setAttribute("value", ocspEntry.responseSigner);
menuItemNode.setAttribute("label", ocspEntry.responseSigner);
signersMenu.firstChild.appendChild(menuItemNode);
}
doSecurityEnabling();
// XXXben menulists suck, see explanation in pref-privacy.js
// style resolution problem inside scrollable areas.
var scb = document.getElementById("signingCABox");
var sca = document.getElementById("signingCA");
sca.removeAttribute("hidden");
sca.parentNode.removeChild(sca);
scb.appendChild(sca);
#endif
}
function updatePrefs() {
var enabled = document.getElementById("useTypeAheadFind").checked;
var linksOnly = document.getElementById("linksOnlyTypeAheadFind");
linksOnly.disabled = !enabled;
}
#ifdef PROVISIONAL_SECURITY_UI
function doSecurityEnabling()
{
var signersMenu = document.getElementById("signingCA");
var signersURL = document.getElementById("serviceURL");
var radiogroup = document.getElementById("securityOCSPEnabled");
switch ( radiogroup.value ) {
case "0":
case "1":
signersMenu.setAttribute("disabled", true);
signersURL.setAttribute("disabled", true);
break;
case "2":
default:
signersMenu.removeAttribute("disabled");
signersURL.removeAttribute("disabled");
}
}
function changeURL()
{
var signersMenu = document.getElementById("signingCA");
var signersURL = document.getElementById("serviceURL");
var CA = signersMenu.getAttribute("value");
var i;
var ocspEntry;
for (i=0; i < ocspResponders.length; i++) {
ocspEntry = ocspResponders.queryElementAt(i, nsIOCSPResponder);
if (CA == ocspEntry.responseSigner) {
signersURL.setAttribute("value", ocspEntry.serviceURL);
break;
}
}
}
function openCrlManager()
{
window.open('chrome://pippki/content/crlManager.xul', "",
'chrome,width=500,height=400,resizable=1');
}
function openCertManager()
{
//check for an existing certManager window and focus it; it's not application modal
const kWindowMediatorContractID = "@mozilla.org/appshell/window-mediator;1";
const kWindowMediatorIID = Components.interfaces.nsIWindowMediator;
const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID);
var lastCertManager = kWindowMediator.getMostRecentWindow("mozilla:certmanager");
if (lastCertManager)
lastCertManager.focus();
else {
window.open('chrome://pippki/content/certManager.xul', "",
'chrome,height=400,centerscreen,resizable=yes,dialog=no');
}
}
function openDeviceManager()
{
//check for an existing deviceManger window and focus it; it's not application modal
const kWindowMediatorContractID = "@mozilla.org/appshell/window-mediator;1";
const kWindowMediatorIID = Components.interfaces.nsIWindowMediator;
const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID);
var lastCertManager = kWindowMediator.getMostRecentWindow("mozilla:devicemanager");
if (lastCertManager)
lastCertManager.focus();
else {
window.open('chrome://pippki/content/device_manager.xul', "devmgr",
'chrome,height=400,centerscreen,resizable=yes,dialog=no');
}
}
#endif
]]>
</script>
<vbox class="listBox settingsBox" flex="1" style="overflow: auto;">
<expander id="accessibility" label="&accessibility.label;" open="true" persist="open" clearhidden="true">
<checkbox id="moveSystemCaret" label="&moveSystemCaret.label;"
prefstring="accessibility.browsewithcaret"/>
<checkbox id="useTypeAheadFind" label="&useTypeAheadFind.label;"
prefstring="accessibility.typeaheadfind" oncommand="updatePrefs()"/>
<checkbox class="indent" id="linksOnlyTypeAheadFind" label="&linksOnlyTypeAheadFind.label;"
prefstring="accessibility.typeaheadfind.linksonly"/>
</expander>
<expander id="browsing" label="&browsing.label;" open="true" persist="open" clearhidden="true">
<checkbox id="hideTabBar" label="&hideTabBar.label;"
prefstring="browser.tabs.autoHide"/>
<checkbox id="loadInBackground" label="&loadInBackground.label;"
prefstring="browser.tabs.loadInBackground"/>
<checkbox id="useAutoScrolling" label="&useAutoScrolling.label;"
prefstring="general.autoScroll"/>
<checkbox id="useSmoothScrolling" label="&useSmoothScrolling.label;"
prefstring="general.smoothScroll"/>
</expander>
<expander id="multimedia" label="&multimedia.label;" open="true" persist="open" clearhidden="true">
<checkbox id="enableAutoImageResizing" label="&enableAutoImageResizing.label;"
prefstring="browser.enable_automatic_image_resizing"/>
</expander>
<expander id="security" label="&security.label;" open="true" persist="open" clearhidden="true">
<checkbox id="useSSL2" label="&useSSL2.label;"
prefstring="security.enable_ssl2"/>
<checkbox id="useSSL3" label="&useSSL3.label;"
prefstring="security.enable_ssl3"/>
<checkbox id="useTLS1" label="&useTLS1.label;"
prefstring="security.enable_tls"/>
</expander>
#ifdef PROVISIONAL_SECURITY_UI
<expander id="certs" label="&certs.label;" open="false" persist="open" clearhidden="true">
<description>&securityUIDisclaimer.label;</description>
<groupbox align="start">
<caption label="&SSLClientAuthMethod;"/>
<description>&certselect.description;</description>
<!-- Prefs -->
<radiogroup id="certSelection" orient="horizontal" preftype="string"
prefstring="security.default_personal_cert">
<radio label="&certselect.auto;" value="Select Automatically"/>
<radio label="&certselect.ask;" value="Ask Every Time"/>
</radiogroup>
</groupbox>
<!-- Certificate manager -->
<groupbox>
<caption label="&managecerts.label;"/>
<description>&managecerts.text;</description>
<hbox align="center">
<button label="&managecerts.button;"
oncommand="openCertManager();"
id="openCertManagerButton"
accesskey="&managecerts.accesskey;"
prefstring="security.disable_button.openCertManager"/>
</hbox>
</groupbox>
<!-- Device manager -->
<groupbox>
<caption label="&managedevices.label;"/>
<description>&managedevices.text;</description>
<hbox align="center">
<button label="&managedevices.button;"
oncommand="openDeviceManager();"
id="openDeviceManagerButton"
accesskey="&managedevices.accesskey;"
prefstring="security.disable_button.openDeviceManager"/>
</hbox>
</groupbox>
</expander>
<expander id="validation" label="&validation.label;" open="false" persist="open" clearhidden="true">
<description>&securityUIDisclaimer.label;</description>
<groupbox>
<caption label="&validation.crl.label;"/>
<description>&validation.crl.description;</description>
<hbox align="center">
<button label="&validation.managecrls.button;"
oncommand="openCrlManager();"
id="managecrlbutton"
accesskey="&validation.managecrls.accesskey;"
prefstring="security.OCSP.disable_button.managecrl"/>
</hbox>
</groupbox>
<groupbox align="start">
<caption label="&validation.ocsp.label;"/>
<description>&validation.ocsp.description;</description>
<!-- Prefs -->
<radiogroup id="securityOCSPEnabled"
prefstring="security.OCSP.enabled">
<radio value="0" label="&disableOCSP.label;" oncommand="doSecurityEnabling();"/>
<radio value="1" label="&certOCSP.label;" oncommand="doSecurityEnabling();"/>
<radio value="2" label="&proxyOCSP.label;" oncommand="doSecurityEnabling();"/>
<grid class="indent" flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&signingCA.label;" accesskey="&signingCA.accesskey;" control="signingCA"/>
<hbox id="signingCABox" flex="1"/>
</row>
<row align="center">
<label value="&serviceURL.label;" accesskey="&serviceURL.accesskey;" control="serviceURL"/>
<textbox id="serviceURL" prefstring="security.OCSP.URL"/>
</row>
</rows>
</grid>
</radiogroup>
</groupbox>
</expander>
<menulist id="signingCA" preftype="string" prefstring="security.OCSP.signingCA"
flex="1" oncommand="changeURL()" hidden="true">
<menupopup/>
</menulist>
#endif
</vbox>
</page>