From 29aa1048fe66f2ab6ca379e1356448964d6f929b Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 23 Jan 2017 09:47:45 +0100 Subject: [PATCH] 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 --- mail/inc/class.mail_ui.inc.php | 8 -------- mail/js/app.js | 15 +++++++++++++-- mail/templates/default/display.xet | 2 +- mail/templates/default/index.xet | 3 ++- .../templates/pixelegg/images/smimeSignature.png | Bin 0 -> 602 bytes 5 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 mail/templates/pixelegg/images/smimeSignature.png diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 23339ff9cf..f387dcee0a 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -2124,14 +2124,6 @@ $filter['before']= date("d-M-Y", $cutoffdate2); 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 */ diff --git a/mail/js/app.js b/mail/js/app.js index b0f75ae9a6..c4812b1497 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -940,6 +940,8 @@ app.classes.mail = AppJS.extend( // Not applied to mobile preview 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 var data_widgets = { @@ -5508,14 +5510,23 @@ app.classes.mail = AppJS.extend( /** * Open smime certificate - * + * * @param {type} egw * @param {type} widget * @returns {undefined} */ 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'); } }); diff --git a/mail/templates/default/display.xet b/mail/templates/default/display.xet index 3f6b133d68..a1291f92b4 100644 --- a/mail/templates/default/display.xet +++ b/mail/templates/default/display.xet @@ -17,7 +17,7 @@ - + diff --git a/mail/templates/default/index.xet b/mail/templates/default/index.xet index 9d498ced4a..854caae656 100644 --- a/mail/templates/default/index.xet +++ b/mail/templates/default/index.xet @@ -17,6 +17,7 @@ +