diff --git a/plugins/enigma/config.inc.php.dist b/plugins/enigma/config.inc.php.dist index 581ac8534..aa4280f41 100644 --- a/plugins/enigma/config.inc.php.dist +++ b/plugins/enigma/config.inc.php.dist @@ -24,6 +24,10 @@ $config['enigma_pgp_binary'] = ''; // It's used with GnuPG 2.x. $config['enigma_pgp_agent'] = ''; +// Location of gpgconf binary. By default it will be auto-detected. +// It's used with GnuPG >= 2.1. +$config['enigma_pgp_gpgconf'] = ''; + // Enables signatures verification feature. $config['enigma_signatures'] = true; diff --git a/plugins/enigma/enigma.js b/plugins/enigma/enigma.js index 029453963..033185b32 100644 --- a/plugins/enigma/enigma.js +++ b/plugins/enigma/enigma.js @@ -99,7 +99,7 @@ rcube_webmail.prototype.enigma_key_create_save = function() size = $('#key-size').val(); $('[name="identity[]"]:checked').each(function() { - users.push(this.value); + users.push(this.value); }); // validate the form @@ -124,7 +124,8 @@ rcube_webmail.prototype.enigma_key_create_save = function() openpgp.generateKeyPair(options).then(function(keypair) { // success - var post = {_a: 'import', _keys: keypair.privateKeyArmored, _generated: 1}; + var post = {_a: 'import', _keys: keypair.privateKeyArmored, _generated: 1, + _passwd: password, _keyid: keypair.key.primaryKey.fingerprint}; // send request to server rcmail.http_post('plugin.enigmakeys', post, lock); @@ -166,12 +167,12 @@ rcube_webmail.prototype.enigma_export = function(selected) var priv = false, list = this.keys_list, keys = selected ? list.get_selection().join(',') : '*', - args = {_a: 'export', _keys: keys}; + args = {_keys: keys}; if (!keys.length) return; - // find out wether selected keys are private + // find out whether selected keys are private if (keys == '*') priv = true; else @@ -191,7 +192,7 @@ rcube_webmail.prototype.enigma_export = function(selected) [{ text: this.get_label('enigma.onlypubkeys'), click: function(e) { - rcmail.goto_url('plugin.enigmakeys', args, false, true); + rcmail.enigma_export_submit(args); $(this).remove(); } }, @@ -199,20 +200,40 @@ rcube_webmail.prototype.enigma_export = function(selected) text: this.get_label('enigma.withprivkeys'), click: function(e) { args._priv = 1; - rcmail.goto_url('plugin.enigmakeys', args, false, true); + rcmail.enigma_export_submit(args); $(this).remove(); } }], {width: 400} ); - this.goto_url('plugin.enigmakeys', args, false, true); + this.enigma_export_submit(args); +}; + +// Sumbitting request for key(s) export +// Done this way to handle password input +rcube_webmail.prototype.enigma_export_submit = function(data) +{ + var id = 'keyexport-' + new Date().getTime(), + form = $('
').attr({target: id, method: 'post', style: 'display:none', + action: '?_action=plugin.enigmakeys&_task=settings&_a=export'}), + iframe = $('