W.I.P of SMIME support for mail application:

- Add smime digital signature icon
- Add handler for smime certificate to be able to see the attached certificate
This commit is contained in:
Hadi Nategh 2017-01-23 09:47:45 +01:00
parent 6a815b53b3
commit 29aa1048fe
5 changed files with 16 additions and 12 deletions

View File

@ -2124,14 +2124,6 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
return $data; return $data;
} }
function getSmimeCert ()
{
if (isset($_GET['id'])) $id = $_GET['id'];
if (isset($_GET['partID'])) $partID = $_GET['partid'];
$cert = $this->resolveSmimeAttachment($attachments, $id, $partID, $mailbox);
echo ($cert);
}
/** /**
* Build actions for display toolbar * Build actions for display toolbar
*/ */

View File

@ -940,6 +940,8 @@ app.classes.mail = AppJS.extend(
// Not applied to mobile preview // Not applied to mobile preview
if (!egwIsMobile()) if (!egwIsMobile())
{ {
var smimeSigBtn = this.et2.getWidgetById('previewSmimeSigBtn');
if (smimeSigBtn) smimeSigBtn.set_disabled(dataElem.data['smimeSigUrl']?false:true);
// Widget ID:data key map of widgets we can directly set from cached data // Widget ID:data key map of widgets we can directly set from cached data
var data_widgets = { var data_widgets = {
@ -5508,14 +5510,23 @@ app.classes.mail = AppJS.extend(
/** /**
* Open smime certificate * Open smime certificate
* *
* @param {type} egw * @param {type} egw
* @param {type} widget * @param {type} widget
* @returns {undefined} * @returns {undefined}
*/ */
smimeSigBtn: function (egw, widget) smimeSigBtn: function (egw, widget)
{ {
var url = this.et2.getArrayMgr("content").getEntry('smimeSigUrl'); var url = '';
if (this.mail_isMainWindow)
{
var content = this.egw.dataGetUIDdata(this.mail_currentlyFocussed);
url = content.data.smimeSigUrl;
}
else
{
url = this.et2.getArrayMgr("content").getEntry('smimeSigUrl');
}
window.egw.openPopup(url,'700','400'); window.egw.openPopup(url,'700','400');
} }
}); });

View File

@ -17,7 +17,7 @@
<hbox class="mailDisplayHeaders" align="right" width="30%"> <hbox class="mailDisplayHeaders" align="right" width="30%">
<description value="Date"/> <description value="Date"/>
<date-time id="mail_displaydate" readonly="true"/> <date-time id="mail_displaydate" readonly="true"/>
<buttononly id="smimeSigBtn" image="smimeSignature" onclick="app.mail.smimeSigBtn"/> <buttononly id="smimeSigBtn" image="smimeSignature" statustext="This message is signed" onclick="app.mail.smimeSigBtn" disabled="!@smimeSigUrl"/>
</hbox> </hbox>
</hbox> </hbox>

View File

@ -17,6 +17,7 @@
<hbox id="mailPreviewHeadersDate" class="mailPreviewHeaders"> <hbox id="mailPreviewHeadersDate" class="mailPreviewHeaders">
<description value="Date"/> <description value="Date"/>
<date-time align="left" id="previewDate" readonly="true"/> <date-time align="left" id="previewDate" readonly="true"/>
<button id="previewSmimeSigBtn" image="smimeSignature" statustext="This message is signed" onclick="app.mail.smimeSigBtn"/>
</hbox> </hbox>
<hbox width="100%" id="mailPreviewHeadersTo" class="mailPreviewHeaders"> <hbox width="100%" id="mailPreviewHeadersTo" class="mailPreviewHeaders">
<description value="To"/> <description value="To"/>
@ -113,7 +114,7 @@
<url-email id="${row}[fromaddress]" contact_plus = "true" readonly="true"/> <url-email id="${row}[fromaddress]" contact_plus = "true" readonly="true"/>
<vfs-size align="right" id="${row}[size]" no_lang="1" readonly="true"/> <vfs-size align="right" id="${row}[size]" no_lang="1" readonly="true"/>
<vbox> <vbox>
<buttononly id="smimeSigBtn" image="smimeSignature" disabled="!@$row_cont[smimeSigUrl]"/> <buttononly id="${row}[smimeSigBtn]" image="smimeSignature" disabled="!@$row_cont[smimeSigUrl]"/>
</vbox> </vbox>
</row> </row>
</rows> </rows>

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B