~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to mailnews/extensions/enigmail/ui/content/enigmailEditKeyTrustDlg.xul

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<!--
 
3
 * ***** BEGIN LICENSE BLOCK *****
 
4
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
5
 *
 
6
 * The contents of this file are subject to the Mozilla Public
 
7
 * License Version 1.1 (the "MPL"); you may not use this file
 
8
 * except in compliance with the MPL. You may obtain a copy of
 
9
 * the MPL at http://www.mozilla.org/MPL/
 
10
 *
 
11
 * Software distributed under the MPL is distributed on an "AS
 
12
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
13
 * implied. See the MPL for the specific language governing
 
14
 * rights and limitations under the MPL.
 
15
 *
 
16
 * The Original Code is Enigmail.
 
17
 *
 
18
 * The Initial Developer of the Original Code is Patrick Brunschwig.
 
19
 * Portions created by Patrick Brunschwig <patrick@mozilla-enigmail.org> are
 
20
 * Copyright (C) 2004 Patrick Brunschwig. All Rights Reserved.
 
21
 *
 
22
 * Contributor(s):
 
23
 *
 
24
 * Alternatively, the contents of this file may be used under the terms of
 
25
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
26
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
27
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
28
 * of those above. If you wish to allow use of your version of this file only
 
29
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
30
 * use your version of this file under the terms of the MPL, indicate your
 
31
 * decision by deleting the provisions above and replace them with the notice
 
32
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
33
 * the provisions above, a recipient may use your version of this file under
 
34
 * the terms of any one of the MPL, the GPL or the LGPL.
 
35
 * ***** END LICENSE BLOCK ***** *
 
36
-->
 
37
 
 
38
 
 
39
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
 
40
<?xml-stylesheet href="chrome://enigmail/skin/enigmail.css" type="text/css"?>
 
41
 
 
42
<!DOCTYPE window [
 
43
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
 
44
%brandDTD;
 
45
<!ENTITY % enigMailDTD SYSTEM "chrome://enigmail/locale/enigmail.dtd" >
 
46
%enigMailDTD;
 
47
]>
 
48
 
 
49
<dialog id="enigmailEditKeyTrustDlg"
 
50
        title="&enigmail.keyTrust.title;"
 
51
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
 
52
        onload="onLoad();"
 
53
        ondialogaccept="return onAccept();"
 
54
        >
 
55
 
 
56
 
 
57
  <script type="application/x-javascript">
 
58
  <![CDATA[
 
59
 
 
60
    Components.utils.import("resource://enigmail/enigmailCommon.jsm");
 
61
    Components.utils.import("resource://enigmail/keyManagement.jsm");
 
62
    const Ec = EnigmailCommon;
 
63
 
 
64
    function onLoad() {
 
65
      // set current key trust if only one key is changed
 
66
      var enigmailSvc = Ec.getService(window);
 
67
      if (!enigmailSvc)
 
68
        return;
 
69
 
 
70
      var errorMsgObj = new Object();
 
71
      var exitCodeObj = new Object();
 
72
      try {
 
73
        window.arguments[1].refresh = false;
 
74
        var currTrust = -1;
 
75
        var lastTrust = -1;
 
76
        var sigListStr = enigmailSvc.getKeySig("0x"+window.arguments[0].keyId.join(" 0x"), exitCodeObj, errorMsgObj);
 
77
        if (exitCodeObj.value == 0) {
 
78
          var sigList = sigListStr.split(/[\n\r]+/);
 
79
          for (var i=0; i < sigList.length; i++) {
 
80
            var aLine=sigList[i].split(/:/);
 
81
            if (aLine[0] == "pub") {
 
82
              currTrust=(("-nmfuq").indexOf(aLine[8]) % 5)+1;
 
83
              if (lastTrust==-1) lastTrust=currTrust;
 
84
              if (currTrust != lastTrust) {
 
85
                currTrust = -1;
 
86
                break;
 
87
              }
 
88
            }
 
89
          }
 
90
          if (currTrust > 0) {
 
91
            var t=document.getElementById("trustLevel"+currTrust.toString());
 
92
            document.getElementById("trustLevelGroup").selectedItem=t;
 
93
          }
 
94
        }
 
95
      } catch (ex) {}
 
96
 
 
97
      var keyIdList = document.getElementById("keyIdList");
 
98
      for (i=0; i<window.arguments[0].userId.length; i++) {
 
99
        var keyId = window.arguments[0].userId[i]+" - 0x"+ window.arguments[0].keyId[i].substr(-8,8);
 
100
        keyIdList.appendItem(keyId);
 
101
      }
 
102
    }
 
103
 
 
104
    function processNextKey(index) {
 
105
      Ec.DEBUG_LOG("enigmailEditKeyTrust: processNextKey("+index+")\n");
 
106
 
 
107
      var t=document.getElementById("trustLevelGroup");
 
108
      EnigmailKeyMgmt.setKeyTrust(window,
 
109
        window.arguments[0].keyId[index],
 
110
        Number(t.selectedItem.value),
 
111
        function(exitCode, errorMsg) {
 
112
          if (exitCode != 0) {
 
113
            Ec.alert(window, Ec.getString("setKeyTrustFailed")+"\n\n"+errorMsg);
 
114
            window.close();
 
115
            return;
 
116
          }
 
117
          else {
 
118
            window.arguments[1].refresh = true;
 
119
          }
 
120
 
 
121
          ++index;
 
122
          if (index == window.arguments[0].keyId.length)
 
123
            window.close();
 
124
          else {
 
125
            processNextKey(index);
 
126
          }
 
127
        });
 
128
    }
 
129
 
 
130
    function onAccept() {
 
131
      processNextKey(0);
 
132
 
 
133
      return false;
 
134
    }
 
135
  ]]>
 
136
  </script>
 
137
 
 
138
  <vbox orient="vertical">
 
139
    <hbox>
 
140
      <label value="&enigmail.keyTrust.trustKey.label;" control="keyIdList"/>
 
141
      <listbox flex="1" id="keyIdList" style="height:60px"/>
 
142
    </hbox>
 
143
    <separator/>
 
144
    <vbox>
 
145
      <groupbox>
 
146
        <caption label="&enigmail.keyTrust.trustLevel.label;"/>
 
147
          <radiogroup id="trustLevelGroup">
 
148
            <radio value="1" id="trustLevel1"
 
149
                   label="&enigmail.keyTrust.dontKnow.label;"/>
 
150
            <radio value="2" id="trustLevel2"
 
151
                   label="&enigmail.keyTrust.noTrust.label;"/>
 
152
            <radio value="3" id="trustLevel3"
 
153
                   label="&enigmail.keyTrust.marginalTrust.label;"/>
 
154
            <radio value="4" id="trustLevel4"
 
155
                   label="&enigmail.keyTrust.fullTrust.label;"/>
 
156
            <radio value="5" id="trustLevel5"
 
157
                   label="&enigmail.keyTrust.ultimateTrust.label;"/>
 
158
          </radiogroup>
 
159
       </groupbox>
 
160
    </vbox>
 
161
  </vbox>
 
162
</dialog>
 
163