Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master:
  Fix bug where it wasn't possible to store more that 2MB objects in memcache/apc (roundcube#5452) Added memcache_max_allowed_packet and apc_max_allowed_packet settings
  assword: Added possibility to nicely handle password epiration from other plugins (roundcube#5468)
  Fix bug where IMAP password could be exposed via error message (roundcube#5472)
  Fix bug where deleting folders with subfolders could fail in some cases (roundcube#5466)
  Support HTML input to rcube_text_editor.replace() (roundcube#5456)
  Set smtp options in sample config as they are required now
  Optimize image size
  Bump database version
  Better icon and CSS styles for PGP-related attachments (roundcube#5301 and roundcube#5279)
  Add icons for pgp-keys and php-encrypted attachments (roundcube#5301 and roundcube#5279)
  Update changelog
  Fix flickering of header topline in min-mode (roundcube#5426)
  Do not show inline images of unsupported mimetype (roundcube#5463)
  SQL, upgrade: increase session table ip field size for IPv6 addresses
  • Loading branch information
ZiBiS committed Oct 17, 2016
2 parents 5dee181 + 4e05328 commit 548c13f
Show file tree
Hide file tree
Showing 40 changed files with 248 additions and 187 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
CHANGELOG Roundcube Webmail
===========================

- 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)
- Password: Added possibility to nicely redirect from other plugins on password expiration (#5468)
- Implement separate action to mark all messages in a folder as \Seen (#5006)
- Implement marking as \Seen in all folders or in a folder and its subfolders (#5076)
- Archive: Don't reload messages list when it's not needed (#5225)
Expand Down Expand Up @@ -48,11 +51,16 @@ 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 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)
- Fix regression where creation of default folders wasn't functioning without prefix (#5460)
- Enigma: Fix bug where last records on keys list were hidden (#5461)
- Enigma: Fix key search with keyword containing non-ascii characters (#5459)
- Fix bug where deleting folders with subfolders could fail in some cases (#5466)
- Fix bug where IMAP password could be exposed via error message (#5472)
- Fix bug where it wasn't possible to store more that 2MB objects in memcache/apc,
Added memcache_max_allowed_packet and apc_max_allowed_packet settings (#5452)

RELEASE 1.2.2
-------------
Expand Down
2 changes: 1 addition & 1 deletion SQL/mssql.initial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,6 @@ CREATE TRIGGER [contact_delete_member] ON [dbo].[contacts]
WHERE [contact_id] IN (SELECT [contact_id] FROM deleted)
GO

INSERT INTO [dbo].[system] ([name], [value]) VALUES ('roundcube-version', '2016081200')
INSERT INTO [dbo].[system] ([name], [value]) VALUES ('roundcube-version', '2016100900')
GO

2 changes: 2 additions & 0 deletions SQL/mssql/2016100900.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE [dbo].[session] ALTER COLUMN [ip] [varchar] (40) COLLATE Latin1_General_CI_AI NOT NULL
GO
2 changes: 1 addition & 1 deletion SQL/mysql.initial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@ CREATE TABLE `system` (

/*!40014 SET FOREIGN_KEY_CHECKS=1 */;

INSERT INTO system (name, value) VALUES ('roundcube-version', '2016081200');
INSERT INTO system (name, value) VALUES ('roundcube-version', '2016100900');
1 change: 1 addition & 0 deletions SQL/mysql/2016100900.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `session` MODIFY `ip` varchar(40) NOT NULL;
2 changes: 1 addition & 1 deletion SQL/oracle.initial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@ CREATE TABLE "system" (
"value" long
);

INSERT INTO "system" ("name", "value") VALUES ('roundcube-version', '2016081200');
INSERT INTO "system" ("name", "value") VALUES ('roundcube-version', '2016100900');
1 change: 1 addition & 0 deletions SQL/oracle/2016100900.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE session MODIFY ip varchar(41) NOT NULL;
2 changes: 1 addition & 1 deletion SQL/postgres.initial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,4 @@ CREATE TABLE "system" (
value text
);

INSERT INTO system (name, value) VALUES ('roundcube-version', '2016081200');
INSERT INTO system (name, value) VALUES ('roundcube-version', '2016100900');
1 change: 1 addition & 0 deletions SQL/postgres/2016100900.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE session ALTER COLUMN ip TYPE character varying(41);
2 changes: 1 addition & 1 deletion SQL/sqlite.initial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,4 @@ CREATE TABLE system (
value text NOT NULL
);

INSERT INTO system (name, value) VALUES ('roundcube-version', '2016081200');
INSERT INTO system (name, value) VALUES ('roundcube-version', '2016100900');
Empty file added SQL/sqlite/2016100900.sql
Empty file.
7 changes: 3 additions & 4 deletions config/config.inc.php.sample
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,26 @@ $config['default_host'] = 'localhost';

// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['smtp_server'] = '';
$config['smtp_server'] = 'localhost';

// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$config['smtp_port'] = 25;

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '';
$config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '';
$config['smtp_pass'] = '%p';

// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
Expand Down
58 changes: 34 additions & 24 deletions config/defaults.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,40 @@
$config['ldap_cache_ttl'] = '10m';


// ----------------------------------
// CACHE(S)
// ----------------------------------

// Use these hosts for accessing memcached
// Define any number of hosts in the form of hostname:port or unix:///path/to/socket.file
$config['memcache_hosts'] = null; // e.g. array( 'localhost:11211', '192.168.1.12:11211', 'unix:///var/tmp/memcached.sock' );

// Controls the use of a persistent connections to memcache servers
// See http://php.net/manual/en/memcache.addserver.php
$config['memcache_pconnect'] = true;

// Value in seconds which will be used for connecting to the daemon
// See http://php.net/manual/en/memcache.addserver.php
$config['memcache_timeout'] = 1;

// Controls how often a failed server will be retried (value in seconds).
// Setting this parameter to -1 disables automatic retry.
// See http://php.net/manual/en/memcache.addserver.php
$config['memcache_retry_interval'] = 15;

// use these hosts for accessing Redis.
// Currently only one host is supported. cluster support may come in a future release.
// You can pass 4 fields, host, port, database and password.
// Unset fields will be set to the default values host=127.0.0.1, port=6379, database=0, password= (empty)
$config['redis_hosts'] = null; // e.g. array( 'localhost:6379' ); array( '192.168.1.1:6379:1:secret' );

// Maximum size of an object in memcache (in bytes). Default: 2MB
$config['memcache_max_allowed_packet'] = '2M';

// Maximum size of an object in APC cache (in bytes). Default: 2MB
$config['apc_max_allowed_packet'] = '2M';


// ----------------------------------
// SYSTEM
// ----------------------------------
Expand Down Expand Up @@ -423,30 +457,6 @@
// Setting this value to 'php' will use the default session save handler configured in PHP
$config['session_storage'] = 'db';

// Use these hosts for accessing memcached
// Define any number of hosts in the form of hostname:port or unix:///path/to/socket.file
$config['memcache_hosts'] = null; // e.g. array( 'localhost:11211', '192.168.1.12:11211', 'unix:///var/tmp/memcached.sock' );

// Controls the use of a persistent connections to memcache servers
// See http://php.net/manual/en/memcache.addserver.php
$config['memcache_pconnect'] = true;

// Value in seconds which will be used for connecting to the daemon
// See http://php.net/manual/en/memcache.addserver.php
$config['memcache_timeout'] = 1;

// Controls how often a failed server will be retried (value in seconds).
// Setting this parameter to -1 disables automatic retry.
// See http://php.net/manual/en/memcache.addserver.php
$config['memcache_retry_interval'] = 15;

// use this for accessing redis
// currently only one host is supported. cluster support may come in a future release.
// you can pass 4 fields, host, port, database and password.
// unset fields will be set to the default values host=127.0.0.1, port=6379, database=0, password= (empty)

$config['redis_hosts'] = null; // e.g. array( 'localhost:6379' ); array( '192.168.1.1:6379:1:secret' );

// check client IP in session authorization
$config['ip_check'] = false;

Expand Down
4 changes: 4 additions & 0 deletions plugins/database_attachments/config.inc.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// By default this plugin stores attachments in filesystem
// and copies them into sql database.
// You can change it to use 'memcache' or 'apc'.
// -----------------------------------------------------------
// WARNING: Remember to set max_allowed_packet in database or
// config to match with expected max attachment size.
// -----------------------------------------------------------
$config['database_attachments_cache'] = 'db';

// Attachment data expires after specied TTL time in seconds (max.2592000).
Expand Down
2 changes: 1 addition & 1 deletion plugins/enigma/lib/enigma_ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ private function key_import()
else if ($err = $_FILES['_file']['error']) {
if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) {
$this->rc->output->show_message('filesizeerror', 'error',
array('size' => $this->rc->show_bytes(parse_bytes(ini_get('upload_max_filesize')))));
array('size' => $this->rc->show_bytes(rcube_utils::max_upload_size())));
} else {
$this->rc->output->show_message('fileuploaderror', 'error');
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ function save()
if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) {
$msg = $this->rc->gettext(array('name' => 'filesizeerror',
'vars' => array('size' =>
$this->rc->show_bytes(parse_bytes(ini_get('upload_max_filesize'))))));
$this->rc->show_bytes(rcube_utils::max_upload_size()))));
}
else {
$this->errors['file'] = $this->plugin->gettext('fileuploaderror');
Expand Down
2 changes: 1 addition & 1 deletion plugins/password/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "roundcube-plugin",
"description": "Password Change for Roundcube. Plugin adds a possibility to change user password using many methods (drivers) via Settings/Password tab.",
"license": "GPLv3+",
"version": "4.1",
"version": "4.2",
"authors": [
{
"name": "Aleksander Machniak",
Expand Down
8 changes: 4 additions & 4 deletions plugins/password/localization/en_GB.inc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ $messages['passwordweak'] = 'Password must include at least one number and one s
$messages['passwordforbidden'] = 'Password contains forbidden characters.';
$messages['firstloginchange'] = 'This is your first login. Please change your password.';
$messages['disablednotice'] = 'The system is currently under maintenance and password change is not possible at the moment. Everything should be back to normal soon. We apologise for any inconvenience.';
$messages['passwdinhistory'] = 'This password has already been used previously';
$messages['samepasswd'] = 'New password have to be different from the old one';
$messages['passwdexpirewarning'] = 'Warning! Your password will expire soon, change it before $expirationdatetime';
$messages['passwdexpired'] = 'Your password has expired, you have to change it now !';
$messages['passwdinhistory'] = 'This password has already been used previously.';
$messages['samepasswd'] = 'New password have to be different from the old one.';
$messages['passwdexpirewarning'] = 'Warning! Your password will expire soon, change it before $expirationdatetime.';
$messages['passwdexpired'] = 'Your password has expired, you have to change it now!';

8 changes: 4 additions & 4 deletions plugins/password/localization/en_US.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ $messages['passwordweak'] = 'Password must include at least one number and one p
$messages['passwordforbidden'] = 'Password contains forbidden characters.';
$messages['firstloginchange'] = 'This is your first login. Please change your password.';
$messages['disablednotice'] = 'The system is currently under maintenance and password change is not possible at the moment. Everything should be back to normal soon. We apologize for any inconvenience.';
$messages['passwinhistory'] = 'This password has already been used previously';
$messages['samepasswd'] = 'New password have to be different from the old one';
$messages['passwdexpirewarning'] = 'Warning! Your password will expire soon, change it before $expirationdatetime';
$messages['passwdexpired'] = 'Your password has expired, you have to change it now !';
$messages['passwinhistory'] = 'This password has already been used previously.';
$messages['samepasswd'] = 'New password have to be different from the old one.';
$messages['passwdexpirewarning'] = 'Warning! Your password will expire soon, change it before $expirationdatetime.';
$messages['passwdexpired'] = 'Your password has expired, you have to change it now!';

4 changes: 2 additions & 2 deletions plugins/password/localization/pl_PL.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ $messages['firstloginchange'] = 'To jest twoje pierwsze logowanie. Proszę zmie
$messages['disablednotice'] = 'System jest w trakcie konserwacji i zmiana hasła w tym momencie nie jest możliwa. Wszystko powinno wrócić do normy w niedługim czasie. Przepraszamy za wszelkie niedogodności';
$messages['passwdinhistory'] = 'To hasło było już użyte poprzednio.';
$messages['samepasswd'] = 'Nowe hasło musi być inne niż obecne.';
$messages['passwdexpirewarning'] = 'UWAGA! Twoje hasło niebawem wygaśnie, zmień je przed $expirationdatetime';
$messages['passwdexpired'] = 'Twoje hasło wygasło, musisz je natychmiast zmienić !';
$messages['passwdexpirewarning'] = 'UWAGA! Twoje hasło niebawem wygaśnie, zmień je przed $expirationdatetime.';
$messages['passwdexpired'] = 'Twoje hasło wygasło, musisz je natychmiast zmienić!';
20 changes: 11 additions & 9 deletions plugins/password/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,18 @@ function password_init()
if (rcube_utils::get_input_value('_first', rcube_utils::INPUT_GET)) {
$rcmail->output->command('display_message', $this->gettext('firstloginchange'), 'notice');
}

if (isset ($_SESSION['passwdexpdatetime'])) {
if ($_SESSION['passwdexpdatetime'] == 1){
else if (!empty($_SESSION['password_expires'])) {
if ($_SESSION['password_expires'] == 1) {
$rcmail->output->command('display_message', $this->gettext('passwdexpired'), 'error');
}
else {
$rcmail->output->command('display_message', $this->gettext(
array('name' => 'passwdexpirewarning', 'vars' => array('expirationdatetime' => $_SESSION['passwdexpdatetime']))), 'warning');
}
$rcmail->output->command('display_message', $this->gettext(array(
'name' => 'passwdexpirewarning',
'vars' => array('expirationdatetime' => $_SESSION['password_expires'])
)), 'warning');
}
}

$rcmail->output->send('plugin');
}

Expand Down Expand Up @@ -183,8 +184,9 @@ function password_save()
rcube::write_log('password', sprintf('Password changed for user %s (ID: %d) from %s',
$rcmail->get_user_name(), $rcmail->user->ID, rcube_utils::remote_ip()));
}
// Remove expiration date/time
$rcmail->session->remove('passwdexpdatetime');

// Remove expiration date/time
$rcmail->session->remove('password_expires');
}
else {
$rcmail->output->command('display_message', $res, 'error');
Expand Down
4 changes: 4 additions & 0 deletions plugins/redundant_attachments/config.inc.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// and copies them into sql database.
// In environments with replicated database it is possible
// to use memcache as a fallback when write-master is unavailable.
// ------------------------------------------------------------
// WARNING: Remember to also set memcache_max_allowed_packet in
// config to match with expected max attachment size.
// ------------------------------------------------------------
$config['redundant_attachments_memcache'] = false;

// Attachment data expires after specified TTL time in seconds (max.2592000).
Expand Down
8 changes: 1 addition & 7 deletions program/include/rcmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -2083,13 +2083,7 @@ public function upload_init($max_size = null)
}

// find max filesize value
$max_filesize = parse_bytes(ini_get('upload_max_filesize'));
$max_postsize = parse_bytes(ini_get('post_max_size'));

if ($max_postsize && $max_postsize < $max_filesize) {
$max_filesize = $max_postsize;
}

$max_filesize = rcube_utils::max_upload_size();
if ($max_size && $max_size < $max_filesize) {
$max_filesize = $max_size;
}
Expand Down
32 changes: 23 additions & 9 deletions program/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,27 +407,41 @@ function rcube_text_editor(config, id)
};

// replace selection with text snippet
this.replace = function(text)
// input can be a string or object with 'text' and 'html' properties
this.replace = function(input)
{
var ed = this.editor;
var format, ed = this.editor;

// insert into tinymce editor
if (ed) {
ed.getWin().focus(); // correct focus in IE & Chrome
ed.selection.setContent(rcmail.quote_html(text).replace(/\r?\n/g, '<br/>'), { format:'text' });

if ($.type(input) == 'object') {
input = input.html;
format = 'html';
}
else {
input = rcmail.quote_html(input).replace(/\r?\n/g, '<br/>');
format = 'text';
}

ed.selection.setContent(input, {format: format});
}
// replace selection in compose textarea
else if (ed = rcube_find_object(this.id)) {
var selection = $(ed).is(':focus') ? rcmail.get_input_selection(ed) : { start:0, end:0 },
inp_value = ed.value;
pre = inp_value.substring(0, selection.start),
end = inp_value.substring(selection.end, inp_value.length);
var selection = $(ed).is(':focus') ? rcmail.get_input_selection(ed) : {start: 0, end: 0},
value = ed.value;
pre = value.substring(0, selection.start),
end = value.substring(selection.end, value.length);

if ($.type(input) == 'object')
input = input.text;

// insert response text
ed.value = pre + text + end;
ed.value = pre + input + end;

// set caret after inserted text
rcmail.set_caret_pos(ed, selection.start + text.length);
rcmail.set_caret_pos(ed, selection.start + input.length);
ed.focus();
}
};
Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public static function img($attr = null)
}

return self::tag('img', $attr + array('alt' => ''), null, array_merge(self::$common_attrib,
array('src','alt','width','height','border','usemap','onclick','onerror')));
array('src','alt','width','height','border','usemap','onclick','onerror','onload')));
}

/**
Expand Down
13 changes: 3 additions & 10 deletions program/lib/Roundcube/rcube_cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -645,16 +645,9 @@ private function max_packet_size()
}
$this->max_packet -= 2000;
}
else if ($this->type == 'memcache') {
if ($stats = $this->db->getStats()) {
$remaining = $stats['limit_maxbytes'] - $stats['bytes'];
$this->max_packet = min($remaining / 5, $this->max_packet);
}
}
else if ($this->type == 'apc' && function_exists('apc_sma_info')) {
if ($stats = apc_sma_info()) {
$this->max_packet = min($stats['avail_mem'] / 5, $this->max_packet);
}
else {
$max_packet = rcube::get_instance()->config->get($this->type . '_max_allowed_packet');
$this->max_packet = parse_bytes($max_packet) ?: $this->max_packet;
}
}

Expand Down
Loading

0 comments on commit 548c13f

Please sign in to comment.