From 392ededc71d9555f243104e7ec821ed6dd1f7af4 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 16 Sep 2015 14:13:31 +0200 Subject: [PATCH] Enigma: Enable encryption features on message print page --- plugins/enigma/enigma.php | 2 +- plugins/enigma/lib/enigma_engine.php | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/plugins/enigma/enigma.php b/plugins/enigma/enigma.php index bda6ed1e4..1f406bb38 100644 --- a/plugins/enigma/enigma.php +++ b/plugins/enigma/enigma.php @@ -50,7 +50,7 @@ class enigma extends rcube_plugin $enabled = $this->rc->config->get('enigma_encryption', true); // message displaying - if ($this->rc->action == 'show' || $this->rc->action == 'preview') { + if ($this->rc->action == 'show' || $this->rc->action == 'preview' || $this->rc->action == 'print') { $this->add_hook('message_load', array($this, 'message_load')); $this->add_hook('template_object_messagebody', array($this, 'message_output')); } diff --git a/plugins/enigma/lib/enigma_engine.php b/plugins/enigma/lib/enigma_engine.php index 249a4b0c3..b95ed1a91 100644 --- a/plugins/enigma/lib/enigma_engine.php +++ b/plugins/enigma/lib/enigma_engine.php @@ -444,14 +444,16 @@ class enigma_engine */ private function parse_plain_signed(&$p, $body) { + if (!$this->rc->config->get('enigma_signatures', true)) { + return; + } + $this->load_pgp_driver(); $part = $p['structure']; // Verify signature - if ($this->rc->action == 'show' || $this->rc->action == 'preview') { - if ($this->rc->config->get('enigma_signatures', true)) { - $sig = $this->pgp_verify($body); - } + if ($this->rc->action == 'show' || $this->rc->action == 'preview' || $this->rc->action == 'print') { + $sig = $this->pgp_verify($body); } // @TODO: Handle big bodies using (temp) files @@ -505,7 +507,7 @@ class enigma_engine return; } - if ($this->rc->action != 'show' && $this->rc->action != 'preview') { + if ($this->rc->action != 'show' && $this->rc->action != 'preview' && $this->rc->action != 'print') { return; } @@ -552,7 +554,7 @@ class enigma_engine } // Verify signature - if ($this->rc->action == 'show' || $this->rc->action == 'preview') { + if ($this->rc->action == 'show' || $this->rc->action == 'preview' || $this->rc->action == 'print') { $this->load_smime_driver(); $struct = $p['structure'];