Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/roundcube/roundcubemail: (24 commits)
  Fix recognizing Sent folder on search if current folder has been changed by plugins in meantime
  CS improvements, _xor() method replaced with an anonymous function
  Fix style of Save button in password form (larry)
  Fix so templating system does not mess with external (e.g. email) content (roundcube#5499)
  Make "Add contact" image/text ignored when copying/selecting recipients in main headers (roundcube#5103)
  Fix redundant keep-alive/refresh after session error on compose page (roundcube#5500)
  Icons alignment fix
  Get rid of "popupmessage" class
  Warn about too many disclosed recipients in composed email [max_disclosed_recipients] (roundcube#5132) Allow to omit a subject when sending an email (roundcube#5068)
  identity_select: Support Received header (roundcube#5085)
  Fix error checking on get_script() result + some CS fixes
  Fix missing contact ID for contacts from non-sql addressbooks
  Remove "@Version @package_version@"
  Removed unused moxieplayer.swf
  CS fixes, use $this instead of local variable
  Plugin API: Added get_compose_responses hook (roundcube#5457)
  Enigma: Support GnuPG 2.1 (roundcube#5313)
  Better handling of rcube_text_editor.replace()'s input argument, some simplification
  GnuPG 2.1: Support password prompt on private key import
  GnuPG 2.1: Support password input on private key export
  ...
  • Loading branch information
ZiBiS committed Nov 8, 2016
2 parents eb20882 + 0e5a167 commit d63c1a1
Show file tree
Hide file tree
Showing 57 changed files with 464 additions and 233 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG Roundcube Webmail
===========================

- Allow to omit a subject when sending an email (#5068)
- Warn about too many disclosed recipients in composed email [max_disclosed_recipients] (#5132)
- identity_select: Support Received header (#5085)
- Plugin API: Added get_compose_responses hook (#5457)
- Display error when trying to upload more files than specified in max_file_uploads (#5483)
- Add missing sql upgrade file for 'ip' column resize in session table (#5465)
- Do not show inline images of unsupported mimetype (#5463)
- Password: Added LDAP PPolicy driver (#5364)
Expand Down Expand Up @@ -33,6 +38,7 @@ CHANGELOG Roundcube Webmail
- Remove PHP mail() support, smtp_server is required now (#5340)
- Display full message subject in onmouseover on truncated subject in mail view (#5346)
- Searching in both contacts and groups when LDAP addressbook with group_filters option is used
- Enigma: Support GnuPG 2.1 (#5313)
- Enigma: Support key generation for multiple identities (#5383)
- Enigma: Import keys from key-server(s) (#5286)
- Enigma: Search missing public keys on a key-server in mail compose (#5286)
Expand All @@ -51,6 +57,8 @@ CHANGELOG Roundcube Webmail
- Managesieve: Unhide advanced rule controls if there are inputs with errors
- Managesieve: Display warning message when filter form contains errors
- Control search engine crawlers via X-Robots-Tag header instead of <meta> and robots.txt (#5098)
- Fix so templating system does not mess with external (e.g. email) content (#5499)
- Fix redundant keep-alive/refresh after session error on compose page (#5500)
- Fix flickering of header topline in min-mode (#5426)
- Fix bug where folders list would scroll to top when clicking on subscription checkbox (#5447)
- Fix decoding of GB2312/GBK text when iconv is not installed (#5448)
Expand Down
5 changes: 2 additions & 3 deletions composer.json-dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"pear-pear.php.net/net_idna2": "~0.1.1",
"pear-pear.php.net/mail_mime": "~1.10.0",
"pear-pear.php.net/net_smtp": "~1.7.1",
"pear-pear.php.net/crypt_gpg": "~1.4.2",
"pear-pear.php.net/crypt_gpg": "~1.6.0@beta",
"roundcube/net_sieve": "~1.5.0"
},
"require-dev": {
Expand All @@ -38,6 +38,5 @@
"suggest": {
"pear-pear.php.net/net_ldap2": "~2.2.0 required for connecting to LDAP address books",
"kolab/Net_LDAP3": "dev-master required for connecting to LDAP address books"
},
"minimum-stability": "dev"
}
}
8 changes: 7 additions & 1 deletion config/defaults.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,15 @@
// Size in bytes (possible unit suffix: K, M, G)
$config['max_message_size'] = '100M';

// Maximum number of recipients per message. Default: 0 (no limit)
// Maximum number of recipients per message (including To, Cc, Bcc).
// Default: 0 (no limit)
$config['max_recipients'] = 0;

// Maximum number of recipients per message exluding Bcc header.
// This is a soft limit, which means we only display a warning to the user.
// Default: 5
$config['max_disclosed_recipients'] = 5;

// Maximum allowed number of members of an address group. Default: 0 (no limit)
// If 'max_recipients' is set this value should be less or equal
$config['max_group_members'] = 0;
Expand Down
3 changes: 0 additions & 3 deletions plugins/acl/acl.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/**
* ACL plugin script
*
* @version @package_version@
* @author Aleksander Machniak <[email protected]>
*/

if (window.rcmail) {
Expand Down
1 change: 0 additions & 1 deletion plugins/acl/acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Folders Access Control Lists Management (RFC4314, RFC2086)
*
* @version @package_version@
* @author Aleksander Machniak <[email protected]>
*
* Copyright (C) 2011-2012, Kolab Systems AG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Enable the plugin in config.inc.php and add your desired headers:
* $config['additional_message_headers'] = array('User-Agent' => 'My-Very-Own-Webmail');
*
* @version @package_version@
* @author Ziba Scott
* @website http://roundcube.net
*/
Expand Down
1 change: 0 additions & 1 deletion plugins/attachment_reminder/attachment_reminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*
* A plugin that reminds a user to attach the files
*
* @version @package_version@
* @author Thomas Yu - Sian, Liu
* @author Aleksander Machniak <[email protected]>
*
Expand Down
1 change: 0 additions & 1 deletion plugins/database_attachments/database_attachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*
* @author Ziba Scott <[email protected]>
* @author Aleksander Machniak <[email protected]>
* @version @package_version@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
Expand Down
1 change: 0 additions & 1 deletion plugins/debug_logger/debug_logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* Enable the plugin in config.inc.php and add your desired
* log types and files.
*
* @version @package_version@
* @author Ziba Scott
* @website http://roundcube.net
*
Expand Down
1 change: 0 additions & 1 deletion plugins/emoticons/emoticons.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Plugin to replace emoticons in plain text message body with real icons.
* Also it enables emoticons in HTML compose editor. Both features are optional.
*
* @version @package_version@
* @license GNU GPLv3+
* @author Thomas Bruederli
* @author Aleksander Machniak
Expand Down
4 changes: 4 additions & 0 deletions plugins/enigma/config.inc.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
76 changes: 53 additions & 23 deletions plugins/enigma/enigma.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand All @@ -191,28 +192,48 @@ 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();
}
},
{
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 = $('<form>').attr({target: id, method: 'post', style: 'display:none',
action: '?_action=plugin.enigmakeys&_task=settings&_a=export'}),
iframe = $('<iframe>').attr({name: id, style: 'display:none'})

form.append($('<input>').attr({name: '_token', value: this.env.request_token}));
$.each(data, function(i, v) {
form.append($('<input>').attr({name: i, value: v}));
});

iframe.appendTo(document.body);
form.appendTo(document.body).submit();
};

// Submit key(s) import form
rcube_webmail.prototype.enigma_import = function()
{
var form, file;
var form, file, lock,
id = 'keyexport-' + new Date().getTime(),
iframe = $('<iframe>').attr({name: id, style: 'display:none'});

if (form = this.gui_objects.importform) {
file = document.getElementById('rcmimportfile');
Expand All @@ -221,13 +242,11 @@ rcube_webmail.prototype.enigma_import = function()
return;
}

var lock = this.set_busy(true, 'importwait');

form.action = this.add_url(form.action, '_unlock', lock);
form.submit();

this.lock_form(form, true);
}
lock = this.set_busy(true, 'importwait');
iframe.appendTo(document.body);
$(form).attr({target: id, action: this.add_url(form.action, '_unlock', lock)})
.submit();
}
};

// Ssearch for key(s) for import
Expand Down Expand Up @@ -516,27 +535,38 @@ rcube_webmail.prototype.enigma_password_request = function(data)
// submit entered password
rcube_webmail.prototype.enigma_password_submit = function(data)
{
var lock, form;

if (this.env.action == 'compose' && !data['compose-init']) {
return this.enigma_password_compose_submit(data);
}
else if (this.env.action == 'plugin.enigmakeys' && (form = this.gui_objects.importform)) {
if (!$('input[name="_keyid"]', form).length) {
$(form).append($('<input>').attr({type: 'hidden', name: '_keyid', value: data.key}))
.append($('<input>').attr({type: 'hidden', name: '_passwd', value: data.password}))
}

var lock = this.set_busy(true, 'loading'),
form = $('<form>').attr({method: 'post', action: data.action || location.href, style: 'display:none'})
return this.enigma_import();
}

lock = data.nolock ? null : this.set_busy(true, 'loading');
form = $('<form>')
.attr({method: 'post', action: data.action || location.href, style: 'display:none'})
.append($('<input>').attr({type: 'hidden', name: '_keyid', value: data.key}))
.append($('<input>').attr({type: 'hidden', name: '_passwd', value: data.password}))
.append($('<input>').attr({type: 'hidden', name: '_token', value: this.env.request_token}))
.append($('<input>').attr({type: 'hidden', name: '_unlock', value: lock}));

// Additional form fields for request parameters
$.each(data, function(i, v) {
if (i.indexOf('input') == 0)
form.append($('<input>').attr({type: 'hidden', name: i.substring(5), value: v}))
if (i.indexOf('input') == 0)
form.append($('<input>').attr({type: 'hidden', name: i.substring(5), value: v}))
});

if (data.iframe) {
var name = 'enigma_frame_' + (new Date()).getTime(),
frame = $('<iframe>').attr({style: 'display:none', name: name}).appendTo(document.body);
form.attr('target', name);
var name = 'enigma_frame_' + (new Date()).getTime(),
frame = $('<iframe>').attr({style: 'display:none', name: name}).appendTo(document.body);
form.attr('target', name);
}

form.appendTo(document.body).submit();
Expand Down Expand Up @@ -572,7 +602,7 @@ rcube_webmail.prototype.enigma_key_not_found = function(data)
rcmail.enigma_find_publickey(data.email);
}
}],
{width: 400, dialogClass: 'popupmessage error'}
{width: 400, dialogClass: 'error'}
);
};

Expand Down
2 changes: 2 additions & 0 deletions plugins/enigma/enigma.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ function init()
if (empty($_REQUEST['_framed']) || strpos($this->rc->action, 'plugin.enigma') === 0) {
$this->ui->add_css();
}

$this->password_handler();
}
else if ($this->rc->task == 'cli') {
$this->add_hook('user_delete_commit', array($this, 'user_delete'));
Expand Down
10 changes: 6 additions & 4 deletions plugins/enigma/lib/enigma_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,24 @@ abstract function verify($text, $signature);
/**
* Key/Cert file import.
*
* @param string File name or file content
* @param bollean True if first argument is a filename
* @param string File name or file content
* @param bolean True if first argument is a filename
* @param array Optional key => password map
*
* @return mixed Import status array or enigma_error
*/
abstract function import($content, $isfile = false);
abstract function import($content, $isfile = false, $passwords = array());

/**
* Key/Cert export.
*
* @param string Key ID
* @param bool Include private key
* @param array Optional key => password map
*
* @return mixed Key content or enigma_error
*/
abstract function export($key, $with_private = false);
abstract function export($key, $with_private = false, $passwords = array());

/**
* Keys listing.
Expand Down
Loading

0 comments on commit d63c1a1

Please sign in to comment.