Hello community,
here is the log from the commit of package roundcubemail for openSUSE:Factory checked in at 2016-01-01 19:48:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/roundcubemail (Old)
and /work/SRC/openSUSE:Factory/.roundcubemail.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "roundcubemail"
Changes:
--------
--- /work/SRC/openSUSE:Factory/roundcubemail/roundcubemail.changes 2015-10-28 17:30:34.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.roundcubemail.new/roundcubemail.changes 2016-01-01 19:51:18.000000000 +0100
@@ -1,0 +2,32 @@
+Thu Dec 31 10:42:03 UTC 2015 - lars@linux-schulserver.de
+
+- Update to 1.1.4
+ Add workaround for https://bugs.php.net/bug.php?id=70757 (#1490582)
+ Fix duplicate messages in list and wrong count after delete (#1490572)
+ Fix so Installer requires PHP5
+ Make brute force attacks harder by re-generating security token on every failed login (#1490549)
+ Slow down brute-force attacks by waiting for a second after failed login (#1490549)
+ Fix .htaccess rewrite rules to not block .well-known URIs (#1490615)
+ Fix mail view scaling on iOS (#1490551)
+ Fix so database_attachments::cleanup() does not remove attachments from other sessions (#1490542)
+ Fix responses list update issue after response name change (#1490555)
+ Fix bug where message preview was unintentionally reset on check-recent action (#1490563)
+ Fix bug where HTML messages with invalid/excessive css styles couldn't be displayed (#1490539)
+ Fix redundant blank lines when using HTML and top posting (#1490576)
+ Fix redundant blank lines on start of text after html to text conversion (#1490577)
+ Fix HTML sanitizer to skip <!-- node type X --> in output (#1490583)
+ Fix invalid LDAP query in ACL user autocompletion (#1490591)
+ Fix regression in displaying contents of message/rfc822 parts (#1490606)
+ Fix handling of message/rfc822 attachments on replies and forwards (#1490607)
+ Fix PDF support detection in Firefox > 19 (#1490610)
+ Fix path traversal vulnerability (CWE-22) in setting a skin (#1490620)
+ Fix so drag-n-drop of text (e.g. recipient addresses) on compose page actually works (#1490619)
+
+- explicitely add required PHP packages (according to INSTALL):
+ + php-dom, php-json, php-sockets
+- also recommend additional PHP packages:
+ + php-zip, php-pear-Crypt_GPG
+- use generic php- prefix also for recommended packages (no explicit php5-)
+- no Dockerfile readme any more
+
+-------------------------------------------------------------------
Old:
----
roundcubemail-1.1.3.tar.gz
New:
----
roundcubemail-1.1.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ roundcubemail.spec ++++++
--- /var/tmp/diff_new_pack.S462oK/_old 2016-01-01 19:51:19.000000000 +0100
+++ /var/tmp/diff_new_pack.S462oK/_new 2016-01-01 19:51:19.000000000 +0100
@@ -17,7 +17,7 @@
Name: roundcubemail
-Version: 1.1.3
+Version: 1.1.4
Release: 0
Summary: A modern browser-based multilingual IMAP client
License: GPL-3.0+ and GPL-2.0 and BSD-3-Clause
@@ -42,13 +42,16 @@
Requires: http_daemon
Requires: mod_php_any >= 5.3
+Requires: php-dom
Requires: php-exif
Requires: php-gettext
Requires: php-iconv
+Requires: php-json
Requires: php-mbstring
Requires: php-mcrypt
Requires: php-openssl
Requires: php-session
+Requires: php-sockets
Requires: php_any_db
## Requires: for upstream dep package
@@ -63,8 +66,10 @@
Recommends: logrotate
Recommends: php-mysql
-Recommends: php5-intl
-Recommends: php5-fileinfo
+Recommends: php-intl
+Recommends: php-fileinfo
+Recommends: php-zip
+Recommends: php-pear-Crypt_GPG >= 1.2.0
Provides: roundcube_framework = %{version}
Conflicts: roundcube-framework
@@ -100,7 +105,7 @@
# remove shebang from chpass-wrapper
sed -i '1d' plugins/password/helpers/chpass-wrapper.py
# remove INSTALL doc
-%{__rm} INSTALL Dockerfile
+%{__rm} INSTALL
%build
++++++ roundcubemail-1.1.3.tar.gz -> roundcubemail-1.1.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/.htaccess new/roundcubemail-1.1.4/.htaccess
--- old/roundcubemail-1.1.3/.htaccess 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/.htaccess 2015-12-23 10:18:12.000000000 +0100
@@ -31,7 +31,7 @@
# security rules:
# - deny access to files not containing a dot or starting with a dot
# in all locations except installer directory
-RewriteRule ^(?!installer|[a-f0-9]{16})(\.?[^\.]+)$ - [F]
+RewriteRule ^(?!installer|\.well-known\/|[a-f0-9]{16})(\.?[^\.]+)$ - [F]
# - deny access to some locations
RewriteRule ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F]
# - deny access to some documentation files
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/CHANGELOG new/roundcubemail-1.1.4/CHANGELOG
--- old/roundcubemail-1.1.3/CHANGELOG 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/CHANGELOG 2015-12-23 10:18:12.000000000 +0100
@@ -1,6 +1,31 @@
CHANGELOG Roundcube Webmail
===========================
+RELEASE 1.1.4
+-------------
+- Add workaround for https://bugs.php.net/bug.php?id=70757 (#1490582)
+- Fix duplicate messages in list and wrong count after delete (#1490572)
+- Fix so Installer requires PHP5
+- Make brute force attacks harder by re-generating security token on every failed login (#1490549)
+- Slow down brute-force attacks by waiting for a second after failed login (#1490549)
+- Fix .htaccess rewrite rules to not block .well-known URIs (#1490615)
+- Fix mail view scaling on iOS (#1490551)
+- Fix so database_attachments::cleanup() does not remove attachments from other sessions (#1490542)
+- Fix responses list update issue after response name change (#1490555)
+- Fix bug where message preview was unintentionally reset on check-recent action (#1490563)
+- Fix bug where HTML messages with invalid/excessive css styles couldn't be displayed (#1490539)
+- Fix redundant blank lines when using HTML and top posting (#1490576)
+- Fix redundant blank lines on start of text after html to text conversion (#1490577)
+- Fix HTML sanitizer to skip <!-- node type X --> in output (#1490583)
+- Fix invalid LDAP query in ACL user autocompletion (#1490591)
+- Fix regression in displaying contents of message/rfc822 parts (#1490606)
+- Fix handling of message/rfc822 attachments on replies and forwards (#1490607)
+- Fix PDF support detection in Firefox > 19 (#1490610)
+- Fix path traversal vulnerability (CWE-22) in setting a skin (#1490620)
+- Fix so drag-n-drop of text (e.g. recipient addresses) on compose page actually works (#1490619)
+
+RELEASE 1.1.3
+-------------
- Fix closing of nested menus (#1490443)
- Fix so E_DEPRECATED errors from PEAR libs are ignored by error_reporting change (#1490281)
- Fix compatibility with PHP 5.3 in rcube_ldap class (#1490424)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/Dockerfile new/roundcubemail-1.1.4/Dockerfile
--- old/roundcubemail-1.1.3/Dockerfile 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/Dockerfile 1970-01-01 01:00:00.000000000 +0100
@@ -1,34 +0,0 @@
-FROM debian:latest
-MAINTAINER Alex Brandt
-
-EXPOSE 80 443
-
-RUN apt-get -qq update
-RUN apt-get install -qq apache2-mpm-event
-
-RUN sed -e 's|/var/www|&/public_html|' -e 's/\(Log \+\)[^ ]\+/\1"|cat"/' -i /etc/apache2/sites-available/default
-RUN a2ensite default
-
-RUN sed -e 's|/var/www|&/public_html|' -e 's/\(Log \+\)[^ ]\+/\1"|cat"/' -i /etc/apache2/sites-available/default-ssl
-RUN sed -e '/SSLCertificateKeyFile/s|ssl-cert-snakeoil.key|ssl-cert.key|' -e '/SSLCertificateFile/s|ssl-cert-snakeoil.pem|ssl-cert.pem|' -i /etc/apache2/sites-available/default-ssl
-RUN ln -snf ssl-cert-snakeoil.pem /etc/ssl/certs/ssl-cert.pem
-RUN ln -snf ssl-cert-snakeoil.key /etc/ssl/private/ssl-cert.key
-RUN a2ensite default-ssl
-
-RUN a2enmod expires
-RUN a2enmod headers
-RUN a2enmod ssl
-
-RUN apt-get install -qq php5 php-pear php5-mysql php5-pgsql php5-sqlite
-RUN pear install mail_mime mail_mimedecode net_smtp net_idna2-beta auth_sasl net_sieve crypt_gpg
-
-RUN rm -rf /var/www
-ADD . /var/www
-
-RUN echo -e '<?php\n$config = array();\n' > /var/www/config/config.inc.php
-RUN rm -rf /var/www/installer
-
-RUN . /etc/apache2/envvars && chown -R ${APACHE_RUN_USER}:${APACHE_RUN_GROUP} /var/www/temp /var/www/logs
-
-ENTRYPOINT [ "/usr/sbin/apache2ctl", "-D", "FOREGROUND" ]
-CMD [ "-k", "start" ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/INSTALL new/roundcubemail-1.1.4/INSTALL
--- old/roundcubemail-1.1.3/INSTALL 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/INSTALL 2015-12-23 10:18:12.000000000 +0100
@@ -11,7 +11,7 @@
* The Apache, Lighttpd, Cherokee or Hiawatha web server
* .htaccess support allowing overrides for DirectoryIndex
-* PHP Version 5.3.7 or greater including
+* PHP Version 5.3.7 or greater (but not PHP 7) including
- PCRE, DOM, JSON, Session, Sockets (required)
- PHP Data Objects (PDO) with driver for either MySQL, PostgreSQL or SQLite (required)
- Libiconv, Zip (recommended)
@@ -168,6 +168,12 @@
mod_rewrite for Apache webserver and double check access to the above listed
directories and their contents is denied.
+NOTE: In Apache 2.4, support for .htaccess files has been disabled by
+default. Therefore you first need to enable this in your Apache main or
+virtual host config by with:
+
+ AllowOverride all
+
UPGRADING
=========
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/bin/installto.sh new/roundcubemail-1.1.4/bin/installto.sh
--- old/roundcubemail-1.1.3/bin/installto.sh 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/bin/installto.sh 2015-12-23 10:18:12.000000000 +0100
@@ -60,6 +60,8 @@
break;
}
}
+ // remove old (<1.0) .htaccess file
+ @unlink("$target_dir/program/.htaccess");
echo "done.\n\n";
if (is_dir("$target_dir/skins/default")) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/composer.json-dist new/roundcubemail-1.1.4/composer.json-dist
--- old/roundcubemail-1.1.3/composer.json-dist 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/composer.json-dist 2015-12-23 10:18:12.000000000 +0100
@@ -23,7 +23,7 @@
"pear-pear.php.net/net_idna2": "~0.1.1",
"pear-pear.php.net/net_sieve": "~1.3.4",
"pear-pear.php.net/mail_mime": "~1.9.0",
- "pear-pear.php.net/net_smtp": "~1.6.3",
+ "pear-pear.php.net/net_smtp": "~1.7.1",
"patchwork/utf8": "~1.2.3"
},
"require-dev": {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/config/.htaccess new/roundcubemail-1.1.4/config/.htaccess
--- old/roundcubemail-1.1.3/config/.htaccess 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/config/.htaccess 2015-12-23 10:18:12.000000000 +0100
@@ -1,2 +1,7 @@
# deny webserver access to this directory
-Deny from all
+<ifModule mod_authz_core.c>
+ Require all denied
+</ifModule>
+<ifModule !mod_authz_core.c>
+ Deny from all
+</ifModule>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/index.php new/roundcubemail-1.1.4/index.php
--- old/roundcubemail-1.1.3/index.php 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/index.php 2015-12-23 10:18:12.000000000 +0100
@@ -2,7 +2,7 @@
/*
+-------------------------------------------------------------------------+
| Roundcube Webmail IMAP Client |
- | Version 1.1.3 |
+ | Version 1.1.4 |
| |
| Copyright (C) 2005-2015, The Roundcube Dev Team |
| |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/installer/check.php new/roundcubemail-1.1.4/installer/check.php
--- old/roundcubemail-1.1.3/installer/check.php 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/installer/check.php 2015-12-23 10:18:12.000000000 +0100
@@ -93,8 +93,14 @@
define('MIN_PHP_VERSION', '5.3.7');
if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '>=')) {
- $RCI->pass('Version', 'PHP ' . PHP_VERSION . ' detected');
-} else {
+ if (PHP_MAJOR_VERSION != 5) {
+ $RCI->fail('Version', 'PHP5 is required, ' . PHP_VERSION . ' detected');
+ }
+ else {
+ $RCI->pass('Version', 'PHP ' . PHP_VERSION . ' detected');
+ }
+}
+else {
$RCI->fail('Version', 'PHP Version ' . MIN_PHP_VERSION . ' or greater is required ' . PHP_VERSION . ' detected');
}
?>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/installer/index.php new/roundcubemail-1.1.4/installer/index.php
--- old/roundcubemail-1.1.3/installer/index.php 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/installer/index.php 2015-12-23 10:18:12.000000000 +0100
@@ -3,7 +3,7 @@
/*
+-------------------------------------------------------------------------+
| Roundcube Webmail setup tool |
- | Version 1.1.3 |
+ | Version 1.1.4 |
| |
| Copyright (C) 2009-2015, The Roundcube Dev Team |
| |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/logs/.gitignore new/roundcubemail-1.1.4/logs/.gitignore
--- old/roundcubemail-1.1.3/logs/.gitignore 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/logs/.gitignore 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-*
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/logs/.htaccess new/roundcubemail-1.1.4/logs/.htaccess
--- old/roundcubemail-1.1.3/logs/.htaccess 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/logs/.htaccess 2015-12-23 10:18:12.000000000 +0100
@@ -1,2 +1,7 @@
# deny webserver access to this directory
-Deny from all
+<ifModule mod_authz_core.c>
+ Require all denied
+</ifModule>
+
+ Deny from all
+</ifModule>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/plugins/acl/acl.php new/roundcubemail-1.1.4/plugins/acl/acl.php
--- old/roundcubemail-1.1.3/plugins/acl/acl.php 2015-09-13 21:10:02.000000000 +0200
+++ new/roundcubemail-1.1.4/plugins/acl/acl.php 2015-12-23 10:18:12.000000000 +0100
@@ -739,7 +739,11 @@
$config['fieldmap']['uid'] = $uid_field;
// search in UID and name fields
- $config['search_fields'] = array_values($config['fieldmap']);
+ // $name_field can be in a form of <field>:<modifier> (#1490591)
+ $name_field = preg_replace('/:.*$/', '', $name_field);
+ $search = array_unique(array($name_field, $uid_field));
+
+ $config['search_fields'] = $search;
$config['required_fields'] = array($uid_field);
// set search filter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/plugins/database_attachments/database_attachments.php new/roundcubemail-1.1.4/plugins/database_attachments/database_attachments.php
--- old/roundcubemail-1.1.3/plugins/database_attachments/database_attachments.php 2015-09-13 21:10:03.000000000 +0200
+++ new/roundcubemail-1.1.4/plugins/database_attachments/database_attachments.php 2015-12-23 10:18:12.000000000 +0100
@@ -22,7 +22,7 @@
protected $cache;
// A prefix for the cache key used in the session and in the key field of the cache table
- protected $prefix = "db_attach";
+ const PREFIX = "ATTACH";
/**
* Save a newly uploaded attachment
@@ -153,9 +153,16 @@
$ttl = 12 * 60 * 60; // default: 12 hours
$ttl = $rcmail->config->get('database_attachments_cache_ttl', $ttl);
$type = $rcmail->config->get('database_attachments_cache', 'db');
+ $prefix = self::PREFIX;
+
+ // Add session identifier to the prefix to prevent from removing attachments
+ // in other sessions of the same user (#1490542)
+ if ($id = session_id()) {
+ $prefix .= $id;
+ }
// Init SQL cache (disable cache data serialization)
- $this->cache = $rcmail->get_cache($this->prefix, $type, $ttl, false);
+ $this->cache = $rcmail->get_cache($prefix, $type, $ttl, false);
}
return $this->cache;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/plugins/redundant_attachments/redundant_attachments.php new/roundcubemail-1.1.4/plugins/redundant_attachments/redundant_attachments.php
--- old/roundcubemail-1.1.3/plugins/redundant_attachments/redundant_attachments.php 2015-09-13 21:10:03.000000000 +0200
+++ new/roundcubemail-1.1.4/plugins/redundant_attachments/redundant_attachments.php 2015-12-23 10:18:12.000000000 +0100
@@ -36,7 +36,7 @@
class redundant_attachments extends filesystem_attachments
{
// A prefix for the cache key used in the session and in the key field of the cache table
- private $prefix = "ATTACH";
+ const PREFIX = "ATTACH";
// rcube_cache instance for SQL DB
private $cache;
@@ -46,13 +46,6 @@
private $loaded;
- /**
- * Default constructor
- */
- function init()
- {
- parent::init();
- }
/**
* Loads plugin configuration and initializes cache object(s)
@@ -68,15 +61,20 @@
// load configuration
$this->load_config();
- $ttl = 12 * 60 * 60; // 12 hours
- $ttl = $rcmail->config->get('redundant_attachments_cache_ttl', $ttl);
+ $ttl = 12 * 60 * 60; // 12 hours
+ $ttl = $rcmail->config->get('redundant_attachments_cache_ttl', $ttl);
+ $prefix = self::PREFIX;
+
+ if ($id = session_id()) {
+ $prefix .= $id;
+ }
// Init SQL cache (disable cache data serialization)
- $this->cache = $rcmail->get_cache($this->prefix, 'db', $ttl, false);
+ $this->cache = $rcmail->get_cache($prefix, 'db', $ttl, false);
// Init memcache (fallback) cache
if ($rcmail->config->get('redundant_attachments_memcache')) {
- $this->mem_cache = $rcmail->get_cache($this->prefix, 'memcache', $ttl, false);
+ $this->mem_cache = $rcmail->get_cache($prefix, 'memcache', $ttl, false);
}
$this->loaded = true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/program/include/iniset.php new/roundcubemail-1.1.4/program/include/iniset.php
--- old/roundcubemail-1.1.3/program/include/iniset.php 2015-09-13 21:10:03.000000000 +0200
+++ new/roundcubemail-1.1.4/program/include/iniset.php 2015-12-23 10:18:12.000000000 +0100
@@ -21,7 +21,7 @@
*/
// application constants
-define('RCMAIL_VERSION', '1.1.3');
+define('RCMAIL_VERSION', '1.1.4');
define('RCMAIL_START', microtime(true));
if (!defined('INSTALL_PATH')) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/program/include/rcmail.php new/roundcubemail-1.1.4/program/include/rcmail.php
--- old/roundcubemail-1.1.3/program/include/rcmail.php 2015-09-13 21:10:03.000000000 +0200
+++ new/roundcubemail-1.1.4/program/include/rcmail.php 2015-12-23 10:18:12.000000000 +0100
@@ -592,6 +592,8 @@
// try to log in
if (!$storage->connect($host, $username, $pass, $port, $ssl)) {
+ // Wait a second to slow down brute-force attacks (#1490549)
+ sleep(1);
return false;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/program/include/rcmail_output_html.php new/roundcubemail-1.1.4/program/include/rcmail_output_html.php
--- old/roundcubemail-1.1.3/program/include/rcmail_output_html.php 2015-09-13 21:10:03.000000000 +0200
+++ new/roundcubemail-1.1.4/program/include/rcmail_output_html.php 2015-12-23 10:18:12.000000000 +0100
@@ -225,6 +225,17 @@
*/
public function set_skin($skin)
{
+ // Sanity check to prevent from path traversal vulnerability (#1490620)
+ if (strpos($skin, '/') !== false || strpos($skin, "\\") !== false) {
+ rcube::raise_error(array(
+ 'file' => __FILE__,
+ 'line' => __LINE__,
+ 'message' => 'Invalid skin name'
+ ), true, false);
+
+ return false;
+ }
+
$valid = false;
$path = RCUBE_INSTALL_PATH . 'skins/';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/program/js/app.js new/roundcubemail-1.1.4/program/js/app.js
--- old/roundcubemail-1.1.3/program/js/app.js 2015-09-13 21:10:03.000000000 +0200
+++ new/roundcubemail-1.1.4/program/js/app.js 2015-12-23 10:18:12.000000000 +0100
@@ -2488,22 +2488,23 @@
// removes messages that doesn't exists from list selection array
this.update_selection = function()
{
- var selected = this.message_list.selection,
- rows = this.message_list.rows,
+ var list = this.message_list,
+ selected = list.selection,
+ rows = list.rows,
i, selection = [];
for (i in selected)
if (rows[selected[i]])
selection.push(selected[i]);
- this.message_list.selection = selection;
+ list.selection = selection;
// reset preview frame, if currently previewed message is not selected (has been removed)
try {
var win = this.get_frame_window(this.env.contentframe),
id = win.rcmail.env.uid;
- if (id && $.inArray(id, selection) < 0)
+ if (id && !list.in_selection(id))
this.show_contentframe(false);
}
catch (e) {};
@@ -7795,7 +7796,7 @@
// html5 file-drop API
this.document_drag_hover = function(e, over)
{
- e.preventDefault();
+ // don't e.preventDefault() here to not block text dragging on the page (#1490619)
$(this.gui_objects.filedrop)[(over?'addClass':'removeClass')]('active');
};
@@ -8154,14 +8155,10 @@
if (!this.env.browser_capabilities)
this.env.browser_capabilities = {};
- if (this.env.browser_capabilities.pdf === undefined)
- this.env.browser_capabilities.pdf = this.pdf_support_check();
-
- if (this.env.browser_capabilities.flash === undefined)
- this.env.browser_capabilities.flash = this.flash_support_check();
-
- if (this.env.browser_capabilities.tif === undefined)
- this.tif_support_check();
+ $.each(['pdf', 'flash', 'tif'], function() {
+ if (ref.env.browser_capabilities[this] === undefined)
+ ref.env.browser_capabilities[this] = ref[this + '_support_check']();
+ });
};
// Returns browser capabilities string
@@ -8180,11 +8177,14 @@
this.tif_support_check = function()
{
- var img = new Image();
+ window.setTimeout(function() {
+ var img = new Image();
+ img.onload = function() { ref.env.browser_capabilities.tif = 1; };
+ img.onerror = function() { ref.env.browser_capabilities.tif = 0; };
+ img.src = ref.assets_path('program/resources/blank.tif');
+ }, 10);
- img.onload = function() { ref.env.browser_capabilities.tif = 1; };
- img.onerror = function() { ref.env.browser_capabilities.tif = 0; };
- img.src = this.assets_path('program/resources/blank.tif');
+ return 0;
};
this.pdf_support_check = function()
@@ -8220,6 +8220,14 @@
return 1;
}
+ window.setTimeout(function() {
+ $('<object>').css({position: 'absolute', left: '-10000px'})
+ .attr({data: ref.assets_path('program/resources/dummy.pdf'), width: 1, height: 1, type: 'application/pdf'})
+ .load(function() { ref.env.browser_capabilities.pdf = 1; })
+ .error(function() { ref.env.browser_capabilities.pdf = 0; })
+ .appendTo($('body'));
+ }, 10);
+
return 0;
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roundcubemail-1.1.3/program/js/app.min.js new/roundcubemail-1.1.4/program/js/app.min.js
--- old/roundcubemail-1.1.3/program/js/app.min.js 2015-09-13 21:10:03.000000000 +0200
+++ new/roundcubemail-1.1.4/program/js/app.min.js 2015-12-23 10:18:12.000000000 +0100
@@ -122,188 +122,188 @@
a))};this.checkmail=function(){var a=this.set_busy(!0,"checkingmail"),b=this.check_recent_params();this.http_post("check-recent",b,a)};this.filter_mailbox=function(a){if(!this.filter_disabled){var b=this.set_busy(!0,"searching");this.clear_message_list();this.env.current_page=1;this.env.search_filter=a;this.http_request("search",this.search_params(!1,a),b)}};this.refresh_list=function(){this.list_mailbox(this.env.mailbox,this.env.current_page||1,null,{_clear:1},!0);this.message_list&&this.message_list.clear_selection()};
this.list_mailbox=function(a,b,d,e,f){var h=window;"object"!=typeof e&&(e={});a||(a=this.env.mailbox?this.env.mailbox:"INBOX");d&&(e._sort=d);this.env.mailbox!=a?(b=1,this.env.current_page=b,this.env.search_scope="base",this.select_all_mode=!1,this.reset_search_filter()):this.env.search_request&&(e._search=this.env.search_request);if(!f){this.clear_message_list();if(a!=this.env.mailbox||a==this.env.mailbox&&!b&&!d)e._refresh=1;this.select_folder(a,"",!0);this.unmark_folder(a,"recent","",!0);this.env.mailbox=
a}if(this.gui_objects.messagelist)this.list_mailbox_remote(a,b,e);else{if(d=this.get_frame_window(this.env.contentframe))h=d,e._framed=1;this.env.uid&&(e._uid=this.env.uid);a&&(this.set_busy(!0,"loading"),e._mbox=a,b&&(e._page=b),this.location_href(e,h))}};this.clear_message_list=function(){this.env.messages={};this.show_contentframe(!1);this.message_list&&this.message_list.clear(!0)};this.list_mailbox_remote=function(a,b,d){var e=this.set_busy(!0,"loading");"object"!=typeof d&&(d={});d._mbox=a;b&&
-(d._page=b);this.http_request("list",d,e);this.update_state({_mbox:a,_page:b&&1$.inArray(f,e)&&this.show_contentframe(!1)}catch(h){}};this.expand_unread=function(){for(var a,b=this.message_list.tbody.firstChild;b;)1==b.nodeType&&(a=this.message_list.rows[b.uid])&&
-a.unread_children&&(this.message_list.expand_all(a),this.set_unread_children(a.uid)),b=b.nextSibling;return!1};this.expand_message_row=function(a,b){var d=this.message_list.rows[b];d.expanded=!d.expanded;this.set_unread_children(b);d.expanded=!d.expanded;this.message_list.expand_row(a,b)};this.expand_threads=function(){if(this.env.threading&&this.env.autoexpand_threads&&this.message_list)switch(this.env.autoexpand_threads){case 2:this.expand_unread();break;case 1:this.message_list.expand_all()}};
-this.init_threads=function(a,b){if(b&&b!=this.env.mailbox)return!1;for(var d=0,e=a.length;dd.depth?(f=e-d.depth,h[b][f]&2||(h[b][f]=h[b][f]?h[b][f]+2:2)):e==d.depth&&(h[b][0]&2||(h[b][0]+=2)),d.depth>e);b--);h.push(Array(d.depth));
-h[h.length-1][0]=1;g.push(d.uid)}else{if(h.length){for(b in h)this.set_tree_icons(g[b],h[b]);h=[];g=[]}if(a&&k!=n[a].obj)break}k=k.nextSibling}if(h.length)for(b in h)this.set_tree_icons(g[b],h[b])};this.set_tree_icons=function(a,b){var d,e=[],f="",h=b.length;for(d=0;d'):f+('<div style="width:'+e[d].width+'px" />');f&&$("#rcmtab"+this.html_identifier(a,!0)).html(f)};this.update_thread_root=function(a,b){if(this.env.threading){var d=this.message_list.find_root(a);if(a!=d){var e=this.message_list.rows[d];if("read"==b&&e.unread_children)e.unread_children--;else if("unread"==b&&e.has_children)e.unread_children=e.unread_children?e.unread_children+1:1;else return;this.set_message_icon(d);this.set_unread_children(d)}}};
-this.update_thread=function(a){if(!this.env.threading)return 0;var b,d=0,e=this.message_list.rows,f=e[a],h=e[a].depth,m=[];f.depth?f.unread&&(a=this.message_list.find_root(a),e[a].unread_children--,this.set_unread_children(a)):d--;a=f.parent_uid;for(f=f.obj.nextSibling;f;){if(1==f.nodeType&&(b=e[f.uid])){if(!b.depth||b.depth<=h)break;b.depth--;$("#rcmtab"+b.id).width(15*b.depth).html("");b.depth?(b.depth==h&&(b.parent_uid=a),b.unread&&m.length&&m[m.length-1].unread_children++):(d++,b.parent_uid=0,
-b.has_children&&($("#"+b.id+" .leaf:first").attr("id","rcmexpando"+b.id).attr("class","none"!=b.obj.style.display?"expanded":"collapsed").bind("mousedown",{uid:b.uid},function(a){return g.expand_message_row(a,a.data.uid)}),b.unread_children=0,m.push(b)),"none"==b.obj.style.display&&$(b.obj).show())}f=f.nextSibling}for(b=0;b$.inArray(k,n)&&n.push(k)),f&&this.message_list.remove_row(g,this.env.display_next&&h==l.length-1);!this.env.display_next&&f&&
-this.message_list.clear_selection();h=0;for(len=n.length;he?b._count=-1*e:0h?d._count=
--1*h:0=a.length?a.join(","):
-a};this.set_button_titles=function(){var a="deletemessage";this.env.flag_for_deletion||!this.env.trash_mailbox||this.env.mailbox==this.env.trash_mailbox||this.env.delete_junk&&this.env.junk_mailbox&&this.env.mailbox==this.env.junk_mailbox||(a="movemessagetotrash");this.set_alttext("delete",a)};this.expunge_mailbox=function(a){var b,d={_mbox:a};a==this.env.mailbox&&(b=this.set_busy(!0,"loading"),d._reload=1,this.env.search_request&&(d._search=this.env.search_request));this.http_post("expunge",d,b)};
-this.purge_mailbox=function(a){var b,d={_mbox:a};if(!confirm(this.get_label("purgefolderconfirm")))return!1;a==this.env.mailbox&&(b=this.set_busy(!0,"loading"),d._reload=1);this.http_post("purge",d,b)};this.purge_mailbox_test=function(){return this.env.exists&&(this.env.mailbox==this.env.trash_mailbox||this.env.mailbox==this.env.junk_mailbox||this.env.mailbox.startsWith(this.env.trash_mailbox+this.env.delimiter)||this.env.mailbox.startsWith(this.env.junk_mailbox+this.env.delimiter))};this.login_user_keyup=
-function(a){var b=rcube_event.get_keycode(a),d=$("#rcmloginpwd");return 13==b&&d.length&&!d.val()?(d.focus(),rcube_event.cancel(a)):!0};this.open_compose_step=function(a){a=this.url("mail/compose",a);this.env.compose_extwin&&!this.env.extwin?this.open_window(a):(this.redirect(a),this.env.extwin&&window.resizeTo(Math.max(this.env.popup_width,$(window).width()),$(window).height()+24))};this.init_messageform=function(){if(!this.gui_objects.messageform)return!1;var a,b,d=$("[name='_from']"),e=$("[name='_to']"),
-f=$("input[name='_subject']"),h=$("[name='_message']").get(0),g="1"==$("input[name='_is_html']").val(),k=["cc","bcc","replyto","followupto"],n,l=this.opener();l&&"compose"==l.env.action&&(setTimeout(function(){1this.env.contactdata[f].indexOf("@")&&d.length)){var g=f.substr(1);this.group2expand[g]={name:this.env.contactdata[f],input:d.get(0)};this.http_request("group-expand",{_source:this.env.source,_gid:g},!1)}b.length&&d.length&&(f=d.val(),h=RegExp(RegExp.escape(e)+"\\s*$"),f&&
-!h.test(f)&&(f+=e+" "),d.val(f+b.join(e+" ")+e+" ").change(),this.triggerEvent("add-recipient",{field:a,recipients:b}));return b.length};this.check_compose_input=function(a){var b=$("[name='_to']"),d=$("[name='_cc']"),e=$("[name='_bcc']"),f=$("[name='_from']"),h=$("[name='_subject']");if("text"==f.prop("type")&&!rcube_check_email(f.val(),!0))return alert(this.get_label("nosenderwarning")),f.focus(),!1;d=b.val()?b.val():d.val()?d.val():e.val();if(!rcube_check_email(d.replace(/^\s+/,"").replace(/[\s,;]+$/,
-""),!0))return alert(this.get_label("norecipientwarning")),b.focus(),!1;for(var m in this.env.attachments)if("object"===typeof this.env.attachments[m]&&!this.env.attachments[m].complete)return alert(this.get_label("notuploadedwarning")),!1;if(""==h.val()){var b={},k=$('<div class="prompt">').html('<div class="message">'+this.get_label("nosubjectwarning")+"</div>").appendTo(document.body),n=$("<input>").attr({type:"text",size:30}).val(this.get_label("nosubject")).appendTo(k),l=function(){h.val(n.val());
-k.dialog("close");g.command(a,{nocheck:!0})};b[this.get_label("sendmessage")]=function(){l($(this))};b[this.get_label("cancel")]=function(){h.focus();$(this).dialog("close")};k.dialog({modal:!0,resizable:!1,buttons:b,close:function(a,b){$(this).remove()}});n.select().keydown(function(a){13==a.which&&l()});return!1}if(!this.editor.get_content()&&!confirm(this.get_label("nobodywarning")))return this.editor.focus(),!1;this.editor.save();return!0};this.toggle_editor=function(a,b,d){b=this.editor.toggle(a.html,
-a.noconvert||!1);a.mode=a.html?"html":"plain";!b&&d&&(a.mode=a.html?"plain":"html",$(d.target).filter("select").val(a.mode));b&&$("input[name='_is_html']").val(a.html?1:0);return b};this.insert_response=function(a){a=this.env.textresponses[a]?this.env.textresponses[a].text:null;if(!a)return!1;this.editor.replace(a)};this.save_response=function(){var a={},b=this.editor.get_content({selection:!0,format:"text",nosig:!0}),d='<form class="propform"><div class="prop block"><label>'+this.get_label("responsename")+
-'</label><input type="text" name="name" id="ffresponsename" size="40" /></div><div class="prop block"><label>'+this.get_label("responsetext")+'</label><textarea name="text" id="ffresponsetext" cols="40" rows="8"></textarea></div></form>';a[this.gettext("save")]=function(a){a=$("#ffresponsename").val();var b=$("#ffresponsetext").val();if(!b)return $("#ffresponsetext").select(),!1;a||(a=b.substring(0,40));var d=g.display_message(g.get_label("savingresponse"),"loading");g.http_post("settings/responses",
-{_insert:1,_name:a,_text:b},d);$(this).dialog("close")};a[this.gettext("cancel")]=function(){$(this).dialog("close")};this.show_popup_dialog(d,this.gettext("newresponse"),a,{button_classes:["mainaction"]});$("#ffresponsetext").val(b);$("#ffresponsename").select()};this.add_response_item=function(a){var b=a.key;this.env.textresponses[b]=a;if(this.gui_objects.responseslist){var d=$("<li>").appendTo(this.gui_objects.responseslist);$("<a>").addClass("insertresponse active").attr("href","#").attr("rel",
-b).attr("tabindex","0").html(this.quote_html(a.name)).appendTo(d).mousedown(function(a){return rcube_event.cancel(a)}).bind("mouseup keypress",function(a){if("mouseup"==a.type||13==rcube_event.get_keycode(a))return g.command("insert-response",$(this).attr("rel")),$(document.body).trigger("mouseup"),rcube_event.cancel(a)})}};this.edit_responses=function(){};this.delete_response=function(a){!a&&this.responses_list&&(a=this.responses_list.get_selection()[0]);a&&confirm(this.get_label("deleteresponseconfirm"))&&
-this.http_post("settings/delete-response",{_key:a},!1)};this.spellcheck_state=function(){var a=this.editor.spellcheck_state();$.each(this.buttons.spellcheck||[],function(b,d){$("#"+d.id)[a?"addClass":"removeClass"]("selected")});return a};this.spellcheck_lang=function(){return this.editor.get_language()};this.spellcheck_lang_set=function(a){this.editor.set_language(a)};this.spellcheck_resume=function(a){this.editor.spellcheck_resume(a)};this.set_draft_id=function(a){if(a&&a!=this.env.draft_id){var b=
-{task:"mail",action:""};(b=this.opener(!1,b)||this.opener(!0,b))&&b.env.mailbox==this.env.drafts_mailbox&&b.command("checkmail");this.env.draft_id=a;$("input[name='_draft_saveid']").val(a);window.frames.savetarget&&window.frames.savetarget.history&&!this.draft_autosave_submit&&window.frames.savetarget.history.back();this.draft_autosave_submit=!1}this.remove_compose_data(this.env.compose_id);this.compose_skip_unsavedcheck=!1};this.auto_save_start=function(){this.env.draft_autosave&&(this.draft_autosave_submit=
-!1,this.save_timer=setTimeout(function(){g.draft_autosave_submit=!0;g.command("savedraft")},1E3*this.env.draft_autosave));!this.local_save_timer&&window.localStorage&&this.env.save_localstorage&&(this.compose_type_activity=this.compose_type_activity_last=0,$(document).bind("keypress",function(a){g.compose_type_activity++}),this.local_save_timer=setInterval(function(){g.compose_type_activity>g.compose_type_activity_last&&(g.save_compose_form_local(),g.compose_type_activity_last=g.compose_type_activity)},
-5E3),$(window).unload(function(){g.env.server_error||g.remove_compose_data(g.env.compose_id)}));window.onbeforeunload||(window.onbeforeunload=function(){if(!g.compose_skip_unsavedcheck&&g.cmp_hash!=g.compose_field_hash())return g.get_label("notsentwarning")});this.busy=!1};this.compose_field_hash=function(a){var b,d,e,f="",h=["to","cc","bcc","subject"];for(b=0;b$.inArray(e,d)&&d.push(e);this.local_storage_set_item("compose."+e,a,!0);this.local_storage_set_item("compose.index",d)}}};this.restore_compose_form=function(a,b){var d=this.local_storage_get_item("compose."+
-a,!0);d&&"object"==typeof d&&($.each(d,function(a,b){if("_"==a[0]){var d=$("*[name='"+a+"']");d[0]&&"checkbox"==d[0].type?d.prop("checked",""!=b):d.val(b)}}),("1"==d._is_html&&!b||"1"!=d._is_html&&b)&&this.command("toggle-editor",{id:this.env.composebody,html:!b,noconvert:!0}))};this.remove_compose_data=function(a){var b=this.local_storage_get_item("compose.index",[]);0<=$.inArray(a,b)&&(this.local_storage_remove_item("compose."+a),this.local_storage_set_item("compose.index",$.grep(b,function(b,e){return b!=
-a})))};this.clear_compose_data=function(){var a,b=this.local_storage_get_item("compose.index",[]);for(a=0;athis.env.max_filesize)return this.display_message(this.env.filesizeerror,"error"),!1;b=this.async_upload_form(a,b||"upload",function(a){var b,e="";try{this.contentDocument?b=this.contentDocument:this.contentWindow&&(b=this.contentWindow.document),e=b.childNodes[1].innerHTML}catch(f){}e.match(/add2attachment/)||bw.opera&&(!g.env.uploadframe||g.env.uploadframe!=a.data.ts)||(e.match(/display_message/)||g.display_message(g.get_label("fileuploaderror"),"error"),g.remove_from_attachment_list(a.data.ts),
-d&&g.set_busy(!1,null,d));bw.opera&&(g.env.uploadframe=a.data.ts)});var h="<span>"+this.get_label("uploading"+(1'+(this.env.cancelicon?'':this.get_label("cancel"))+"</a>"+b.html);var e,f=$("<li>");f.attr("id",a).addClass(b.classname).html(b.html).on("mouseover",function(){rcube_webmail.long_subject_title_ex(this)});d&&(e=document.getElementById(d))?f.replaceAll(e):f.appendTo(this.gui_objects.attachmentlist);a=$(this.gui_objects.attachmentlist).attr("data-tabindex")||"0";f.find("a").attr("tabindex",a);return!0};this.remove_from_attachment_list=function(a){this.env.attachments&&(delete this.env.attachments[a],
-$("#"+a).remove())};this.remove_attachment=function(a){a&&this.env.attachments[a]&&this.http_post("remove-attachment",{_id:this.env.compose_id,_file:a});return!0};this.cancel_attachment_upload=function(a,b){if(!a||!b)return!1;this.remove_from_attachment_list(a);$("iframe[name='"+b+"']").remove();return!1};this.upload_progress_start=function(a,b){setTimeout(function(){g.http_request(a,{_progress:b})},1E3*this.env.upload_progress_time)};this.upload_progress_update=function(a){var b=$("#"+a.name+" > span");
-b.length&&a.text&&(b.text(a.text),a.done||this.upload_progress_start(a.action,a.name))};this.add_contact=function(a){a&&this.http_post("addcontact",{_address:a});return!0};this.qsearch=function(a){if(""!=a){var b=this.set_busy(!0,"searching");a=this.search_params(a);var d="compose"==this.env.action&&this.contact_list?"search-contacts":"search";this.message_list?this.clear_message_list():this.contact_list&&this.list_contacts_clear();this.env.source&&(a._source=this.env.source);this.env.group&&(a._gid=
-this.env.group);this.env.current_page=1;a=this.http_request(d,a,b);this.env.qsearch={lock:b,request:a};this.enable_command("set-listmode",this.env.threads&&"base"==(this.env.search_scope||"base"));return!0}return!1};this.continue_search=function(a){var b=this.set_busy(!0,"stillsearching");setTimeout(function(){var d=g.search_params();d._continue=a;g.env.qsearch={lock:b,request:g.http_request("search",d,b)}},100)};this.search_params=function(a,b){var d,e={},f=[],h=this.env.search_mods,g=this.env.search_scope||
-"base",k="all"==g?"*":this.env.mailbox;!b&&this.gui_objects.search_filter&&(b=this.gui_objects.search_filter.value);!a&&this.gui_objects.qsearchbox&&(a=this.gui_objects.qsearchbox.value);b&&(e._filter=b);if(a&&(e._q=a,h&&this.message_list&&(h=h[k]||h["*"]),h)){for(d in h)f.push(d);e._headers=f.join(",")}g&&(e._scope=g);k&&"all"!=g&&(e._mbox=k);return e};this.reset_search_filter=function(){this.filter_disabled=!0;this.gui_objects.search_filter&&$(this.gui_objects.search_filter).val("ALL").change();
-this.filter_disabled=!1};this.reset_qsearch=function(a){this.gui_objects.qsearchbox&&(this.gui_objects.qsearchbox.value="");this.env.qsearch&&this.abort_request(this.env.qsearch);a&&(this.env.search_scope="base",this.reset_search_filter());this.env.qsearch=null;this.env.search_request=null;this.env.search_id=null;this.enable_command("set-listmode",this.env.threads)};this.set_searchscope=function(a){var b=this.env.search_scope;this.env.search_scope=a;a!=b&&this.env.search_request&&(!this.qsearch(this.gui_objects.qsearchbox.value)&&
-this.env.search_filter&&"ALL"!=this.env.search_filter&&this.filter_mailbox(this.env.search_filter),"all"!=a&&this.select_folder(this.env.mailbox,"",!0))};this.set_searchmods=function(a){var b=this.env.mailbox;"all"==(this.env.search_scope||"base")&&(b="*");this.env.search_mods||(this.env.search_mods={});b&&(this.env.search_mods[b]=a)};this.is_multifolder_listing=function(){return void 0!==this.env.multifolder_listing?this.env.multifolder_listing:this.env.search_request&&"base"!=(this.env.search_scope||
-"base")};this.sent_successfully=function(a,b,d,e){this.display_message(b,a);this.compose_skip_unsavedcheck=!0;if(this.env.extwin){e||this.lock_form(this.gui_objects.messageform);var f={task:"mail",action:""};if(f=this.opener(!1,f)||this.opener(!0,f))f.display_message(b,a),d&&0<=$.inArray(f.env.mailbox,d)&&f.command("checkmail");e||setTimeout(function(){window.close()},1E3)}else e||setTimeout(function(){g.list_mailbox()},500);e&&(this.env.is_sent=!0)};this.ksearch_keydown=function(a,b,d){this.ksearch_timer&&
-clearTimeout(this.ksearch_timer);var e=rcube_event.get_keycode(a),f=rcube_event.get_modifier(a);switch(e){case 38:case 40:if(!this.ksearch_visible())return;b=38==e?1:0;e=document.getElementById("rcmkSearchItem"+this.ksearch_selected);e||(e=this.ksearch_pane.__ul.firstChild);e&&this.ksearch_select(b?e.previousSibling:e.nextSibling);return rcube_event.cancel(a);case 9:if(f==SHIFT_KEY||!this.ksearch_visible()){this.ksearch_hide();return}case 13:if(!this.ksearch_visible())return!1;this.insert_recipient(this.ksearch_selected);
-this.ksearch_hide();return rcube_event.cancel(a);case 27:this.ksearch_hide();return;case 37:case 39:return}this.ksearch_timer=setTimeout(function(){g.ksearch_get_results(d)},200);this.ksearch_input=b;return!0};this.ksearch_visible=function(){return null!==this.ksearch_selected&&void 0!==this.ksearch_selected&&this.ksearch_value};this.ksearch_select=function(a){this.ksearch_pane&&a&&this.ksearch_pane.find("li.selected").removeClass("selected").removeAttr("aria-selected");a&&($(a).addClass("selected").attr("aria-selected",
-"true"),this.ksearch_selected=a._rcm_id,$(this.ksearch_input).attr("aria-activedescendant","rcmkSearchItem"+this.ksearch_selected))};this.insert_recipient=function(a){if(null!==a&&this.env.contacts[a]&&this.ksearch_input){var b=this.ksearch_input.value,d=this.get_caret_pos(this.ksearch_input),d=b.lastIndexOf(this.ksearch_value,d),e=!1,f="",h=b.substring(0,d),b=b.substring(d+this.ksearch_value.length,b.length);this.ksearch_destroy();"object"!==typeof this.env.contacts[a]||"group"!=this.env.contacts[a].type||
-this.env.contacts[a].email?"object"===typeof this.env.contacts[a]&&this.env.contacts[a].name?(f=this.env.contacts[a].name+this.env.recipients_delimiter,e=!0):"string"===typeof this.env.contacts[a]&&(f=this.env.contacts[a]+this.env.recipients_delimiter,e=!0):(f+=this.env.contacts[a].name+this.env.recipients_delimiter,this.group2expand[this.env.contacts[a].id]=$.extend({input:this.ksearch_input},this.env.contacts[a]),this.http_request("mail/group-expand",{_source:this.env.contacts[a].source,_gid:this.env.contacts[a].id},
-!1));this.ksearch_input.value=h+f+b;this.set_caret_pos(this.ksearch_input,d+f.length);e&&(this.triggerEvent("autocomplete_insert",{field:this.ksearch_input,insert:f,data:this.env.contacts[a]}),this.compose_type_activity++)}};this.replace_group_recipients=function(a,b){this.group2expand[a]&&(this.group2expand[a].input.value=this.group2expand[a].input.value.replace(this.group2expand[a].name,b),this.triggerEvent("autocomplete_insert",{field:this.group2expand[a].input,insert:b}),this.group2expand[a]=
-null,this.compose_type_activity++)};this.ksearch_get_results=function(a){var b=this.ksearch_input?this.ksearch_input.value:null;if(null!==b){this.ksearch_pane&&this.ksearch_pane.is(":visible")&&this.ksearch_pane.hide();var d=this.get_caret_pos(this.ksearch_input),e=b.lastIndexOf(this.env.recipients_separator,d-1),b=b.substring(e+1,d),e=this.env.autocomplete_min_length,d=this.ksearch_data,b=$.trim(b);b!=this.ksearch_value&&(this.ksearch_destroy(),b.length&&b.length=d.num)&&this.env.contacts&&!this.env.contacts.length||(d=a&&a.sources?a.sources:[""],this.ksearch_data={id:this.multi_thread_http_request({items:d,threads:a&&a.threads?a.threads:1,action:a&&a.action?a.action:"mail/autocomplete",postdata:{_search:b,_source:"%s"},lock:this.display_message(this.get_label("searching"),"loading")}),sources:d.slice(),
-num:d.length})))}};this.ksearch_query_results=function(a,b,d){this.multi_thread_http_response(a,d);if(this.ksearch_value&&(!this.ksearch_input||b==this.ksearch_value)){var e,f,h,m,k,n=this.ksearch_value,l=this.env.autocomplete_max?this.env.autocomplete_max:15;this.ksearch_pane||(b=$("<ul>"),this.ksearch_pane=$("<div>").attr("id","rcmKSearchpane").attr("role","listbox").css({position:"absolute","z-index":3E4}).append(b).appendTo(document.body),this.ksearch_pane.__ul=b[0]);b=this.ksearch_pane.__ul;
-d&&this.ksearch_pane.data("reqid")==d?l-=b.childNodes.length:(this.ksearch_pane.data("reqid",d),b.innerHTML="",this.env.contacts=[],e=$(this.ksearch_input).offset(),this.ksearch_pane.css({left:e.left+"px",top:e.top+this.ksearch_input.offsetHeight+"px",display:"none"}));if(a&&(h=a.length))for(e=0;eh?[]:this.env.address_group_stack.slice(0,h);this.env.group?(this.env.address_group_stack.push(this.env.group),e="G"+a+this.env.address_group_stack[0]):this.gui_objects.addresslist_title&&$(this.gui_objects.addresslist_title).html(this.get_label("contacts"));this.env.search_id||this.select_folder(e,"",!0);if(this.gui_objects.contactslist)this.list_contacts_remote(a,b,d);else{if(e=this.get_frame_window(this.env.contentframe))g=
-e,f._framed=1;b&&(f._gid=b);d&&(f._page=d);a&&(f._source=a);this.env.search_request&&(f._search=this.env.search_request);this.set_busy(!0,"loading");this.location_href(f,g)}};this.list_contacts_remote=function(a,b,d){this.list_contacts_clear();var e={},f=this.set_busy(!0,"loading");a&&(e._source=a);d&&(e._page=d);b&&(e._gid=b);this.env.source=a;this.env.group=b;this.env.search_request&&(e._search=this.env.search_request);this.http_request("mail"==this.env.task?"list-contacts":"list",e,f)};this.list_contacts_clear=
-function(){this.contact_list.data={};this.contact_list.clear(!0);this.show_contentframe(!1);this.enable_command("delete","move","copy","print",!1);this.enable_command("compose",this.env.group)};this.set_group_prop=function(a){if(this.gui_objects.addresslist_title){var b=$(this.gui_objects.addresslist_title).html("");1=--d.count&&d.visible?$(a).parent().children("input").val("").blur():($(a).parents("div.row").remove(),e.children("div.row").length||e.hide());
-f.length&&(a=f.children('option[value="'+b+'"]'),a.length?a.prop("disabled",!1):$("<option>").attr("value",b).html(d.label).appendTo(f),f.show())};this.upload_contact_photo=function(a){a&&a.elements._photo.value&&(this.async_upload_form(a,"upload-photo",function(a){g.set_busy(!1,null,g.file_upload_id)}),this.file_upload_id=this.set_busy(!0,"uploading"))};this.replace_contact_photo=function(a){var b="-del-"==a?this.env.photo_placeholder:this.env.comm_path+"&_action=photo&_source="+this.env.source+
-"&_cid="+(this.env.cid||0)+"&_photo="+a;this.set_photo_actions(a);$(this.gui_objects.contactphoto).children("img").attr("src",b)};this.photo_upload_end=function(){this.set_busy(!1,null,this.file_upload_id);delete this.file_upload_id};this.set_photo_actions=function(a){var b,d=this.buttons["upload-photo"];for(b=0;d&&bthis.env.identities_level),this.load_identity(b,"edit-identity")};this.load_identity=function(a,b){if("edit-identity"==b&&(!a||a==this.env.iid))return!1;var d,e=window,f={_action:b,_iid:a};if(d=this.get_frame_window(this.env.contentframe))f._framed=1,e=d;(a||"add-identity"==b)&&this.location_href(f,e,!0);return!0};this.delete_identity=function(a){var b=
-this.identity_list.get_selection();if(b.length||this.env.iid)a||(a=this.env.iid?this.env.iid:b[0]),a&&confirm(this.get_label("deleteidentityconfirm"))&&this.http_post("settings/delete-identity",{_iid:a},!0)};this.update_identity_row=function(a,b,d){var e=this.identity_list;a=this.html_identifier(a);d?(e.insert_row({id:"rcmrow"+a,cols:[{className:"mail",innerHTML:b}]}),e.select(a)):e.update_row(a,[b])};this.update_response_row=function(a,b){var d=this.responses_list;d&&b?d.update_row(b,[a.name],a.key,
-!0):d&&(d.insert_row({id:"rcmrow"+a.key,cols:[{className:"name",innerHTML:a.name}]}),d.select(a.key))};this.remove_response=function(a){var b;this.env.textresponses&&delete this.env.textresponses[a];this.responses_list&&(this.responses_list.remove_row(a),this.env.contentframe&&(b=this.get_frame_window(this.env.contentframe))&&(b.location.href=this.env.blankpage));this.enable_command("delete",!1)};this.remove_identity=function(a){var b,d=this.identity_list,e=this.html_identifier(a);d&&a&&(d.remove_row(e),
-this.env.contentframe&&(b=this.get_frame_window(this.env.contentframe))&&(b.location.href=this.env.blankpage));this.enable_command("delete",!1)};this.init_subscription_list=function(){var a=RegExp.escape(this.env.delimiter);this.last_sub_rx=RegExp("["+a+"]?[^"+a+"]+$");this.subscription_list=new rcube_treelist_widget(this.gui_objects.subscriptionlist,{selectable:!0,tabexit:!1,parent_focus:!0,id_prefix:"rcmli",id_encode:this.html_identifier_encode,id_decode:this.html_identifier_decode,searchbox:"#foldersearch"});
-this.subscription_list.addEventListener("select",function(a){g.subscription_select(a.id)}).addEventListener("collapse",function(a){g.folder_collapsed(a)}).addEventListener("expand",function(a){g.folder_collapsed(a)}).addEventListener("search",function(a){a.query&&g.subscription_select()}).draggable({cancel:"li.mailbox.root"}).droppable({accept:function(a){if(!$(a).is(".mailbox"))return!1;a=g.folder_id2name($(a).attr("id"));var d=g.folder_id2name(this.id),e=g.env.subscriptionrows[a];return e&&!e[2]&&
-d!=a.replace(g.last_sub_rx,"")&&!d.startsWith(a+g.env.delimiter)},drop:function(a,d){var e=g.folder_id2name(d.draggable.attr("id")),f=g.folder_id2name(this.id);g.subscription_move_folder(e,f)}})};this.folder_id2name=function(a){return a?g.html_identifier_decode(a.replace(/^rcmli/,"")):null};this.subscription_select=function(a){var b;a&&"*"!=a&&(b=this.env.subscriptionrows[a])?(this.env.mailbox=a,this.show_folder(a),this.enable_command("delete-folder",!b[2])):(this.env.mailbox=null,this.show_contentframe(!1),
-this.enable_command("delete-folder","purge",!1))};this.subscription_move_folder=function(a,b){if(a&&null!==b&&a!=b&&b!=a.replace(this.last_sub_rx,"")){var d=a.split(this.env.delimiter).pop(),d=""===b||"*"===b?d:b+this.env.delimiter+d;d!=a&&this.http_post("rename-folder",{_folder_oldname:a,_folder_newname:d},this.set_busy(!0,"foldermoving"))}};this.create_folder=function(){this.show_folder("",this.env.mailbox)};this.delete_folder=function(a){a||(a=this.env.mailbox);a&&confirm(this.get_label("deletefolderconfirm"))&&
-this.http_post("delete-folder",{_mbox:a},this.set_busy(!0,"folderdeleting"))};this.add_folder_row=function(a,b,d,e,f,h,m,k){if(!this.gui_objects.subscriptionlist)return!1;this.subscription_list.is_search()&&(this.subscription_select(),this.subscription_list.reset_search());this.subscription_list.draggable("destroy").droppable("destroy");var n,l,p,q,v,s="",t=[],w=[],u=[],x=$(this.gui_objects.subscriptionlist);n=m?m:$($("li",x).get(1)).clone(!0);if(!n.length)return this.goto_url("folders"),!1;n.attr({id:"rcmli"+
-this.html_identifier_encode(a),"class":h});m&&m.length||($("ul,div.treetoggle",n).remove(),n.removeData("filtered"));$("a:first",n).text(d);$('input[name="_subscribed[]"]:first',n).val(a).prop({checked:f?!0:!1,disabled:e?!0:!1});this.env.subscriptionrows[a]=[b,d,!1];$.each(this.env.subscriptionrows,function(a,b){b[3]=a;t.push(b)});try{v=new Intl.Collator(this.env.locale.replace("_","-"))}catch(y){}t.sort(function(a,b){var d,e,f,h=a[0].split(g.env.delimiter),m=b[0].split(g.env.delimiter),k=h.length;
-for(d=0;da.percent)&&this.display_message(a.label,"uploading",0,"progress"+a.name)}};this.show_popup_dialog=function(a,b,d,e){if(this.is_framed())return parent.rcmail.show_popup_dialog(a,
-b,d,e);var f=$('<div class="popup">');"object"==typeof a?f.append(a):f.html(a);e=$.extend({title:b,buttons:d,modal:!0,resizable:!0,width:500,close:function(a,b){$(this).remove()}},e||{});f.dialog(e);b=$(window);a=b.width();b=b.height();var h=f.width(),g=f.height();f.dialog("option",{height:Math.min(b-40,g+75+(d?50:0)),width:Math.min(a-20,h+36)});$.each(e.button_classes||[],function(a,b){b&&$($(".ui-dialog-buttonpane button.ui-button",f.parent()).get(a)).addClass(b)});return f};this.set_page_buttons=
-function(){this.enable_command("nextpage","lastpage",this.env.pagecount>this.env.current_page);this.enable_command("previouspage","firstpage",1$.inArray("folder",this.env.listcols)),e.init_header())};this.set_rowcount=function(a,b){if(b&&b!=this.env.mailbox)return!1;$(this.gui_objects.countdisplay).html(a);this.set_page_buttons()};this.set_mailboxname=function(a){this.gui_objects.mailboxname&&a&&(this.gui_objects.mailboxname.innerHTML=a)};this.set_quota=function(a){this.gui_objects.quotadisplay&&a&&"text"==a.type&&$(this.gui_objects.quotadisplay).text((a.percent||0)+"%").attr("title",a.title);this.triggerEvent("setquota",a);this.env.quota_content=
-a};this.set_trash_count=function(a){this[(a?"un":"")+"mark_folder"](this.env.trash_mailbox,"empty","",!0)};this.set_unread_count=function(a,b,d,e){if(!this.gui_objects.mailboxlist)return!1;this.env.unread_counts[a]=b;this.set_unread_count_display(a,d);e?this.mark_folder(a,e,"",!0):b||this.unmark_folder(a,"recent","",!0)};this.set_unread_count_display=function(a,b){var d,e,f,g,m;if(f=this.get_folder_li(a,"",!0)){g=this.env.unread_counts[a]?this.env.unread_counts[a]:0;e=$(f).children("a").eq(0);d=e.children("span.unreadcount");
-!d.length&&g&&(d=$("<span>").addClass("unreadcount").appendTo(e));e=0;if((m=f.getElementsByTagName("div")[0])&&m.className.match(/collapsed/))for(var k in this.env.unread_counts)k.startsWith(a+this.env.delimiter)&&(e+=this.env.unread_counts[k]);g&&d.length?d.html(this.env.unreadwrap.replace(/%[sd]/,g)):d.length&&d.remove();d=RegExp(RegExp.escape(this.env.delimiter)+"[^"+RegExp.escape(this.env.delimiter)+"]+$");a.match(d)&&this.set_unread_count_display(a.replace(d,""),!1);0