Bug 164707, Provide a way to view/delete orphan certs

r=rrelyea


git-svn-id: svn://10.0.0.236/trunk@216563 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kaie%kuix.de 2006-12-06 16:16:52 +00:00
parent 0b9ba08bd5
commit bf7ee32279
6 changed files with 124 additions and 1 deletions

View File

@ -41,6 +41,7 @@
<!ENTITY certmgr.tab.others "Other People's">
<!ENTITY certmgr.tab.websites "Web Sites">
<!ENTITY certmgr.tab.ca "Authorities">
<!ENTITY certmgr.tab.orphan "Extra">
<!ENTITY certmgr.ca.builtins "Built-in CAs">
<!ENTITY certmgr.ca.mycas "CAs Managed By You">
@ -49,6 +50,7 @@
<!ENTITY certmgr.others "You have certificates on file that identify these people:">
<!ENTITY certmgr.websites "You have certificates on file that identify these web sites:">
<!ENTITY certmgr.cas "You have certificates on file that identify these certificate authorities:">
<!ENTITY certmgr.orphans "You have certificates on file that do not fit in any of the other categories:">
<!ENTITY certmgr.detail.general_tab.title "General">
<!ENTITY certmgr.detail.general_tab.accesskey "G">

View File

@ -70,6 +70,11 @@ deleteEmailCertConfirm=Are you sure you want to delete these people's e-mail cer
deleteEmailCertImpact=If you delete an e-mail certificate, your will no longer be able to send encrypted e-mail to those people.
deleteEmailCertTitle=Delete E-Mail Certificates
deleteOrphanCertFlag=deleteOrphanFlag
deleteOrphanCertConfirm=Are you sure you want to delete these certificates?
deleteOrphanCertImpact=
deleteOrphanCertTitle=Delete Certificates
#PKCS#12 file dialogs
chooseP12RestoreFileDialog=File Name to Restore

View File

@ -0,0 +1,79 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is
- Netscape Communications Corp.
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
- Kai Engert <kengert@redhat.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the GPL or the LGPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="OrphanOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="OrphanCerts">
<description>&certmgr.orphans;</description>
<separator class="thin"/>
<tree id="orphan-tree" flex="1" enableColumnDrag="true"
onselect="orphan_enableButtons()">
<treecols>
<treecol id="certcol" label="&certmgr.certname;" primary="true"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
<treecol id="tokencol" label="&certmgr.tokenname;"
persist="hidden width ordinal" flex="1"/>
<!-- <treecol id="certdbkeycol" collapsed="true" flex="1"/> -->
</treecols>
<treechildren ondblclick="viewCerts();"/>
</tree>
<separator class="thin"/>
<hbox>
<button id="orphan_viewButton" class="normal"
label="&certmgr.view.label;"
accesskey="&certmgr.view.accesskey;"
disabled="true" oncommand="viewCerts();"/>
<button id="orphan_deleteButton" class="normal"
label="&certmgr.delete.label;"
accesskey="&certmgr.delete.accesskey;"
disabled="true" oncommand="deleteCerts();"/>
</hbox>
</vbox>
</overlay>

View File

@ -60,6 +60,7 @@ var caTreeView;
var serverTreeView;
var emailTreeView;
var userTreeView;
var orphanTreeView;
function LoadCerts()
{
@ -96,6 +97,12 @@ function LoadCerts()
document.getElementById('user-tree')
.treeBoxObject.view = userTreeView;
orphanTreeView = Components.classes[nsCertTree]
.createInstance(nsICertTree);
orphanTreeView.loadCertsFromCache(certcache, nsIX509Cert.UNKNOWN_CERT);
document.getElementById('orphan-tree')
.treeBoxObject.view = orphanTreeView;
var rowCnt = userTreeView.rowCount;
var enableBackupAllButton=document.getElementById('mine_backupAllButton');
if(rowCnt < 1) {
@ -115,6 +122,7 @@ function getSelectedCerts()
var mine_tab = document.getElementById("mine_tab");
var others_tab = document.getElementById("others_tab");
var websites_tab = document.getElementById("websites_tab");
var orphan_tab = document.getElementById("orphan_tab");
var items = null;
if (ca_tab.selected) {
items = caTreeView.selection;
@ -124,6 +132,8 @@ function getSelectedCerts()
items = emailTreeView.selection;
} else if (websites_tab.selected) {
items = serverTreeView.selection;
} else if (orphan_tab.selected) {
items = orphanTreeView.selection;
}
selected_certs = [];
var cert = null;
@ -145,6 +155,8 @@ function getSelectedCerts()
cert = emailTreeView.getCert(j);
} else if (websites_tab.selected) {
cert = serverTreeView.getCert(j);
} else if (orphan_tab.selected) {
cert = orphanTreeView.getCert(j);
}
if (cert) {
var sc = selected_certs.length;
@ -239,6 +251,19 @@ function email_enableButtons()
enableDeleteButton.setAttribute("disabled",toggle);
}
function orphan_enableButtons()
{
var items = orphanTreeView.selection;
var toggle="false";
if (items.getRangeCount() == 0) {
toggle="true";
}
var enableViewButton=document.getElementById('orphan_viewButton');
enableViewButton.setAttribute("disabled",toggle);
var enableDeleteButton=document.getElementById('orphan_deleteButton');
enableDeleteButton.setAttribute("disabled",toggle);
}
function backupCerts()
{
getSelectedCerts();
@ -345,6 +370,10 @@ function deleteCerts()
{
params.SetString(0, selTabID);
}
else if (selTabID == "orphan_tab")
{
params.SetString(0, selTabID);
}
else
{
return;
@ -384,6 +413,9 @@ function deleteCerts()
} else if (selTabID == "ca_tab") {
treeView = caTreeView;
loadParam = nsIX509Cert.CA_CERT;
} else if (selTabID == "orphan_tab") {
treeView = orphanTreeView;
loadParam = nsIX509Cert.UNKNOWN_CERT;
}
for (t=numcerts-1; t>=0; t--)
@ -442,7 +474,8 @@ function onSmartCardChange()
serverTreeView.selection.clearSelection();
emailTreeView.loadCertsFromCache(certcache, nsIX509Cert.EMAIL_CERT);
emailTreeView.selection.clearSelection();
orphanTreeView.loadCertsFromCache(certcache, nsIX509Cert.UNKNOWN_CERT);
orphanTreeView.selection.clearSelection();
}
function addEmailCert()

View File

@ -43,6 +43,7 @@
<?xul-overlay href="chrome://pippki/content/OthersOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/WebSitesOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/CAOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/OrphanOverlay.xul"?>
<!DOCTYPE dialog SYSTEM "chrome://pippki/locale/certManager.dtd">
@ -66,12 +67,14 @@
<tab id="others_tab" label="&certmgr.tab.others;"/>
<tab id="websites_tab" label="&certmgr.tab.websites;"/>
<tab id="ca_tab" label="&certmgr.tab.ca;" selected="true"/>
<tab id="orphan_tab" label="&certmgr.tab.orphan;"/>
</tabs>
<tabpanels flex="1">
<vbox id="myCerts" flex="1"/>
<vbox id="othersCerts" flex="1"/>
<vbox id="webCerts" flex="1"/>
<vbox id="CACerts" flex="1"/>
<vbox id="OrphanCerts" flex="1"/>
</tabpanels>
</tabbox>

View File

@ -25,6 +25,7 @@ pippki.jar:
content/pippki/WebSitesOverlay.xul (content/WebSitesOverlay.xul)
content/pippki/OthersOverlay.xul (content/OthersOverlay.xul)
content/pippki/MineOverlay.xul (content/MineOverlay.xul)
content/pippki/OrphanOverlay.xul (content/OrphanOverlay.xul)
content/pippki/viewCertDetails.xul (content/viewCertDetails.xul)
content/pippki/editcacert.xul (content/editcacert.xul)
content/pippki/editemailcert.xul (content/editemailcert.xul)