From bd0551b22076b82a6d49e9f7a2b2e0c90a1b2326 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 05 Feb 2016 07:25:27 -0500
Subject: [PATCH] Secure also downloads of addressbook exports, managesieve script exports and Enigma keys exports

---
 plugins/enigma/enigma.js |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/plugins/enigma/enigma.js b/plugins/enigma/enigma.js
index aca4ec0..a5497f4 100644
--- a/plugins/enigma/enigma.js
+++ b/plugins/enigma/enigma.js
@@ -48,6 +48,11 @@
             });
         }
 
+        $.each(['encrypt', 'sign'], function() {
+            if (rcmail.env['enigma_force_' + this])
+                $('[name="_enigma_' + this + '"]').prop('checked', true);
+        });
+
         if (rcmail.env.enigma_password_request) {
             rcmail.enigma_password_request(rcmail.env.enigma_password_request);
         }
@@ -106,7 +111,7 @@
 
             // send request to server
             rcmail.http_post('plugin.enigmakeys', post, lock);
-        }).catch(function(error) {
+        }, function(error) {
             // failure
             rcmail.set_busy(false, null, lock);
             rcmail.display_message(rcmail.get_label('enigma.keygenerateerror'), 'error');
@@ -152,7 +157,7 @@
     if (!keys.length)
         return;
 
-    this.goto_url('plugin.enigmakeys', {_a: 'export', _keys: keys});
+    this.goto_url('plugin.enigmakeys', {_a: 'export', _keys: keys}, false, true);
 };
 
 // Submit key(s) import form

--
Gitblit v1.9.1