Merge branch 'master' of github.com:roundcube/roundcubemail

pull/24/merge
Thomas Bruederli 12 years ago
commit ba3cd80c0c

@ -1,19 +1,26 @@
CHANGELOG Roundcube Webmail
===========================
- Fix line separator in exported messages (#1488603)
- Fix XSS issue where plain signatures wasn't secured in HTML mode (#1488613)
- Fix XSS issue where href="javascript:" wasn't secured (#1488613)
- Fix impossible to create message with empty plain text part (#1488610)
- Fix stripped apostrophes when replying in plain text to HTML message (#1488606)
- Fix inactive Save search option after advanced search (#1488607)
- Fix Remove from group option is active for contact search result (#1488608)
- Disable autocapitalization in login form on iPad/iPhone (#1488609)
- Fix focus on the list when list row is clicked (#1488600)
- Added separate From and To columns apart from smart From/To column (#1486891)
- Fix fallback to Larry skin when configured skin isn't available (#1488591)
- Fix (workaround) delete operations with some versions of memcache (#1488592)
- Fix (disable) request validation for spell and spell_html actions
- Fix focus issue in IE when selecting message row (#1488620)
- Remove (too big) min-width on mail screen
- Add full headers view in message preview window (#1488538)
- Fix message display page issues - unified with message preview (#1488590, #1488642)
- Fix displaying all headers when they contain malformed characters (#1488666)
- Fix decoding of HTML messages with UTF-16 charset specified (#1488654)
- Fix quota capability detection so it can be overwritten by a plugin (#1488655)
- Added template object 'frame'
- Fix identity selection on reply (#1488101)
- Add option to enable HTML editor on forwarding (#1488517)
- Add option to not include original message on reply, rename option top_posting to reply_mode (#1485149)
- Fix Larry's messages list filter in IE (#1488632)
- Fix more IE issues by disabling Compat. mode with X-UA-Compatible meta tag (#1488626)
- Fix setting locales under Solaris - use additional .UTF-8 suffix (#1488628)
- Fix email address validation for addresses with IP address in domain part
- Fix Larry skin issues in IE7 compat. mode (#1488618)
- Fix so subscribed non-existing/non-accessible shared folder can be unsubscribed
- Added session_path config option and unified cookies settings in javascript
- Added "Undeleted" option to messages list filter
- Rewritten test scripts for PHPUnit
- Add new DB abstraction layer based on PHP PDO, supporting SQLite3 (#1488332)
- Removed PEAR::MDB2 package
- Removed users.alias column, added option ('user_aliases')
@ -39,6 +46,24 @@ CHANGELOG Roundcube Webmail
Move global functions from main.inc and rcube_shared.inc into classes
Better classes separation
RELEASE 0.8.1
-------------
- Fix bug where domain name was converted to lower-case even with login_lc=false (#1488593)
- Fix lower-casing email address on replies (#1488598)
- Fix line separator in exported messages (#1488603)
- Fix XSS issue where plain signatures wasn't secured in HTML mode (#1488613)
- Fix XSS issue where href="javascript:" wasn't secured (#1488613)
- Fix impossible to create message with empty plain text part (#1488610)
- Fix stripped apostrophes when replying in plain text to HTML message (#1488606)
- Fix inactive Save search option after advanced search (#1488607)
- Fix Remove from group option is active for contact search result (#1488608)
- Disable autocapitalization in login form on iPad/iPhone (#1488609)
- Fix focus on the list when list row is clicked (#1488600)
- Added separate From and To columns apart from smart From/To column (#1486891)
- Fix fallback to Larry skin when configured skin isn't available (#1488591)
- Fix (workaround) delete operations with some versions of memcache (#1488592)
- Fix (disable) request validation for spell and spell_html actions
RELEASE 0.8.0
-------------
- Don't show product version on login screen (can be enabled by config)

@ -21,7 +21,7 @@ $rcmail_config = array();
// LOGGING/DEBUGGING
// ----------------------------------
// system error reporting: 1 = log; 2 = report (not implemented yet), 4 = show, 8 = trace
// system error reporting, sum of: 1 = log; 4 = show, 8 = trace
$rcmail_config['debug_level'] = 1;
// log driver: 'syslog' or 'file'.
@ -224,11 +224,12 @@ $rcmail_config['use_https'] = false;
// 0 - disabled, 1 - username and host only, 2 - username, host, password
$rcmail_config['login_autocomplete'] = 0;
// If users authentication is not case sensitive this must be enabled.
// You can also use it to force conversion of logins to lower case.
// Forces conversion of logins to lower case.
// 0 - disabled, 1 - only domain part, 2 - domain and local part.
// If users authentication is not case-sensitive this must be enabled.
// After enabling it all user records need to be updated, e.g. with query:
// UPDATE users SET username = LOWER(username);
$rcmail_config['login_lc'] = false;
$rcmail_config['login_lc'] = 0;
// Includes should be interpreted as PHP files
$rcmail_config['skin_include_php'] = false;
@ -240,12 +241,15 @@ $rcmail_config['display_version'] = false;
// must be greater than 'keep_alive'/60
$rcmail_config['session_lifetime'] = 10;
// session domain: .example.org
// Session domain: .example.org
$rcmail_config['session_domain'] = '';
// session name. Default: 'roundcube_sessid'
// Session name. Default: 'roundcube_sessid'
$rcmail_config['session_name'] = null;
// Session path. Defaults to PHP session.cookie_path setting.
$rcmail_config['session_path'] = null;
// Backend to use for session storage. Can either be 'db' (default) or 'memcache'
// If set to memcache, a list of servers need to be specified in 'memcache_hosts'
// Make sure the Memcache extension (http://pecl.php.net/package/memcache) version >= 2.0.0 is installed
@ -721,7 +725,7 @@ $rcmail_config['prefer_html'] = true;
$rcmail_config['show_images'] = 0;
// compose html formatted messages by default
// 0 - never, 1 - always, 2 - on reply to HTML message only
// 0 - never, 1 - always, 2 - on reply to HTML message, 3 - on forward or reply to HTML message
$rcmail_config['htmleditor'] = 0;
// show pretty dates as standard
@ -779,8 +783,11 @@ $rcmail_config['display_next'] = true;
// 2 - Expand only threads with unread messages
$rcmail_config['autoexpand_threads'] = 0;
// When replying place cursor above original message (top posting)
$rcmail_config['top_posting'] = false;
// When replying:
// -1 - don't cite the original message
// 0 - place cursor below the original message
// 1 - place cursor above original message (top posting)
$rcmail_config['reply_mode'] = 0;
// When replying strip original signature from message
$rcmail_config['strip_existing_sig'] = true;

@ -35,13 +35,14 @@ class rcube_install
var $obsolete_config = array('db_backend', 'double_auth');
var $replaced_config = array(
'skin_path' => 'skin',
'locale_string' => 'language',
'multiple_identities' => 'identities_level',
'skin_path' => 'skin',
'locale_string' => 'language',
'multiple_identities' => 'identities_level',
'addrbook_show_images' => 'show_images',
'imap_root' => 'imap_ns_personal',
'pagesize' => 'mail_pagesize',
'imap_root' => 'imap_ns_personal',
'pagesize' => 'mail_pagesize',
'default_imap_folders' => 'default_folders',
'top_posting' => 'reply_mode',
);
// these config options are required for a working system

@ -233,8 +233,7 @@ class acl extends rcube_plugin
// Advanced rights
$attrib['id'] = 'advancedrights';
foreach ($supported as $val) {
$id = "acl$val";
foreach ($supported as $idx => $val) {
$ul .= html::tag('li', null,
$input->show('', array(
'name' => "acl[$val]", 'value' => $val, 'id' => $id))

@ -123,3 +123,7 @@
{
margin-left: 0.5em;
}
ul.toolbarmenu li span.delete {
background-position: 0 -1509px;
}

@ -3,14 +3,14 @@
<roundcube:object name="acltable" id="acltable" class="records-table" />
</div>
<div id="acllist-footer" class="boxfooter">
<roundcube:button command="acl-create" id="aclcreatelink" type="link" title="acl.newuser" class="listbutton add disabled" classAct="listbutton add" innerClass="inner" content="+" /><roundcube:button name="aclmenulink" id="aclmenulink" type="link" title="acl.actions" class="listbutton groupactions"onclick="UI.show_popup('aclmenu');return false" innerClass="inner" content="&#9881;" />
<roundcube:button command="acl-create" id="aclcreatelink" type="link" title="acl.newuser" class="listbutton add disabled" classAct="listbutton add" innerClass="inner" content="+" /><roundcube:button name="aclmenulink" id="aclmenulink" type="link" title="acl.actions" class="listbutton groupactions"onclick="UI.show_popup('aclmenu', undefined, {above:1});return false" innerClass="inner" content="&#9881;" />
</div>
</div>
<div id="aclmenu" class="popupmenu">
<ul class="toolbarmenu selectable">
<li><roundcube:button command="acl-edit" label="edit" classAct="active" /></li>
<li><roundcube:button command="acl-delete" label="delete" classAct="active" /></li>
<ul class="toolbarmenu selectable iconized">
<li><roundcube:button command="acl-edit" label="edit" class="icon" classAct="icon active" innerclass="icon edit" /></li>
<li><roundcube:button command="acl-delete" label="delete" class="icon" classAct="icon active" innerclass="icon delete" /></li>
<roundcube:if condition="!in_array('acl_advanced_mode', (array)config:dont_override)" />
<li><roundcube:button name="acl-switch" id="acl-switch" label="acl.advanced" onclick="rcmail.command('acl-mode-switch')" class="active" /></li>
<roundcube:endif />

@ -27,11 +27,7 @@ class hide_blockquote extends rcube_plugin
&& ($limit = $rcmail->config->get('hide_blockquote_limit'))
) {
// include styles
$skin = $rcmail->config->get('skin');
if (!file_exists($this->home."/skins/$skin/style.css")) {
$skin = 'default';
}
$this->include_stylesheet("skins/$skin/style.css");
$this->include_stylesheet($this->local_skin_path() . "/style.css");
// Script and localization
$this->include_script('hide_blockquote.js');

@ -1,7 +0,0 @@
clean:
rm -f *.log *.php *.diff *.exp *.out
test:
pear run-tests *.phpt

@ -0,0 +1,54 @@
<?php
class Parser extends PHPUnit_Framework_TestCase
{
function setUp()
{
include_once dirname(__FILE__) . '/../lib/rcube_sieve_script.php';
}
/**
* Sieve script parsing
*
* @dataProvider data_parser
*/
function test_parser($input, $output, $message)
{
$script = new rcube_sieve_script($input);
$result = $script->as_text();
$this->assertEquals(trim($result), trim($output), $message);
}
/**
* Data provider for test_parser()
*/
function data_parser()
{
$dir_path = realpath(dirname(__FILE__) . '/src');
$dir = opendir($dir_path);
$result = array();
while ($file = readdir($dir)) {
if (preg_match('/^[a-z0-9_]+$/', $file)) {
$input = file_get_contents($dir_path . '/' . $file);
if (file_exists($dir_path . '/' . $file . '.out')) {
$output = file_get_contents($dir_path . '/' . $file . '.out');
}
else {
$output = $input;
}
$result[] = array(
'input' => $input,
'output' => $output,
'message' => "Error in parsing '$file' file",
);
}
}
return $result;
}
}

@ -0,0 +1,33 @@
<?php
class Tokenizer extends PHPUnit_Framework_TestCase
{
function setUp()
{
include_once dirname(__FILE__) . '/../lib/rcube_sieve_script.php';
}
function data_tokenizer()
{
return array(
array(1, "text: #test\nThis is test ; message;\nMulti line\n.\n;\n", '"This is test ; message;\nMulti line"'),
array(0, '["test1","test2"]', '[["test1","test2"]]'),
array(1, '["test"]', '["test"]'),
array(1, '"te\\"st"', '"te\\"st"'),
array(0, 'test #comment', '["test"]'),
array(0, "text:\ntest\n.\ntext:\ntest\n.\n", '["test","test"]'),
array(1, '"\\a\\\\\\"a"', '"a\\\\\\"a"'),
);
}
/**
* @dataProvider data_tokenizer
*/
function test_tokenizer($num, $input, $output)
{
$res = json_encode(rcube_sieve_script::tokenize($input, $num));
$this->assertEquals(trim($res), trim($output));
}
}

@ -1,120 +0,0 @@
--TEST--
Main test of script parser
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt = '
require ["fileinto","reject","envelope"];
# rule:[spam]
if anyof (header :contains "X-DSPAM-Result" "Spam")
{
fileinto "Spam";
stop;
}
# rule:[test1]
if anyof (header :comparator "i;ascii-casemap" :contains ["From","To"] "test@domain.tld")
{
discard;
stop;
}
# rule:[test2]
if anyof (not header :comparator "i;octet" :contains ["Subject"] "[test]", header :contains "Subject" "[test2]")
{
fileinto "test";
stop;
}
# rule:[comments]
if anyof (true) /* comment
* "comment" #comment */ {
/* comment */ stop;
# comment
}
# rule:[reject]
if size :over 5000K {
reject "Message over 5MB size limit. Please contact me before sending this.";
}
# rule:[false]
if false # size :over 5000K
{
stop; /* rule disabled */
}
# rule:[true]
if true
{
stop;
}
fileinto "Test";
# rule:[address test]
if address :all :is "From" "nagios@domain.tld"
{
fileinto "domain.tld";
stop;
}
# rule:[envelope test]
if envelope :domain :is "From" "domain.tld"
{
fileinto "domain.tld";
stop;
}
';
$s = new rcube_sieve_script($txt);
echo $s->as_text();
// -------------------------------------------------------------------------------
?>
--EXPECT--
require ["fileinto","reject","envelope"];
# rule:[spam]
if header :contains "X-DSPAM-Result" "Spam"
{
fileinto "Spam";
stop;
}
# rule:[test1]
if header :contains ["From","To"] "test@domain.tld"
{
discard;
stop;
}
# rule:[test2]
if anyof (not header :comparator "i;octet" :contains "Subject" "[test]", header :contains "Subject" "[test2]")
{
fileinto "test";
stop;
}
# rule:[comments]
if true
{
stop;
}
# rule:[reject]
if size :over 5000K
{
reject "Message over 5MB size limit. Please contact me before sending this.";
}
# rule:[false]
if false # size :over 5000K
{
stop;
}
# rule:[true]
if true
{
stop;
}
fileinto "Test";
# rule:[address test]
if address :all :is "From" "nagios@domain.tld"
{
fileinto "domain.tld";
stop;
}
# rule:[envelope test]
if envelope :domain :is "From" "domain.tld"
{
fileinto "domain.tld";
stop;
}

@ -1,49 +0,0 @@
--TEST--
Test of Sieve body extension (RFC5173)
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt = '
require ["body","fileinto"];
if body :raw :contains "MAKE MONEY FAST"
{
stop;
}
if body :content "text" :contains ["missile","coordinates"]
{
fileinto "secrets";
}
if body :content "audio/mp3" :contains ""
{
fileinto "jukebox";
}
if body :text :contains "project schedule"
{
fileinto "project/schedule";
}
';
$s = new rcube_sieve_script($txt);
echo $s->as_text();
?>
--EXPECT--
require ["body","fileinto"];
if body :raw :contains "MAKE MONEY FAST"
{
stop;
}
if body :content "text" :contains ["missile","coordinates"]
{
fileinto "secrets";
}
if body :content "audio/mp3" :contains ""
{
fileinto "jukebox";
}
if body :text :contains "project schedule"
{
fileinto "project/schedule";
}

@ -1,28 +0,0 @@
--TEST--
Test of Sieve vacation extension (RFC5232)
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt = '
require ["imapflags"];
# rule:[imapflags]
if header :matches "Subject" "^Test$" {
setflag "\\\\Seen";
addflag ["\\\\Answered","\\\\Deleted"];
}
';
$s = new rcube_sieve_script($txt, array('imapflags'));
echo $s->as_text();
?>
--EXPECT--
require ["imapflags"];
# rule:[imapflags]
if header :matches "Subject" "^Test$"
{
setflag "\\Seen";
addflag ["\\Answered","\\Deleted"];
}

@ -1,30 +0,0 @@
--TEST--
Test of Sieve include extension
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt = '
require ["include"];
include "script.sieve";
# rule:[two]
if true
{
include :optional "second.sieve";
}
';
$s = new rcube_sieve_script($txt, array(), array('variables'));
echo $s->as_text();
?>
--EXPECT--
require ["include"];
include "script.sieve";
# rule:[two]
if true
{
include :optional "second.sieve";
}

@ -1,19 +0,0 @@
--TEST--
Test of Kolab's KEP:14 implementation
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt = '
# EDITOR Roundcube
# EDITOR_VERSION 123
';
$s = new rcube_sieve_script($txt, array('body'));
echo $s->as_text();
?>
--EXPECT--
# EDITOR Roundcube
# EDITOR_VERSION 123

@ -1,25 +0,0 @@
--TEST--
Test of prefix comments handling
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt = '
# this is a comment
# and the second line
require ["variables"];
set "b" "c";
';
$s = new rcube_sieve_script($txt, array(), array('variables'));
echo $s->as_text();
?>
--EXPECT--
# this is a comment
# and the second line
require ["variables"];
set "b" "c";

@ -1,25 +0,0 @@
--TEST--
Test of Sieve relational extension (RFC5231)
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt = '
require ["relational","comparator-i;ascii-numeric"];
# rule:[redirect]
if header :value "ge" :comparator "i;ascii-numeric"
["X-Spam-score"] ["14"] {redirect "test@test.tld";}
';
$s = new rcube_sieve_script($txt);
echo $s->as_text();
?>
--EXPECT--
require ["relational","comparator-i;ascii-numeric"];
# rule:[redirect]
if header :value "ge" :comparator "i;ascii-numeric" "X-Spam-score" "14"
{
redirect "test@test.tld";
}

@ -1,39 +0,0 @@
--TEST--
Test of Sieve vacation extension (RFC5230)
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt = '
require ["vacation"];
# rule:[test-vacation]
if anyof (header :contains "Subject" "vacation")
{
vacation :days 1 text:
# test
test test /* test */
test
.
;
stop;
}
';
$s = new rcube_sieve_script($txt);
echo $s->as_text();
?>
--EXPECT--
require ["vacation"];
# rule:[test-vacation]
if header :contains "Subject" "vacation"
{
vacation :days 1 text:
# test
test test /* test */
test
.
;
stop;
}

@ -1,39 +0,0 @@
--TEST--
Test of Sieve variables extension
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt = '
require ["variables"];
set "honorific" "Mr";
set "vacation" text:
Dear ${HONORIFIC} ${last_name},
I am out, please leave a message after the meep.
.
;
set :length "b" "${a}";
set :lower "b" "${a}";
set :upperfirst "b" "${a}";
set :upperfirst :lower "b" "${a}";
set :quotewildcard "b" "Rock*";
';
$s = new rcube_sieve_script($txt, array(), array('variables'));
echo $s->as_text();
?>
--EXPECT--
require ["variables"];
set "honorific" "Mr";
set "vacation" text:
Dear ${HONORIFIC} ${last_name},
I am out, please leave a message after the meep.
.
;
set :length "b" "${a}";
set :lower "b" "${a}";
set :upperfirst "b" "${a}";
set :upperfirst :lower "b" "${a}";
set :quotewildcard "b" "Rock*";

@ -1,38 +0,0 @@
--TEST--
Test of Sieve subaddress extension (RFC5233)
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt = '
require ["envelope","subaddress","fileinto"];
if envelope :user "To" "postmaster"
{
fileinto "postmaster";
stop;
}
if envelope :detail :is "To" "mta-filters"
{
fileinto "mta-filters";
stop;
}
';
$s = new rcube_sieve_script($txt);
echo $s->as_text();
// -------------------------------------------------------------------------------
?>
--EXPECT--
require ["envelope","subaddress","fileinto"];
if envelope :user "To" "postmaster"
{
fileinto "postmaster";
stop;
}
if envelope :detail :is "To" "mta-filters"
{
fileinto "mta-filters";
stop;
}

@ -0,0 +1,52 @@
require ["fileinto","reject","envelope"];
# rule:[spam]
if anyof (header :contains "X-DSPAM-Result" "Spam")
{
fileinto "Spam";
stop;
}
# rule:[test1]
if anyof (header :comparator "i;ascii-casemap" :contains ["From","To"] "test@domain.tld")
{
discard;
stop;
}
# rule:[test2]
if anyof (not header :comparator "i;octet" :contains ["Subject"] "[test]", header :contains "Subject" "[test2]")
{
fileinto "test";
stop;
}
# rule:[comments]
if anyof (true) /* comment
* "comment" #comment */ {
/* comment */ stop;
# comment
}
# rule:[reject]
if size :over 5000K {
reject "Message over 5MB size limit. Please contact me before sending this.";
}
# rule:[false]
if false # size :over 5000K
{
stop; /* rule disabled */
}
# rule:[true]
if true
{
stop;
}
fileinto "Test";
# rule:[address test]
if address :all :is "From" "nagios@domain.tld"
{
fileinto "domain.tld";
stop;
}
# rule:[envelope test]
if envelope :domain :is "From" "domain.tld"
{
fileinto "domain.tld";
stop;
}

@ -0,0 +1,52 @@
require ["fileinto","reject","envelope"];
# rule:[spam]
if header :contains "X-DSPAM-Result" "Spam"
{
fileinto "Spam";
stop;
}
# rule:[test1]
if header :contains ["From","To"] "test@domain.tld"
{
discard;
stop;
}
# rule:[test2]
if anyof (not header :comparator "i;octet" :contains "Subject" "[test]", header :contains "Subject" "[test2]")
{
fileinto "test";
stop;
}
# rule:[comments]
if true
{
stop;
}
# rule:[reject]
if size :over 5000K
{
reject "Message over 5MB size limit. Please contact me before sending this.";
}
# rule:[false]
if false # size :over 5000K
{
stop;
}
# rule:[true]
if true
{
stop;
}
fileinto "Test";
# rule:[address test]
if address :all :is "From" "nagios@domain.tld"
{
fileinto "domain.tld";
stop;
}
# rule:[envelope test]
if envelope :domain :is "From" "domain.tld"
{
fileinto "domain.tld";
stop;
}

@ -0,0 +1,17 @@
require ["body","fileinto"];
if body :raw :contains "MAKE MONEY FAST"
{
stop;
}
if body :content "text" :contains ["missile","coordinates"]
{
fileinto "secrets";
}
if body :content "audio/mp3" :contains ""
{
fileinto "jukebox";
}
if body :text :contains "project schedule"
{
fileinto "project/schedule";
}

@ -0,0 +1,7 @@
require ["imap4flags"];
# rule:[imapflags]
if header :matches "Subject" "^Test$"
{
setflag "\\Seen";
addflag ["\\Answered","\\Deleted"];
}

@ -0,0 +1,7 @@
require ["include"];
include "script.sieve";
# rule:[two]
if true
{
include :optional "second.sieve";
}

@ -0,0 +1,2 @@
# EDITOR Roundcube
# EDITOR_VERSION 123

@ -0,0 +1,3 @@
require ["variables"];
set "EDITOR" "Roundcube";
set "EDITOR_VERSION" "123";

@ -0,0 +1,5 @@
# this is a comment
# and the second line
require ["variables"];
set "b" "c";

@ -0,0 +1,6 @@
require ["relational","comparator-i;ascii-numeric"];
# rule:[redirect]
if header :value "ge" :comparator "i;ascii-numeric" "X-Spam-score" "14"
{
redirect "test@test.tld";
}

@ -0,0 +1,11 @@
require ["envelope","subaddress","fileinto"];
if envelope :user "To" "postmaster"
{
fileinto "postmaster";
stop;
}
if envelope :detail :is "To" "mta-filters"
{
fileinto "mta-filters";
stop;
}

@ -0,0 +1,12 @@
require ["vacation"];
# rule:[test-vacation]
if header :contains "Subject" "vacation"
{
vacation :days 1 text:
# test
test test /* test */
test
.
;
stop;
}

@ -0,0 +1,12 @@
require ["variables"];
set "honorific" "Mr";
set "vacation" text:
Dear ${HONORIFIC} ${last_name},
I am out, please leave a message after the meep.
.
;
set :length "b" "${a}";
set :lower "b" "${a}";
set :upperfirst "b" "${a}";
set :upperfirst :lower "b" "${a}";
set :quotewildcard "b" "Rock*";

@ -1,66 +0,0 @@
--TEST--
Script parsing: tokenizer
--SKIPIF--
--FILE--
<?php
include '../lib/rcube_sieve_script.php';
$txt[1] = array(1, 'text: #test
This is test ; message;
Multi line
.
;
');
$txt[2] = array(0, '["test1","test2"]');
$txt[3] = array(1, '["test"]');
$txt[4] = array(1, '"te\\"st"');
$txt[5] = array(0, 'test #comment');
$txt[6] = array(0, 'text:
test
.
text:
test
.
');
$txt[7] = array(1, '"\\a\\\\\\"a"');
foreach ($txt as $idx => $t) {
echo "[$idx]---------------\n";
var_dump(rcube_sieve_script::tokenize($t[1], $t[0]));
}
?>
--EXPECT--
[1]---------------
string(34) "This is test ; message;
Multi line"
[2]---------------
array(1) {
[0]=>
array(2) {
[0]=>
string(5) "test1"
[1]=>
string(5) "test2"
}
}
[3]---------------
array(1) {
[0]=>
string(4) "test"
}
[4]---------------
string(5) "te"st"
[5]---------------
array(1) {
[0]=>
string(4) "test"
}
[6]---------------
array(2) {
[0]=>
string(4) "test"
[1]=>
string(4) "test"
}
[7]---------------
string(4) "a\"a"

@ -48,6 +48,10 @@ class rcube_virtualmin_password
$pieces = explode("_", $username);
$domain = $pieces[0];
break;
case 8: // domain taken from alias, username left as it was
$email = $rcmail->user->data['alias'];
$domain = substr(strrchr($email, "@"), 1);
break;
default: // username@domain
$domain = substr(strrchr($username, "@"), 1);
}

@ -14,8 +14,11 @@
*
* $rcmail_config['virtuser_query'] = array('email' => '', 'user' => '', 'host' => '');
*
* The email query can return more than one record to create more identities.
* This requires identities_level option to be set to value less than 2.
*
* @version @package_version@
* @author Aleksander Machniak
* @author Aleksander Machniak <alec@alec.pl>
* @author Steffen Vogel
*/
class virtuser_query extends rcube_plugin

@ -154,7 +154,7 @@ class html
$attr = array('src' => $attr);
}
return self::tag('img', $attr + array('alt' => ''), null, array_merge(self::$common_attrib,
array('src','alt','width','height','border','usemap','onclick')));
array('src','alt','width','height','border','usemap','onclick')));
}
/**

@ -157,14 +157,16 @@ class rcmail extends rcube
$this->config->set_user_prefs((array)$this->user->get_prefs());
}
$_SESSION['language'] = $this->user->language = $this->language_prop($this->config->get('language', $_SESSION['language']));
$lang = $this->language_prop($this->config->get('language', $_SESSION['language']));
$_SESSION['language'] = $this->user->language = $lang;
// set localization
setlocale(LC_ALL, $_SESSION['language'] . '.utf8', 'en_US.utf8');
setlocale(LC_ALL, $lang . '.utf8', $lang . '.UTF-8', 'en_US.utf8', 'en_US.UTF-8');
// workaround for http://bugs.php.net/bug.php?id=18556
if (in_array($_SESSION['language'], array('tr_TR', 'ku', 'az_AZ')))
setlocale(LC_CTYPE, 'en_US' . '.utf8');
if (in_array($lang, array('tr_TR', 'ku', 'az_AZ'))) {
setlocale(LC_CTYPE, 'en_US.utf8', 'en_US.UTF-8');
}
}
@ -306,7 +308,7 @@ class rcmail extends rcube
/**
* Init output object for GUI and add common scripts.
* This will instantiate a rcmail_template object and set
* This will instantiate a rcube_output_html object and set
* environment vars according to the current session and configuration
*
* @param boolean True if this request is loaded in a (i)frame
@ -453,7 +455,14 @@ class rcmail extends rcube
// Convert username to lowercase. If storage backend
// is case-insensitive we need to store always the same username (#1487113)
if ($config['login_lc']) {
$username = mb_strtolower($username);
if ($config['login_lc'] == 2 || $config['login_lc'] === true) {
$username = mb_strtolower($username);
}
else if (strpos($username, '@')) {
// lowercase domain name
list($local, $domain) = explode('@', $username);
$username = $local . '@' . mb_strtolower($domain);
}
}
// try to resolve email address from virtuser table
@ -463,17 +472,13 @@ class rcmail extends rcube
// Here we need IDNA ASCII
// Only rcube_contacts class is using domain names in Unicode
$host = rcube_utils::idn_to_ascii($host);
if (strpos($username, '@')) {
// lowercase domain name
list($local, $domain) = explode('@', $username);
$username = $local . '@' . mb_strtolower($domain);
$username = rcube_utils::idn_to_ascii($username);
}
$host = rcube_utils::idn_to_ascii($host);
$username = rcube_utils::idn_to_ascii($username);
// user already registered -> overwrite username
if ($user = rcube_user::query($username, $host))
if ($user = rcube_user::query($username, $host)) {
$username = $user->data['username'];
}
$storage = $this->get_storage();
@ -1204,7 +1209,7 @@ class rcmail extends rcube
}
else {
if (!empty($date)) {
$timestamp = rcube_strtotime($date);
$timestamp = rcube_utils::strtotime($date);
}
if (empty($timestamp)) {

File diff suppressed because it is too large Load Diff

@ -38,11 +38,6 @@ function get_table_name($table)
return rcmail::get_instance()->db->table_name($table);
}
function get_sequence_name($sequence)
{
return rcmail::get_instance()->db->sequence_name($sequence);
}
function rcube_label($p, $domain=null)
{
return rcmail::get_instance()->gettext($p, $domain);

@ -20,8 +20,6 @@
*/
/**
* rcube_browser
*
* Provide details about the client's browser based on the User-Agent header
*
* @package Core

@ -181,6 +181,12 @@ class rcube_charset
$to = empty($to) ? strtoupper(RCMAIL_CHARSET) : self::parse_charset($to);
$from = self::parse_charset($from);
// It is a common case when UTF-16 charset is used with US-ASCII content (#1488654)
// In that case we can just skip the conversion (use UTF-8)
if ($from == 'UTF-16' && !preg_match('/[^\x00-\x7F]/', $str)) {
$from = 'UTF-8';
}
if ($from == $to || empty($str) || empty($from)) {
return $str;
}

@ -42,6 +42,7 @@ class rcube_config
'default_folders' => 'default_imap_folders',
'mail_pagesize' => 'pagesize',
'addressbook_pagesize' => 'pagesize',
'reply_mode' => 'top_posting',
);

@ -2222,6 +2222,10 @@ class rcube_imap extends rcube_storage
$folder = $this->folder;
}
if (!$this->check_connection()) {
return false;
}
// make sure folder exists
if ($this->folder_exists($folder)) {
if ($is_file) {

@ -5,7 +5,7 @@
| program/include/rcube_imap_cache.php |
| |
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2011, The Roundcube Dev Team |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
@ -350,11 +350,11 @@ class rcube_imap_cache
function get_message($mailbox, $uid, $update = true, $cache = true)
{
// Check internal cache
if ($this->icache['message']
&& $this->icache['message']['mailbox'] == $mailbox
&& $this->icache['message']['object']->uid == $uid
if ($this->icache['__message']
&& $this->icache['__message']['mailbox'] == $mailbox
&& $this->icache['__message']['object']->uid == $uid
) {
return $this->icache['message']['object'];
return $this->icache['__message']['object'];
}
$sql_result = $this->db->query(
@ -386,7 +386,7 @@ class rcube_imap_cache
// Save current message from internal cache
$this->save_icache();
$this->icache['message'] = array(
$this->icache['__message'] = array(
'object' => $message,
'mailbox' => $mailbox,
'exists' => $found,
@ -459,20 +459,28 @@ class rcube_imap_cache
*/
function change_flag($mailbox, $uids, $flag, $enabled = false)
{
if (empty($uids)) {
return;
}
$flag = strtoupper($flag);
$idx = (int) array_search($flag, $this->flags);
$uids = (array) $uids;
if (!$idx) {
return;
}
// Internal cache update
if ($uids && count($uids) == 1 && ($uid = current($uids))
&& ($message = $this->icache['message'])
&& $message['mailbox'] == $mailbox && $message['object']->uid == $uid
if (($message = $this->icache['__message'])
&& $message['mailbox'] === $mailbox
&& in_array($message['object']->uid, $uids)
) {
$message['object']->flags[$flag] = $enabled;
return;
if (count($uids) == 1) {
return;
}
}
$this->db->query(
@ -481,7 +489,7 @@ class rcube_imap_cache
.", flags = flags ".($enabled ? "+ $idx" : "- $idx")
." WHERE user_id = ?"
." AND mailbox = ?"
.($uids !== null ? " AND uid IN (".$this->db->array2list((array)$uids, 'integer').")" : "")
.($uids !== null ? " AND uid IN (".$this->db->array2list($uids, 'integer').")" : "")
." AND (flags & $idx) ".($enabled ? "= 0" : "= $idx"),
$this->userid, $mailbox);
}
@ -503,10 +511,11 @@ class rcube_imap_cache
}
else {
// Remove the message from internal cache
if (!empty($uids) && !is_array($uids) && ($message = $this->icache['message'])
&& $message['mailbox'] == $mailbox && $message['object']->uid == $uids
if (!empty($uids) && ($message = $this->icache['__message'])
&& $message['mailbox'] === $mailbox
&& in_array($message['object']->uid, (array)$uids)
) {
$this->icache['message'] = null;
$this->icache['__message'] = null;
}
$this->db->query(
@ -608,13 +617,13 @@ class rcube_imap_cache
// get expiration timestamp
$ts = get_offset_time($ttl, -1);
$this->db->query("DELETE FROM ".get_table_name('cache_messages')
$this->db->query("DELETE FROM ".$this->db->table_name('cache_messages')
." WHERE changed < " . $this->db->fromunixtime($ts));
$this->db->query("DELETE FROM ".get_table_name('cache_index')
$this->db->query("DELETE FROM ".$this->db->table_name('cache_index')
." WHERE changed < " . $this->db->fromunixtime($ts));
$this->db->query("DELETE FROM ".get_table_name('cache_thread')
$this->db->query("DELETE FROM ".$this->db->table_name('cache_thread')
." WHERE changed < " . $this->db->fromunixtime($ts));
}
@ -763,6 +772,11 @@ class rcube_imap_cache
$object = $index['object'];
$is_thread = is_a($object, 'rcube_result_thread');
// sanity check
if (empty($object)) {
return false;
}
// Get mailbox data (UIDVALIDITY, counters, etc.) for status check
$mbox_data = $this->imap->folder_data($mailbox);
@ -1078,7 +1092,7 @@ class rcube_imap_cache
private function save_icache()
{
// Save current message from internal cache
if ($message = $this->icache['message']) {
if ($message = $this->icache['__message']) {
// clean up some object's data
$object = $this->message_object_prepare($message['object']);
@ -1089,7 +1103,7 @@ class rcube_imap_cache
$this->add_message($message['mailbox'], $object, !$message['exists']);
}
$this->icache['message']['md5sum'] = $md5sum;
$this->icache['__message']['md5sum'] = $md5sum;
}
}

@ -2538,7 +2538,7 @@ class rcube_imap_generic
{
unset($this->data['APPENDUID']);
if (!$mailbox) {
if ($mailbox === null || $mailbox === '') {
return false;
}
@ -2603,7 +2603,7 @@ class rcube_imap_generic
{
unset($this->data['APPENDUID']);
if (!$mailbox) {
if ($mailbox === null || $mailbox === '') {
return false;
}
@ -2612,6 +2612,7 @@ class rcube_imap_generic
if (file_exists(realpath($path))) {
$in_fp = fopen($path, 'r');
}
if (!$in_fp) {
$this->setError(self::ERROR_UNKNOWN, "Couldn't open $path for reading");
return false;

@ -139,6 +139,11 @@ class rcube_ldap extends rcube_addressbook
unset($this->coltypes[$childcol]); // remove address child col from global coltypes list
}
}
// at least one address type must be specified
if (empty($this->coltypes['address']['subtypes'])) {
$this->coltypes['address']['subtypes'] = array('home');
}
}
else if ($this->coltypes['address']) {
$this->coltypes['address'] += array('type' => 'textarea', 'childs' => null, 'size' => 40);

@ -50,13 +50,14 @@ class rcube_message
*/
private $mime;
private $opt = array();
private $inline_parts = array();
private $parse_alternative = false;
public $uid = null;
public $uid;
public $folder;
public $headers;
public $parts = array();
public $mime_parts = array();
public $inline_parts = array();
public $attachments = array();
public $subject = '';
public $sender = null;
@ -68,17 +69,22 @@ class rcube_message
*
* Provide a uid, and parse message structure.
*
* @param string $uid The message UID.
* @param string $uid The message UID.
* @param string $folder Folder name
*
* @see self::$app, self::$storage, self::$opt, self::$parts
*/
function __construct($uid)
function __construct($uid, $folder = null)
{
$this->uid = $uid;
$this->app = rcube::get_instance();
$this->storage = $this->app->get_storage();
$this->folder = strlen($folder) ? $folder : $this->storage->get_folder();
$this->storage->set_options(array('all_headers' => true));
// Set current folder
$this->storage->set_folder($this->folder);
$this->headers = $this->storage->get_message($uid);
if (!$this->headers)
@ -179,10 +185,12 @@ class rcube_message
}
return $fp ? true : $part->body;
}
// get from IMAP
$this->storage->set_folder($this->folder);
return $this->storage->get_message_part($this->uid, $mime_id, $part, NULL, $fp, $skip_charset_conv);
} else
return null;
}
}
@ -637,8 +645,10 @@ class rcube_message
function tnef_decode(&$part)
{
// @TODO: attachment may be huge, hadle it via file
if (!isset($part->body))
if (!isset($part->body)) {
$this->storage->set_folder($this->folder);
$part->body = $this->storage->get_message_part($this->uid, $part->mime_id, $part);
}
$parts = array();
$tnef = new tnef_decoder;
@ -673,8 +683,10 @@ class rcube_message
function uu_decode(&$part)
{
// @TODO: messages may be huge, hadle body via file
if (!isset($part->body))
if (!isset($part->body)) {
$this->storage->set_folder($this->folder);
$part->body = $this->storage->get_message_part($this->uid, $part->mime_id, $part);
}
$parts = array();
// FIXME: line length is max.65?

@ -541,10 +541,10 @@ class rcube_mime
$prefix = $regs[0];
$level = strlen($prefix);
$line = rtrim(substr($line, $level));
$line = $prefix . rc_wordwrap($line, $length - $level - 2, " \r\n$prefix ");
$line = $prefix . self::wordwrap($line, $length - $level - 2, " \r\n$prefix ");
}
else if ($line) {
$line = rc_wordwrap(rtrim($line), $length - 2, " \r\n");
$line = self::wordwrap(rtrim($line), $length - 2, " \r\n");
// space-stuffing
$line = preg_replace('/(^|\r\n)(From| |>)/', '\\1 \\2', $line);
}

@ -67,6 +67,11 @@ class rcube_output_html extends rcube_output
$this->set_env('task', $task);
$this->set_env('x_frame_options', $this->config->get('x_frame_options', 'sameorigin'));
// add cookie info
$this->set_env('cookie_domain', ini_get('session.cookie_domain'));
$this->set_env('cookie_path', ini_get('session.cookie_path'));
$this->set_env('cookie_secure', ini_get('session.cookie_secure'));
// load the correct skin (in case user-defined)
$skin = $this->config->get('skin');
$this->set_skin($skin);
@ -395,7 +400,7 @@ class rcube_output_html extends rcube_output
'line' => __LINE__,
'file' => __FILE__,
'message' => 'Error loading template for '.$realname
), true, true);
), true, $write);
return false;
}
@ -693,6 +698,11 @@ class rcube_output_html extends rcube_output
}
break;
// frame
case 'frame':
return $this->frame($attrib);
break;
// show a label
case 'label':
if ($attrib['name'] || $attrib['command']) {
@ -1270,6 +1280,30 @@ class rcube_output_html extends rcube_output
}
/**
* Returns iframe object, registers some related env variables
*
* @param array $attrib HTML attributes
*
* @return string IFRAME element
*/
public function frame($attrib)
{
if (!$attrib['id']) {
$attrib['id'] = 'rcmframe';
}
if (!$attrib['name']) {
$attrib['name'] = $attrib['id'];
}
$this->set_env('contentframe', $attrib['id']);
$this->set_env('blankpage', $attrib['src'] ? $this->abs_url($attrib['src']) : 'program/resources/blank.gif');
return html::iframe($attrib);
}
/* ************* common functions delivering gui objects ************** */

@ -336,7 +336,7 @@ abstract class rcube_plugin
public function local_skin_path()
{
$rcmail = rcube::get_instance();
foreach (array($rcmail->config->get('skin'),'default') as $skin) {
foreach (array($rcmail->config->get('skin'), 'larry') as $skin) {
$skin_path = 'skins/' . $skin;
if (is_dir(realpath(slashify($this->home) . $skin_path)))
break;

@ -108,11 +108,11 @@ function slashify($str)
/**
* Remove slash at the end of the string
* Remove slashes at the end of the string
*/
function unslashify($str)
{
return preg_replace('/\/$/', '', $str);
return preg_replace('/\/+$/', '', $str);
}
@ -231,7 +231,7 @@ function array_keys_recursive($array)
{
$keys = array();
if (!empty($array)) {
if (!empty($array) && is_array($array)) {
foreach ($array as $key => $child) {
$keys[] = $key;
foreach (array_keys_recursive($child) as $val) {
@ -255,7 +255,7 @@ function asciiwords($str, $css_id = false, $replace_with = '')
/**
* Remove single and double quotes from given string
* Remove single and double quotes from a given string
*
* @param string Input value
*
@ -305,6 +305,29 @@ function format_email_recipient($email, $name = '')
}
/**
* Format e-mail address
*
* @param string $email E-mail address
*
* @return string Formatted e-mail address
*/
function format_email($email)
{
$email = trim($email);
$parts = explode('@', $email);
$count = count($parts);
if ($count > 1) {
$parts[$count-1] = mb_strtolower($parts[$count-1]);
$email = implode('@', $parts);
}
return $email;
}
/**
* mbstring replacement functions
*/
@ -399,7 +422,6 @@ function rcube_autoload($classname)
{
$filename = preg_replace(
array(
'/MDB2_(.+)/',
'/Mail_(.+)/',
'/Net_(.+)/',
'/Auth_(.+)/',
@ -407,7 +429,6 @@ function rcube_autoload($classname)
'/^utf8$/',
),
array(
'Mail/\\1',
'Mail/\\1',
'Net/\\1',
'Auth/\\1',

@ -195,7 +195,7 @@ abstract class rcube_storage
*/
public function set_folder($folder)
{
if ($this->folder == $folder) {
if ($this->folder === $folder) {
return;
}

@ -92,9 +92,9 @@ class rcube_utils
return false;
}
// Check domain part
if (preg_match('/^\[*(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}\]*$/', $domain_part)) {
return true; // IP address
// Validate domain part
if (preg_match('/^\[((IPv6:[0-9a-f:.]+)|([0-9.]+))\]$/i', $domain_part, $matches)) {
return self::check_ip(preg_replace('/^IPv6:/i', '', $matches[1])); // valid IPv4 or IPv6 address
}
else {
// If not an IP address
@ -110,6 +110,11 @@ class rcube_utils
}
}
// last domain part
if (preg_match('/[^a-zA-Z]/', array_pop($domain_array))) {
return false;
}
$rcube = rcube::get_instance();
if (!$dns_check || !$rcube->config->get('email_dns_check')) {
@ -141,6 +146,52 @@ class rcube_utils
return false;
}
/**
* Validates IPv4 or IPv6 address
*
* @param string $ip IP address in v4 or v6 format
*
* @return bool True if the address is valid
*/
public static function check_ip($ip)
{
// IPv6, but there's no build-in IPv6 support
if (strpos($ip, ':') !== false && !defined('AF_INET6')) {
$parts = explode(':', $domain_part);
$count = count($parts);
if ($count > 8 || $count < 2) {
return false;
}
foreach ($parts as $idx => $part) {
$length = strlen($part);
if (!$length) {
// there can be only one ::
if ($found_empty) {
return false;
}
$found_empty = true;
}
// last part can be an IPv4 address
else if ($idx == $count - 1) {
if (!preg_match('/^[0-9a-f]{1,4}$/i', $part)) {
return @inet_pton($part) !== false;
}
}
else if (!preg_match('/^[0-9a-f]{1,4}$/i', $part)) {
return false;
}
}
return true;
}
return @inet_pton($ip) !== false;
}
/**
* Check whether the HTTP referer matches the current request
*
@ -149,8 +200,8 @@ class rcube_utils
public static function check_referer()
{
$uri = parse_url($_SERVER['REQUEST_URI']);
$referer = parse_url(rcube_request_header('Referer'));
return $referer['host'] == rcube_request_header('Host') && $referer['path'] == $uri['path'];
$referer = parse_url(self::request_header('Referer'));
return $referer['host'] == self::request_header('Host') && $referer['path'] == $uri['path'];
}

@ -313,7 +313,7 @@ class rcube_vcard
case 'birthday':
case 'anniversary':
if (($val = rcube_strtotime($value)) && ($fn = self::$fieldmap[$field]))
if (($val = rcube_utils::strtotime($value)) && ($fn = self::$fieldmap[$field]))
$this->raw[$fn][] = array(0 => date('Y-m-d', $val), 'value' => array('date'));
break;

@ -976,7 +976,7 @@ function rcube_webmail()
// do reply-list, when list is detected and popup menu wasn't used
url._all = (!props && this.commands['reply-list'] ? 'list' : 'all');
else if (command == 'reply-list')
url._all = list;
url._all = 'list';
this.goto_url('compose', url, true);
}
@ -1447,29 +1447,21 @@ function rcube_webmail()
this.doc_mouse_up = function(e)
{
var model, list, li, id;
var model, list, id;
// ignore event if jquery UI dialog is open
if ($(rcube_event.get_target(e)).closest('.ui-dialog, .ui-widget-overlay').length)
return;
if (list = this.message_list) {
if (!rcube_mouse_is_over(e, list.list.parentNode))
list.blur();
else
list.focus();
if (list = this.message_list)
model = this.env.mailboxes;
}
else if (list = this.contact_list) {
if (!rcube_mouse_is_over(e, list.list.parentNode))
list.blur();
else
list.focus();
else if (list = this.contact_list)
model = this.env.contactfolders;
}
else if (this.ksearch_value) {
else if (this.ksearch_value)
this.ksearch_blur();
}
if (list && !rcube_mouse_is_over(e, list.list.parentNode))
list.blur();
// handle mouse release when dragging
if (this.drag_active && model && this.env.last_folder_target) {
@ -1546,14 +1538,17 @@ function rcube_webmail()
if (list.multi_selecting || !this.env.contentframe)
return;
if (list.get_single_selection() && window.frames && window.frames[this.env.contentframe]) {
if (window.frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)>=0) {
if (this.preview_timer)
clearTimeout(this.preview_timer);
if (this.preview_read_timer)
clearTimeout(this.preview_read_timer);
this.preview_timer = setTimeout(function(){ ref.msglist_get_preview(); }, 200);
}
if (list.get_single_selection())
return;
var win = this.get_frame_window(this.env.contentframe);
if (win && win.location.href.indexOf(this.env.blankpage)>=0) {
if (this.preview_timer)
clearTimeout(this.preview_timer);
if (this.preview_read_timer)
clearTimeout(this.preview_read_timer);
this.preview_timer = setTimeout(function(){ ref.msglist_get_preview(); }, 200);
}
};
@ -1918,12 +1913,12 @@ function rcube_webmail()
if (!id)
return;
var target = window,
var win, target = window,
action = preview ? 'preview': 'show',
url = '&_action='+action+'&_uid='+id+'&_mbox='+urlencode(this.env.mailbox);
if (preview && this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
target = window.frames[this.env.contentframe];
if (preview && (win = this.get_frame_window(this.env.contentframe))) {
target = win;
url += '&_framed=1';
}
@ -1960,20 +1955,37 @@ function rcube_webmail()
this.show_contentframe = function(show)
{
var frm, win;
if (this.env.contentframe && (frm = $('#'+this.env.contentframe)) && frm.length) {
if (!show && (win = window.frames[this.env.contentframe])) {
var frame, win, name = this.env.contentframe;
if (name && (frame = this.get_frame_element(name))) {
if (!show && (win = this.get_frame_window(name))) {
if (win.location && win.location.href.indexOf(this.env.blankpage)<0)
win.location.href = this.env.blankpage;
}
else if (!bw.safari && !bw.konq)
frm[show ? 'show' : 'hide']();
}
$(frame)[show ? 'show' : 'hide']();
}
if (!show && this.busy)
this.set_busy(false, null, this.env.frame_lock);
};
this.get_frame_element = function(id)
{
var frame;
if (id && (frame = document.getElementById(id)))
return frame;
};
this.get_frame_window = function(id)
{
var frame = this.get_frame_element(id);
if (frame && frame.name && window.frames)
return window.frames[frame.name];
};
this.lock_frame = function()
{
if (!this.env.frame_lock)
@ -2017,7 +2029,7 @@ function rcube_webmail()
// list messages of a specific mailbox
this.list_mailbox = function(mbox, page, sort, url)
{
var target = window;
var win, target = window;
if (typeof url != 'object')
url = {};
@ -2056,8 +2068,8 @@ function rcube_webmail()
return;
}
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
target = window.frames[this.env.contentframe];
if (win = this.get_frame_window(this.env.contentframe)) {
target = win;
url._framed = 1;
}
@ -2652,34 +2664,37 @@ function rcube_webmail()
// set a specific flag to one or more messages
this.mark_message = function(flag, uid)
{
var a_uids = [], r_uids = [], len, n, id,
selection = this.message_list ? this.message_list.get_selection() : [];
var a_uids = [], r_uids = [], len, n, id, selection,
list = this.message_list;
if (uid)
a_uids[0] = uid;
else if (this.env.uid)
a_uids[0] = this.env.uid;
else if (this.message_list) {
else if (list) {
selection = list.get_selection();
for (n=0, len=selection.length; n<len; n++) {
a_uids.push(selection[n]);
}
}
if (!this.message_list)
if (!list)
r_uids = a_uids;
else
else {
list.focus();
for (n=0, len=a_uids.length; n<len; n++) {
id = a_uids[n];
if ((flag=='read' && this.message_list.rows[id].unread)
|| (flag=='unread' && !this.message_list.rows[id].unread)
|| (flag=='delete' && !this.message_list.rows[id].deleted)
|| (flag=='undelete' && this.message_list.rows[id].deleted)
|| (flag=='flagged' && !this.message_list.rows[id].flagged)
|| (flag=='unflagged' && this.message_list.rows[id].flagged))
if ((flag=='read' && list.rows[id].unread)
|| (flag=='unread' && !list.rows[id].unread)
|| (flag=='delete' && !list.rows[id].deleted)
|| (flag=='undelete' && list.rows[id].deleted)
|| (flag=='flagged' && !list.rows[id].flagged)
|| (flag=='unflagged' && list.rows[id].flagged))
{
r_uids.push(id);
}
}
}
// nothing to do
if (!r_uids.length && !this.select_all_mode)
@ -4020,7 +4035,7 @@ function rcube_webmail()
this.list_contacts = function(src, group, page)
{
var folder, url = {},
var win, folder, url = {},
target = window;
if (!src)
@ -4052,8 +4067,8 @@ function rcube_webmail()
return;
}
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
target = window.frames[this.env.contentframe];
if (win = this.get_frame_window(this.env.contentframe)) {
target = win;
url._framed = 1;
}
@ -4109,11 +4124,11 @@ function rcube_webmail()
// load contact record
this.load_contact = function(cid, action, framed)
{
var url = {}, target = window;
var win, url = {}, target = window;
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
if (win = this.get_frame_window(this.env.contentframe)) {
url._framed = 1;
target = window.frames[this.env.contentframe];
target = win;
this.show_contentframe(true);
// load dummy content
@ -4731,11 +4746,11 @@ function rcube_webmail()
// load advanced search page
this.advanced_search = function()
{
var url = {_form: 1, _action: 'search'}, target = window;
var win, url = {_form: 1, _action: 'search'}, target = window;
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
if (win = this.get_frame_window(this.env.contentframe)) {
url._framed = 1;
target = window.frames[this.env.contentframe];
target = win;
this.contact_list.clear_selection();
}
@ -4857,13 +4872,13 @@ function rcube_webmail()
// preferences section select and load options frame
this.section_select = function(list)
{
var id = list.get_single_selection(), target = window,
var win, id = list.get_single_selection(), target = window,
url = {_action: 'edit-prefs', _section: id};
if (id) {
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
if (win = this.get_frame_window(this.env.contentframe)) {
url._framed = 1;
target = window.frames[this.env.contentframe];
target = win;
}
this.location_href(url, target, true);
}
@ -4886,13 +4901,12 @@ function rcube_webmail()
if (action == 'edit-identity' && (!id || id == this.env.iid))
return false;
var target = window,
var win, target = window,
url = {_action: action, _iid: id};
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
if (win = this.get_frame_window(this.env.contentframe)) {
url._framed = 1;
target = window.frames[this.env.contentframe];
document.getElementById(this.env.contentframe).style.visibility = 'inherit';
target = win;
}
if (action && (id || action == 'add-identity')) {
@ -5268,14 +5282,14 @@ function rcube_webmail()
// when user select a folder in manager
this.show_folder = function(folder, path, force)
{
var target = window,
var win, target = window,
url = '&_action=edit-folder&_mbox='+urlencode(folder);
if (path)
url += '&_path='+urlencode(path);
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
target = window.frames[this.env.contentframe];
if (win = this.get_frame_window(this.env.contentframe)) {
target = win;
url += '&_framed=1';
}
@ -6585,6 +6599,12 @@ function rcube_webmail()
return 0;
};
// Cookie setter
this.set_cookie = function(name, value, expires)
{
setCookie(name, value, expires, this.env.cookie_path, this.env.cookie_domain, this.env.cookie_secure);
}
} // end object rcube_webmail
@ -6615,6 +6635,8 @@ rcube_webmail.long_subject_title_ie = function(elem, indent)
}
};
rcube_webmail.prototype.get_cookie = getCookie;
// copy event engine prototype
rcube_webmail.prototype.addEventListener = rcube_event_engine.prototype.addEventListener;
rcube_webmail.prototype.removeEventListener = rcube_event_engine.prototype.removeEventListener;

@ -494,12 +494,15 @@ function rcube_check_email(input, inline)
atom = '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+',
quoted_pair = '\\x5c[\\x00-\\x7f]',
quoted_string = '\\x22('+qtext+'|'+quoted_pair+')*\\x22',
ipv4 = '\\[(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}\\]',
ipv6 = '\\[IPv6:[0-9a-f:.]+\\]',
ip_addr = '(' + ipv4 + ')|(' + ipv6 + ')',
// Use simplified domain matching, because we need to allow Unicode characters here
// So, e-mail address should be validated also on server side after idn_to_ascii() use
//domain_literal = '\\x5b('+dtext+'|'+quoted_pair+')*\\x5d',
//sub_domain = '('+atom+'|'+domain_literal+')',
// allow punycode/unicode top-level domain
domain = '([^@\\x2e]+\\x2e)+([^\\x00-\\x40\\x5b-\\x60\\x7b-\\x7f]{2,}|xn--[a-z0-9]{2,})',
domain = '(('+ip_addr+')|(([^@\\x2e]+\\x2e)+([^\\x00-\\x40\\x5b-\\x60\\x7b-\\x7f]{2,}|xn--[a-z0-9]{2,})))',
// ICANN e-mail test (http://idn.icann.org/E-mail_test)
icann_domains = [
'\\u0645\\u062b\\u0627\\u0644\\x2e\\u0625\\u062e\\u062a\\u0628\\u0627\\u0631',
@ -527,7 +530,6 @@ function rcube_check_email(input, inline)
return false;
};
// recursively copy an object
function rcube_clone_object(obj)
{
@ -635,6 +637,7 @@ function getCookie(name)
return unescape(dc.substring(begin + prefix.length, end));
};
// deprecated aliases, to be removed, use rcmail.set_cookie/rcmail.get_cookie
roundcube_browser.prototype.set_cookie = setCookie;
roundcube_browser.prototype.get_cookie = getCookie;

@ -25,7 +25,7 @@ var GOOGIE_CUR_LANG,
function GoogieSpell(img_dir, server_url, has_dict)
{
var ref = this,
cookie_value = getCookie('language');
cookie_value = rcmail.get_cookie('language');
GOOGIE_CUR_LANG = cookie_value != null ? cookie_value : GOOGIE_DEFAULT_LANG;
@ -150,7 +150,7 @@ this.setCurrentLanguage = function(lan_code)
//Set cookie
var now = new Date();
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
setCookie('language', lan_code, now);
rcmail.set_cookie('language', lan_code, now);
};
this.setForceWidthHeight = function(width, height)

@ -231,8 +231,8 @@ focus: function(e)
}
}
// Un-focus already focused elements
$(document.activeElement).blur();
// Un-focus already focused elements (#1487123, #1487316, #1488600, #1488620)
$(':focus:not(body)').blur();
$('iframe').each(function() { this.blur(); });
if (e || (e = window.event))

@ -1,7 +1,6 @@
<?php
/*
+-----------------------------------------------------------------------+
| language/en_US/labels.inc |
| |
@ -15,9 +14,6 @@
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
@version $Id$
*/
$labels = array();
@ -163,6 +159,7 @@ $labels['unread'] = 'Unread';
$labels['flagged'] = 'Flagged';
$labels['unanswered'] = 'Unanswered';
$labels['deleted'] = 'Deleted';
$labels['undeleted'] = 'Not deleted';
$labels['invert'] = 'Invert';
$labels['filter'] = 'Filter';
$labels['list'] = 'List';
@ -384,7 +381,8 @@ $labels['pagesize'] = 'Rows per page';
$labels['signature'] = 'Signature';
$labels['dstactive'] = 'Daylight saving time';
$labels['htmleditor'] = 'Compose HTML messages';
$labels['htmlonreply'] = 'on reply to HTML message only';
$labels['htmlonreply'] = 'on reply to HTML message';
$labels['htmlonreplyandforward'] = 'on forward or reply to HTML message';
$labels['htmlsignature'] = 'HTML signature';
$labels['previewpane'] = 'Show preview pane';
$labels['skin'] = 'Interface skin';
@ -432,8 +430,9 @@ $labels['maintenance'] = 'Maintenance';
$labels['newmessage'] = 'New Message';
$labels['signatureoptions'] = 'Signature Options';
$labels['whenreplying'] = 'When replying';
$labels['replytopposting'] = 'start new message above original';
$labels['replybottomposting'] = 'start new message below original';
$labels['replyempty'] = 'do not quote the original message';
$labels['replytopposting'] = 'start new message above the quote';
$labels['replybottomposting'] = 'start new message below the quote';
$labels['replyremovesignature'] = 'When replying remove original signature from message';
$labels['autoaddsignature'] = 'Automatically add signature';
$labels['newmessageonly'] = 'new message only';

@ -134,6 +134,7 @@ $labels['unread'] = 'Nieprzeczytane';
$labels['flagged'] = 'Oznaczone';
$labels['unanswered'] = 'Bez odpowiedzi';
$labels['deleted'] = 'Usunięte';
$labels['undeleted'] = 'Nieusunięte';
$labels['invert'] = 'Odwróć';
$labels['filter'] = 'Filtr';
$labels['list'] = 'Lista';

@ -86,7 +86,7 @@ while ($result && ($row = $result->next())) {
foreach ($row as $key => $values) {
list($field, $section) = explode(':', $key);
foreach ((array)$values as $value) {
if (is_array($value) || strlen($value))
if (is_array($value) || @strlen($value))
$vcard->set($field, $value, strtoupper($section));
}
}

@ -139,7 +139,7 @@ if (!empty($CONFIG['drafts_mbox'])) {
// set current mailbox in client environment
$OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder());
$OUTPUT->set_env('sig_above', $RCMAIL->config->get('sig_above', false));
$OUTPUT->set_env('top_posting', $RCMAIL->config->get('top_posting', false));
$OUTPUT->set_env('top_posting', intval($RCMAIL->config->get('reply_mode')) > 0);
$OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ',')));
// default font for HTML editor
@ -252,7 +252,8 @@ $MESSAGE->identities = $RCMAIL->user->list_identities();
if (count($MESSAGE->identities))
{
foreach ($MESSAGE->identities as $idx => $ident) {
$email = mb_strtolower(rcube_idn_to_utf8($ident['email']));
$ident['email'] = format_email($ident['email']);
$email = format_email(rcube_idn_to_utf8($ident['email']));
$MESSAGE->identities[$idx]['email_ascii'] = $ident['email'];
$MESSAGE->identities[$idx]['ident'] = format_email_recipient($ident['email'], $ident['name']);
@ -277,7 +278,7 @@ else if (count($MESSAGE->identities)) {
$a_to = rcube_mime::decode_address_list($MESSAGE->headers->to, null, true, $MESSAGE->headers->charset);
foreach ($a_to as $addr) {
if (!empty($addr['mailto'])) {
$a_recipients[] = strtolower($addr['mailto']);
$a_recipients[] = format_email($addr['mailto']);
$a_names[] = $addr['name'];
}
}
@ -286,7 +287,7 @@ else if (count($MESSAGE->identities)) {
$a_cc = rcube_mime::decode_address_list($MESSAGE->headers->cc, null, true, $MESSAGE->headers->charset);
foreach ($a_cc as $addr) {
if (!empty($addr['mailto'])) {
$a_recipients[] = strtolower($addr['mailto']);
$a_recipients[] = format_email($addr['mailto']);
$a_names[] = $addr['name'];
}
}
@ -294,16 +295,12 @@ else if (count($MESSAGE->identities)) {
}
$from_idx = null;
$default_identity = null;
$found_idx = null;
$default_identity = 0; // default identity is always first on the list
$return_path = $MESSAGE->headers->others['return-path'];
// Select identity
foreach ($MESSAGE->identities as $idx => $ident) {
// save default identity ID
if ($ident['standard']) {
$default_identity = $idx;
}
// use From header
if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT))) {
if ($MESSAGE->headers->from == $ident['ident']) {
@ -318,13 +315,22 @@ else if (count($MESSAGE->identities)) {
}
// use replied message recipients
else if (($found = array_search($ident['email_ascii'], $a_recipients)) !== false) {
// match identity name, prefer default identity
if ($from_idx === null || ($a_names[$found] && $ident['name'] && $a_names[$found] == $ident['name'])) {
if ($found_idx === null) {
$found_idx = $idx;
}
// match identity name
if ($a_names[$found] && $ident['name'] && $a_names[$found] == $ident['name']) {
$from_idx = $idx;
break;
}
}
}
// If matching by name+address doesn't found any amtches, get first found address (identity)
if ($from_idx === null) {
$from_idx = $found_idx;
}
// Fallback using Return-Path
if ($from_idx === null && $return_path) {
foreach ($MESSAGE->identities as $idx => $ident) {
@ -335,12 +341,7 @@ else if (count($MESSAGE->identities)) {
}
}
// Still no ID, use default/first identity
if ($from_idx === null) {
$from_idx = $default_identity !== null ? $default_identity : key(reset($MESSAGE->identities));
}
$ident = $MESSAGE->identities[$from_idx];
$ident = $MESSAGE->identities[$from_idx !== null ? $from_idx : $default_identity];
$from_id = $ident['identity_id'];
$MESSAGE->compose['from_email'] = $ident['email'];
@ -433,7 +434,7 @@ foreach ($parts as $header) {
if (empty($addr_part['mailto']))
continue;
$mailto = mb_strtolower(rcube_idn_to_utf8($addr_part['mailto']));
$mailto = format_email(rcube_idn_to_utf8($addr_part['mailto']));
if (!in_array($mailto, $a_recipients)
&& ($header == 'to' || empty($MESSAGE->compose['from_email']) || $mailto != $MESSAGE->compose['from_email'])
@ -609,9 +610,12 @@ function rcmail_compose_editor_mode()
$useHtml = $MESSAGE->has_html_part(false);
}
else if ($compose_mode == RCUBE_COMPOSE_REPLY) {
$useHtml = ($html_editor == 1 || ($html_editor == 2 && $MESSAGE->has_html_part(false)));
$useHtml = ($html_editor == 1 || ($html_editor >= 2 && $MESSAGE->has_html_part(false)));
}
else { // RCUBE_COMPOSE_FORWARD or NEW
else if ($compose_mode == RCUBE_COMPOSE_FORWARD) {
$useHtml = ($html_editor == 1 || ($html_editor == 3 && $MESSAGE->has_html_part(false)));
}
else {
$useHtml = ($html_editor == 1);
}
@ -640,7 +644,7 @@ function rcmail_prepare_message_body()
rcmail_write_forward_attachment($MESSAGE);
}
// reply/edit/draft/forward
else if ($compose_mode) {
else if ($compose_mode && ($compose_mode != RCUBE_COMPOSE_REPLY || $RCMAIL->config->get('reply_mode') != -1)) {
$isHtml = rcmail_compose_editor_mode();
if (!empty($MESSAGE->parts)) {
@ -905,8 +909,9 @@ function rcmail_create_reply_body($body, $bodyIsHtml)
$prefix .= "\n";
$suffix = '';
if ($RCMAIL->config->get('top_posting'))
if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
$prefix = "\n\n\n" . $prefix;
}
}
else {
// save inline images to files
@ -920,7 +925,7 @@ function rcmail_create_reply_body($body, $bodyIsHtml)
$prefix = '<p>' . Q($prefix) . "</p>\n";
$prefix .= '<blockquote>';
if ($RCMAIL->config->get('top_posting')) {
if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
$prefix = '<br>' . $prefix;
$suffix = '</blockquote>';
}

@ -90,11 +90,13 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') {
// set current mailbox and some other vars in client environment
$OUTPUT->set_env('mailbox', $mbox_name);
$OUTPUT->set_env('pagesize', $RCMAIL->storage->get_pagesize());
$OUTPUT->set_env('quota', $RCMAIL->storage->get_capability('QUOTA'));
$OUTPUT->set_env('delimiter', $RCMAIL->storage->get_hierarchy_delimiter());
$OUTPUT->set_env('threading', $threading);
$OUTPUT->set_env('threads', $threading || $RCMAIL->storage->get_capability('THREAD'));
$OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0));
if ($RCMAIL->storage->get_capability('QUOTA')) {
$OUTPUT->set_env('quota', true);
}
if ($CONFIG['delete_junk'])
$OUTPUT->set_env('delete_junk', true);
@ -1053,12 +1055,17 @@ function rcmail_message_full_headers($attrib, $headers=NULL)
global $OUTPUT;
$html = html::div(array('id' => "all-headers", 'class' => "all", 'style' => 'display:none'), html::div(array('id' => 'headers-source'), ''));
$html .= html::div(array('class' => "more-headers show-headers", 'onclick' => "return ".JS_OBJECT_NAME.".command('show-headers','',this)"), '');
if (!get_boolean($attrib['no-switch'])) {
$html .= html::div(array('class' => "more-headers show-headers", 'onclick' => "return ".JS_OBJECT_NAME.".command('show-headers','',this)"), '');
}
unset($attrib['no-switch']);
$OUTPUT->add_gui_object('all_headers_row', 'all-headers');
$OUTPUT->add_gui_object('all_headers_box', 'headers-source');
return html::div($attrib, $html);
return count($attrib) > 1 ? html::div($attrib, $html) : $html;
}
@ -1712,8 +1719,10 @@ function rcmail_search_filter($attrib)
$select_filter->add(rcube_label('unread'), 'UNSEEN');
$select_filter->add(rcube_label('flagged'), 'FLAGGED');
$select_filter->add(rcube_label('unanswered'), 'UNANSWERED');
if (!$CONFIG['skip_deleted'])
if (!$CONFIG['skip_deleted']) {
$select_filter->add(rcube_label('deleted'), 'DELETED');
$select_filter->add(rcube_label('undeleted'), 'UNDELETED');
}
$select_filter->add(rcube_label('priority').': '.rcube_label('highest'), 'HEADER X-PRIORITY 1');
$select_filter->add(rcube_label('priority').': '.rcube_label('high'), 'HEADER X-PRIORITY 2');
$select_filter->add(rcube_label('priority').': '.rcube_label('normal'), 'NOT HEADER X-PRIORITY 1 NOT HEADER X-PRIORITY 2 NOT HEADER X-PRIORITY 4 NOT HEADER X-PRIORITY 5');

@ -24,7 +24,8 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_POST))
$source = $RCMAIL->storage->get_raw_headers($uid);
if ($source !== false) {
$source = htmlspecialchars(trim($source));
$source = trim(rcube_charset::clean($source));
$source = htmlspecialchars($source);
$source = preg_replace(
array(
'/\n[\t\s]+/',

@ -44,8 +44,8 @@ if ($RCMAIL->action == 'subscribe')
if ($result) {
// Handle subscription of protected folder (#1487656)
if ($CONFIG['protect_default_folders'] == true
&& in_array($mbox, $CONFIG['default_folders'])
if ($RCMAIL->config->get('protect_default_folders')
&& in_array($mbox, (array)$RCMAIL->config->get('default_folders'))
) {
$OUTPUT->command('disable_subscription', $mbox);
}
@ -321,8 +321,8 @@ function rcube_subscription_form($attrib)
}
}
}
// check if the folder is shared, then disable subscription option on it
if (!$disabled && $folder['virtual'] && !empty($namespace)) {
// check if the folder is shared, then disable subscription option on it (if not subscribed already)
if (!$disabled && !$subscribed && $folder['virtual'] && !empty($namespace)) {
$tmp_ns = array_merge((array)$namespace['other'], (array)$namespace['shared']);
foreach ($tmp_ns as $item) {
if (strpos($folder['id'], $item[0]) === 0) {
@ -411,8 +411,10 @@ function rcmail_rename_folder($oldname, $newname)
$OUTPUT->set_pagetitle(rcube_label('folders'));
$OUTPUT->include_script('list.js');
$OUTPUT->set_env('quota', $STORAGE->get_capability('QUOTA'));
$OUTPUT->set_env('prefix_ns', $STORAGE->get_namespace('prefix'));
if ($STORAGE->get_capability('QUOTA')) {
$OUTPUT->set_env('quota', true);
}
// add some labels to client
$OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'folderdeleting',

@ -470,6 +470,7 @@ function rcmail_user_prefs($current=null)
$select_htmleditor->add(rcube_label('never'), 0);
$select_htmleditor->add(rcube_label('always'), 1);
$select_htmleditor->add(rcube_label('htmlonreply'), 2);
$select_htmleditor->add(rcube_label('htmlonreplyandforward'), 3);
$blocks['main']['options']['htmleditor'] = array(
'title' => html::label($field_id, Q(rcube_label('htmleditor'))),
@ -544,16 +545,17 @@ function rcmail_user_prefs($current=null)
);
}
if (!isset($no_override['top_posting'])) {
$field_id = 'rcmfd_top_posting';
$select_replymode = new html_select(array('name' => '_top_posting', 'id' => $field_id,
'onchange' => "\$('#rcmfd_sig_above').attr('disabled',this.selectedIndex==0)"));
if (!isset($no_override['reply_mode'])) {
$field_id = 'rcmfd_reply_mode';
$select_replymode = new html_select(array('name' => '_reply_mode', 'id' => $field_id,
'onchange' => "\$('#rcmfd_sig_above').attr('disabled',this.selectedIndex<2)"));
$select_replymode->add(rcube_label('replyempty'), -1);
$select_replymode->add(rcube_label('replybottomposting'), 0);
$select_replymode->add(rcube_label('replytopposting'), 1);
$blocks['main']['options']['top_posting'] = array(
$blocks['main']['options']['reply_mode'] = array(
'title' => html::label($field_id, Q(rcube_label('whenreplying'))),
'content' => $select_replymode->show($config['top_posting']?1:0),
'content' => $select_replymode->show(intval($config['reply_mode'])),
);
}
@ -597,7 +599,7 @@ function rcmail_user_prefs($current=null)
if (!isset($no_override['sig_above'])) {
$field_id = 'rcmfd_sig_above';
$select_sigabove = new html_select(array('name' => '_sig_above', 'id' => $field_id, 'disabled' => !$config['top_posting']));
$select_sigabove = new html_select(array('name' => '_sig_above', 'id' => $field_id, 'disabled' => $config['reply_mode'] < 1));
$select_sigabove->add(rcube_label('belowquote'), 0);
$select_sigabove->add(rcube_label('abovequote'), 1);

@ -80,7 +80,10 @@ if (!$error && strlen($path) && (!strlen($old_imap) || $old_imap != $name_imap))
}
}
if (!$error) {
if ($error) {
$OUTPUT->command('display_message', $error, 'error');
}
else {
$folder['name'] = $name_imap;
$folder['oldname'] = $old_imap;
$folder['class'] = '';

@ -82,9 +82,9 @@ switch ($CURR_SECTION)
'spellcheck_ignore_nums' => isset($_POST['_spellcheck_ignore_nums']) ? TRUE : FALSE,
'spellcheck_ignore_caps' => isset($_POST['_spellcheck_ignore_caps']) ? TRUE : FALSE,
'show_sig' => isset($_POST['_show_sig']) ? intval($_POST['_show_sig']) : 1,
'top_posting' => !empty($_POST['_top_posting']),
'reply_mode' => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0,
'strip_existing_sig' => isset($_POST['_strip_existing_sig']),
'sig_above' => !empty($_POST['_sig_above']) && !empty($_POST['_top_posting']),
'sig_above' => !empty($_POST['_sig_above']) && $_POST['_reply_mode'] < 1,
'default_font' => get_input_value('_default_font', RCUBE_INPUT_POST),
'forward_attachment' => !empty($_POST['_forward_attachment']),
);

@ -28,11 +28,6 @@ function rcube_init_settings_tabs()
$('a', tab).removeAttr('onclick').click(function() { return false; });
}
function rcube_show_advanced(visible)
{
$('tr.advanced').css('display', (visible ? (bw.ie ? 'block' : 'table-row') : 'none'));
}
// Fieldsets-to-tabs converter
// Warning: don't place "caller" <script> inside page element (id)
function rcube_init_tabs(id, current)
@ -530,7 +525,7 @@ show_header_form: function(id)
if ((row = document.getElementById('compose-' + id))) {
var div = document.getElementById('compose-div'),
headers_div = document.getElementById('compose-headers-div');
row.style.display = (document.all && !window.opera) ? 'block' : 'table-row';
$(row).show();
div.style.top = (parseInt(headers_div.offsetHeight, 10) + 3) + 'px';
this.resize_compose_body();
}
@ -550,11 +545,11 @@ hide_header_form: function(id)
for (var i=0; i<links.length; i++)
if (links[i].style.display != 'none')
for (var j=i+1; j<links.length; j++)
if (links[j].style.display != 'none')
if (links[j].style.display != 'none')
if ((ns = this.next_sibling(links[i]))) {
ns.style.display = '';
break;
}
ns.style.display = '';
break;
}
document.getElementById('_' + id).value = '';

@ -1,3 +1,4 @@
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<link rel="index" href="$__comm_path" />
<link rel="shortcut icon" href="/images/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="/common.css" />

@ -47,7 +47,7 @@ function rcube_splitter(attrib)
rcube_event.add_listener({element: window, event:'resize', object:this, method:'onResize'});
// read saved position from cookie
var cookie = bw.get_cookie(this.id);
var cookie = rcmail.get_cookie(this.id);
if (cookie && !isNaN(cookie)) {
this.pos = parseFloat(cookie);
this.resize();
@ -197,7 +197,7 @@ function rcube_splitter(attrib)
{
var exp = new Date();
exp.setYear(exp.getFullYear() + 1);
bw.set_cookie(this.id, this.pos, exp);
rcmail.set_cookie(this.id, this.pos, exp);
};
} // end class rcube_splitter

@ -79,7 +79,7 @@
<a href="#bcc" onclick="return rcmail_ui.hide_header_form('bcc');"><img src="/images/icons/minus.gif" alt="" width="13" height="11" title="<roundcube:label name='delete' />" /></a>
<label for="_bcc"><roundcube:label name="bcc" /></label>
</td>
<td colspan="2" class="editfield"><roundcube:object name="composeHeaders" part="bcc" form="form" id="_bcc" cols="70" rows="2" tabindex="4" /></td>
<td class="editfield"><roundcube:object name="composeHeaders" part="bcc" form="form" id="_bcc" cols="70" rows="2" tabindex="4" /></td>
</tr><tr id="compose-replyto">
<td class="title top">
<a href="#replyto" onclick="return rcmail_ui.hide_header_form('replyto');"><img src="/images/icons/minus.gif" alt="" width="13" height="11" title="<roundcube:label name='delete' />" /></a>

@ -23,11 +23,9 @@
<div id="mailboxlist-container">
<div id="mailboxlist-title" class="boxtitle"><roundcube:label name="mailboxlist" /></div>
<div class="boxlistcontent">
<roundcube:object name="mailboxlist" id="mailboxlist" maxlength="25" />
</div>
<div class="boxfooter">
<roundcube:button name="mailboxmenulink" id="mailboxmenulink" type="link" title="folderactions" class="button groupactions" onclick="rcmail_ui.show_popup('mailboxmenu');return false" content=" " />
<roundcube:object name="mailboxlist" id="mailboxlist" maxlength="25" />
</div>
<div class="boxfooter"></div>
</div>
</div>
@ -57,14 +55,5 @@
rcmail.add_onload('mailviewsplitv.init()');
</script>
<div id="mailboxoptionsmenu" class="popupmenu">
<ul>
<li><roundcube:button command="expunge" type="link" label="compact" classAct="active" /></li>
<li class="separator_below"><roundcube:button command="purge" type="link" label="empty" classAct="active" /></li>
<li><roundcube:button command="folders" task="settings" type="link" label="managefolders" classAct="active" /></li>
<roundcube:container name="mailboxoptions" id="mailboxoptionsmenu" />
</ul>
</div>
</body>
</html>

@ -42,11 +42,9 @@
<div id="mailboxlist-container">
<div class="boxtitle"><roundcube:label name="mailboxlist" /></div>
<div class="boxlistcontent">
<roundcube:object name="mailboxlist" id="mailboxlist" folder_filter="mail" />
</div>
<div class="boxfooter">
<roundcube:button name="mailboxmenulink" id="mailboxmenulink" type="link" title="folderactions" class="button groupactions" onclick="rcmail_ui.show_popup('mailboxmenu');return false" content=" " />
<roundcube:object name="mailboxlist" id="mailboxlist" folder_filter="mail" />
</div>
<div class="boxfooter"></div>
</div>
</div>
@ -63,15 +61,6 @@
rcmail.add_onload('mailviewsplitv.init()');
</script>
<div id="mailboxoptionsmenu" class="popupmenu">
<ul>
<li><roundcube:button command="expunge" type="link" label="compact" classAct="active" /></li>
<li class="separator_below"><roundcube:button command="purge" type="link" label="empty" classAct="active" /></li>
<li><roundcube:button command="folders" task="settings" type="link" label="managefolders" classAct="active" /></li>
<roundcube:container name="mailboxoptions" id="mailboxoptionsmenu" />
</ul>
</div>
</body>
<roundcube:endif />

@ -34,7 +34,6 @@
position: absolute;
top: -6px;
left: 0;
right: 260px;
height: 40px;
white-space: nowrap;
z-index: 10;

@ -7,10 +7,16 @@
* License. It is allowed to copy, distribute, transmit and to adapt the work
* by keeping credits to the original autors in the README file.
* See http://creativecommons.org/licenses/by-sa/3.0/ for details.
*
* $Id$
*/
/* #1488618 */
#mainscreen {
height: expression((parseInt(document.documentElement.clientHeight)-108)+'px');
}
#mainscreen.offset {
height: expression((parseInt(document.documentElement.clientHeight)-150)+'px');
}
input.button {
display: inline;
font-size: 90%;
@ -23,7 +29,7 @@ a.deletebutton,
.boxfooter .listbutton .inner,
.attachmentslist li a.delete,
.attachmentslist li a.cancelupload,
#messagepreviewheader .iconlink {
#messageheader .iconlink {
/* workaround for text-indent which also offsets the background image */
text-indent: 0;
font-size: 0;
@ -39,7 +45,7 @@ a.deletebutton,
.pagenav a.button,
.pagenav a.button span.inner,
#messagepreviewheader .iconlink,
#messageheader .iconlink,
#uploadform a.iconlink {
display: inline;
}
@ -61,7 +67,7 @@ a.deletebutton,
text-align: left;
}
#messagepreviewheader .iconlink {
#messageheader .iconlink {
color: #fff;
height: 14px;
}

@ -143,7 +143,7 @@ ul.toolbarmenu li a.active:hover,
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#005d76', endColorstr='#004558', GradientType=0);
}
#messageheader, #partheader, #composeheaders {
#partheader, #composeheaders {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e9e9e9', GradientType=0);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

@ -1,3 +1,4 @@
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<link rel="shortcut icon" href="/images/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="/styles.css" />
<roundcube:if condition="in_array(env:task, array('mail','addressbook','settings'))" />

@ -38,10 +38,6 @@
bottom: 28px;
}
#mailview-top.fullheight {
border-radius: 4px 4px 0 0;
}
#mailview-bottom {
position: absolute;
left: 0;
@ -50,6 +46,10 @@
height: 26px;
}
#mailview-top.fullheight {
border-radius: 4px 4px 0 0;
}
#folderlist-header {
width: 100%;
height: 12px;
@ -341,7 +341,6 @@ a.iconbutton.threadmode.selected {
#messagetoolbar {
position: absolute;
top: -6px;
right: 390px;
left: 0;
height: 40px;
white-space: nowrap;
@ -362,7 +361,7 @@ a.iconbutton.threadmode.selected {
position: absolute;
right: 0;
top: 0;
width: 240px;
width: 400px;
}
#mailpreviewtoggle {
@ -383,11 +382,7 @@ a.iconbutton.threadmode.selected {
/*** message list ***/
#messagelist thead td:first-child {
border-radius: 4px 0 0 0;
}
#messagelist thead td:last-child {
border-radius: 0 4px 0 0;
border-radius: 4px 0 0 0; /* for Chrome */
}
#messagelist tr td.attachment,
@ -680,15 +675,14 @@ a.iconbutton.threadmode.selected {
#messagecontent {
position: absolute;
top: 140px;
top: 0;
left: 0;
width: 100%;
bottom: 0;
bottom: 28px;
overflow: auto;
border-radius: 4px 4px 0 0;
}
#messageheader,
#partheader,
#composeheaders {
position: relative;
@ -712,7 +706,7 @@ h2.subject {
h3.subject {
font-size: 14px;
margin: 0 8em 0 0;
margin: 0 13em 0 0;
padding: 8px 8px 4px 8px;
white-space: nowrap;
overflow: hidden;
@ -787,6 +781,7 @@ h3.subject {
background: -ms-linear-gradient(left, #fbfbfb 0, #e9e9e9 100%);
background: linear-gradient(left, #fbfbfb 0, #e9e9e9 100%);
border-right: 1px solid #dfdfdf;
border-radius: 3px 0 0 0; /* for Opera */
}
#previewheaderstoggle .iconlink {
@ -801,28 +796,29 @@ h3.subject {
#previewheaderstoggle.remove .iconlink {
top: auto;
bottom: 5px;
bottom: 15px;
background-position: -5px -242px;
}
div.more-headers {
cursor: pointer;
height: 10px;
background: url(images/buttons.png) center -1619px no-repeat;
#previewheaderstoggle .iconlink.allheaders {
display: none;
}
div.hide-headers {
background-position: center -1629px;
#previewheaderstoggle.remove .iconlink.allheaders {
top: auto;
bottom: 2px;
display: inline-block;
background-position: -27px -242px;
}
#all-headers {
position: relative;
margin: 0 10px;
margin: 2px 0;
padding: 0;
height: 180px;
border: 1px solid #bbb;
background-color: #f0f0f0;
overflow: hidden;
border-radius: 4px;
background: #fff;
}
#headers-source {
@ -832,25 +828,30 @@ div.hide-headers {
left: 0;
right: 0;
bottom: 0;
padding: 2px 5px;
padding: 2px;
overflow: auto;
text-align: left;
color: #333;
color: #666;
}
#messagepreviewheader {
#messageheader {
position: relative;
height: auto;
margin: 0 8px 0 0;
padding: 0 0 6px 72px;
padding: 0 0 0 72px;
border-bottom: 2px solid #f0f0f0;
}
#messagepreviewheader h3.subject {
#messagecontent #messageheader {
padding: 0 0 0 90px;
min-height: 68px;
}
#messageheader h3.subject {
padding: 8px 8px 2px 0;
}
#messagepreviewheader #contactphoto {
#messageheader #contactphoto {
display: block;
position: absolute;
top: 11px;
@ -862,52 +863,40 @@ div.hide-headers {
border-radius: 3px;
}
#messagepreviewheader #contactphoto img {
#messageheader #contactphoto img {
width: 32px;
height: auto;
border-radius: 3px;
}
#messageheader #contactphoto {
display: block;
position: absolute;
top: 40px;
right: 10px;
#messagecontent #messageheader #contactphoto {
top: 11px;
left: 31px;
width: 48px;
height: 48px;
overflow: hidden;
background: url(images/contactpic_48px.png) center center no-repeat #fff;
border-radius: 4px;
}
#messageheader #contactphoto img {
#messagecontent #messageheader #contactphoto img {
width: 48px;
height: auto;
border-radius: 4px;
}
#messagepreviewheader #countcontrols,
#messageheader #countcontrols {
position: absolute;
top: 8px;
right: 8px;
width: 20em;
right: 0;
text-align: right;
white-space: nowrap;
}
#messageheader .pagenav .countdisplay {
min-width: 0;
padding-right: 0.5em;
white-space: nowrap;
}
#messagecontent .leftcol,
#messagepreview .leftcol {
margin-right: 252px;
overflow-x: auto;
}
#messagecontent .rightcol,
#messagepreview .rightcol {
float: right;
/*
@ -921,6 +910,7 @@ div.hide-headers {
min-height: 200px;
background: #f0f0f0;
padding: 8px;
border-radius: 4px;
}
#messagebody {

@ -647,6 +647,7 @@ a.iconlink.upload {
.uibox {
border: 1px solid #a3a3a3;
border-radius: 4px;
overflow: hidden;
box-shadow: 0 0 2px #999;
-o-box-shadow: 0 0 2px #999;
-webkit-box-shadow: 0 0 2px #999;
@ -660,7 +661,7 @@ a.iconlink.upload {
left: 0;
bottom: 0;
width: 100%;
min-width: 1150px;
min-width: 1024px;
}
.scroller {
@ -698,7 +699,8 @@ a.iconlink.upload {
left: 0;
width: 100%;
bottom: 0;
overflow: auto;
overflow-x: hidden;
overflow-y: auto;
}
.listbox .scroller.withfooter {

@ -11,6 +11,8 @@
* See http://creativecommons.org/licenses/by-sa/3.0/ for details.
*/
ini_set('error_reporting', E_ALL &~ (E_NOTICE | E_STRICT));
header('Content-Type: image/svg+xml');
header("Expires: ".gmdate("D, d M Y H:i:s", time()+864000)." GMT");
header("Cache-Control: max-age=864000");

@ -133,7 +133,7 @@ ul.toolbarmenu li a.active:hover,
background-image: url(svggradient.php?c=005d76;004558);
}
#messageheader, #partheader, #composeheaders {
#partheader, #composeheaders {
background-image: url(svggradient.php?c=ffffff;e9e9e9);
}

@ -24,20 +24,38 @@
<!-- folders list -->
<div id="mailboxcontainer" class="uibox listbox">
<div class="scroller">
<roundcube:object name="mailboxlist" id="mailboxlist" class="listing" folder_filter="mail" unreadwrap="%s" />
</div>
<div class="scroller">
<roundcube:object name="mailboxlist" id="mailboxlist" class="listing" folder_filter="mail" unreadwrap="%s" />
</div>
</div>
</div>
</div><!-- end mailview-left -->
<div id="mailview-right" class="uibox" style="top: 42px">
<div id="messagecontent">
<div id="messageheader">
<h3 class="subject"><roundcube:object name="messageHeaders" valueOf="subject" /></h3>
<a href="#details" id="previewheaderstoggle"><span class="iconlink"></span><span id="headerstoggleall" class="iconlink allheaders"></span></a>
<div id="mailview-right">
<div id="contactphoto"><roundcube:object name="contactphoto" /></div>
<div id="mailview-top">
<div id="messageheader" class="uibox">
<h2 class="subject"><roundcube:object name="messageHeaders" valueOf="subject" /></h2>
<roundcube:object name="messageHeaders" class="headers-table" addicon="/images/addcontact.png" exclude="subject" />
<roundcube:object name="messageFullHeaders" id="full-headers" />
<table class="headers-table" id="preview-shortheaders"><tbody><tr>
<roundcube:if condition="env:mailbox == config:drafts_mbox || env:mailbox == config:sent_mbox">
<td class="header-title"><roundcube:label name="to" /></td>
<td class="header from"><roundcube:object name="messageHeaders" valueOf="to" addicon="/images/addcontact.png" /></td>
<roundcube:else />
<td class="header-title"><roundcube:label name="from" /></td>
<td class="header from"><roundcube:object name="messageHeaders" valueOf="from" addicon="/images/addcontact.png" /></td>
<roundcube:endif />
<td class="header-title"><roundcube:label name="date" /></td>
<td class="header from"><roundcube:object name="messageHeaders" valueOf="date" /></td>
</tr></tbody></table>
<roundcube:object name="messageHeaders" id="preview-allheaders" class="headers-table" addicon="/images/addcontact.png" exclude="subject,replyto" />
<roundcube:object name="messageFullHeaders" no-switch="true" />
<!-- record navigation -->
<div id="countcontrols" class="pagenav">
@ -46,24 +64,21 @@
<roundcube:button command="nextmessage" type="link" class="button nextpage disabled" classAct="button nextpage" classSel="button nextpage pressed" innerClass="inner" title="nextmessage" content="&amp;gt;" />
</div>
<div id="contactphoto"><roundcube:object name="contactphoto" /></div>
</div>
</div><!-- end messageheader -->
<div id="messagecontent" class="uibox">
<div class="rightcol">
<roundcube:object name="messageAttachments" id="attachment-list" class="attachmentslist" />
</div>
<div class="leftcol">
<roundcube:object name="messageObjects" id="message-objects" />
<roundcube:object name="messageBody" id="messagebody" />
</div>
<div id="messagepreview">
<div class="rightcol">
<roundcube:object name="messageAttachments" id="attachment-list" class="attachmentslist" />
</div>
<div class="leftcol">
<roundcube:object name="messageObjects" id="message-objects" />
<roundcube:object name="messageBody" id="messagebody" />
</div>
</div>
</div><!-- end mailview-top -->
</div><!-- end messagecontent -->
<div id="mailview-bottom" class="uibox">
<roundcube:object name="message" id="message" class="statusbar" />
</div>
</div><!-- end mailview-right -->

@ -27,8 +27,6 @@
</div>
<div id="mailview-right">
<!-- toolbar -->
<div id="messagetoolbar" class="fullwidth">
<div id="mailtoolbar" class="toolbar">
@ -36,11 +34,11 @@
</div>
</div>
<div id="mailview-top" class="uibox watermark"></div>
<div id="mailview-right" class="uibox" style="top: 42px">
<div id="mailview-bottom" class="uibox">
<roundcube:object name="message" id="message" class="statusbar" />
</div>
<div id="messagecontent" class="watermark"></div>
<roundcube:object name="message" id="message" class="statusbar" />
</div><!-- end mailview-right -->

@ -6,10 +6,10 @@
</head>
<body class="iframe fullheight">
<div id="messagepreviewheader">
<div id="messageheader">
<h3 class="subject"><roundcube:object name="messageHeaders" valueOf="subject" /></h3>
<a href="#details" id="previewheaderstoggle"><span class="iconlink"></span></a>
<a href="#details" id="previewheaderstoggle"><span class="iconlink"></span><span id="headerstoggleall" class="iconlink allheaders"></a>
<div id="contactphoto"><roundcube:object name="contactphoto" /></div>
<table class="headers-table" id="preview-shortheaders"><tbody><tr>
@ -25,6 +25,7 @@
</tr></tbody></table>
<roundcube:object name="messageHeaders" id="preview-allheaders" class="headers-table" addicon="/images/addcontact.png" exclude="subject,replyto" />
<roundcube:object name="messageFullHeaders" no-switch="true" />
<!-- record navigation -->
<div id="countcontrols" class="pagenav">

@ -74,9 +74,8 @@ function rcube_mail_ui()
if (rcmail.env.action == 'show' || rcmail.env.action == 'preview') {
layout_messageview();
rcmail.addEventListener('aftershow-headers', function() { layout_messageview(); });
rcmail.addEventListener('afterhide-headers', function() { layout_messageview(); });
$('#previewheaderstoggle').click(function(e){ toggle_preview_headers(this); return false });
$('#previewheaderstoggle').click(function(e){ toggle_preview_headers(this); return false; });
$('#headerstoggleall').click(function(e){ toggle_all_headers(this); return false; });
}
else if (rcmail.env.action == 'compose') {
rcmail.addEventListener('aftertoggle-editor', function(){ window.setTimeout(function(){ layout_composeview() }, 200); });
@ -164,6 +163,12 @@ function rcube_mail_ui()
}
}
// set min-width to show all toolbar buttons
var screen = $('.minwidth');
if (screen.length) {
screen.css('min-width', $('.toolbar').width() + $('#quicksearchbar').parent().width() + 20);
}
// turn a group of fieldsets into tabs
$('.tabbed').each(function(idx, elem){ init_tabs(elem); })
@ -254,11 +259,11 @@ function rcube_mail_ui()
*/
function resize()
{
if (rcmail.env.task == 'mail' && (rcmail.env.action == 'show' || rcmail.env.action == 'preview')) {
layout_messageview();
}
if (rcmail.env.task == 'mail' && rcmail.env.action == 'compose') {
layout_composeview();
if (rcmail.env.task == 'mail') {
if (rcmail.env.action == 'show' || rcmail.env.action == 'preview')
layout_messageview();
else if (rcmail.env.action == 'compose')
layout_composeview();
}
// make iframe footer buttons float if scrolling is active
@ -267,13 +272,13 @@ function rcube_mail_ui()
body = $(document.body),
floating = footer.hasClass('floating'),
overflow = body.outerHeight(true) > $(window).height();
if (overflow != floating) {
var action = overflow ? 'addClass' : 'removeClass';
footer[action]('floating');
body[action]('floatingbuttons');
}
})
});
}
/**
@ -315,7 +320,6 @@ function rcube_mail_ui()
*/
function layout_messageview()
{
$('#messagecontent').css('top', ($('#messageheader').outerHeight() + 10) + 'px');
$('#message-objects div a').addClass('button');
if (!$('#attachment-list li').length) {
@ -461,7 +465,7 @@ function rcube_mail_ui()
var button = $(e.target),
frame = $('#mailpreviewframe'),
visible = !frame.is(':visible'),
splitter = mailviewsplit.pos || parseInt(bw.get_cookie('mailviewsplitter') || 320),
splitter = mailviewsplit.pos || parseInt(rcmail.get_cookie('mailviewsplitter') || 320),
topstyles, bottomstyles, uid;
frame.toggle();
@ -508,13 +512,31 @@ function rcube_mail_ui()
{
$('#preview-shortheaders').toggle();
var full = $('#preview-allheaders').toggle(),
button = $('a#previewheaderstoggle');
button = $('#previewheaderstoggle');
if (!$('#headerstoggleall').length)
$('#all-headers').toggle();
// add toggle button to full headers table
if (full.is(':visible'))
button.attr('href', '#hide').removeClass('add').addClass('remove')
else
button.attr('href', '#details').removeClass('remove').addClass('add')
if (full.is(':visible')) {
button.attr('href', '#hide').removeClass('add').addClass('remove');
}
else {
button.attr('href', '#details').removeClass('remove').addClass('add');
}
}
/**
* Show/hide all message headers
*/
function toggle_all_headers(button)
{
rcmail.command('show-headers', '', button);
$(button).remove();
$('#previewheaderstoggle span').css({bottom: '5px'});
return false;
}
@ -847,6 +869,8 @@ function rcube_mail_ui()
// Select/unselect tab
$('#tab'+idx).toggleClass('selected', idx==index);
});
resize();
}
/**
@ -974,7 +998,7 @@ function rcube_splitter(p)
$(window).resize(onResize);
// read saved position from cookie
var cookie = bw.get_cookie(this.id);
var cookie = rcmail.get_cookie(this.id);
if (cookie && !isNaN(cookie)) {
this.pos = parseFloat(cookie);
this.resize();
@ -1135,7 +1159,7 @@ function rcube_splitter(p)
{
var exp = new Date();
exp.setYear(exp.getFullYear() + 1);
bw.set_cookie(this.id, this.pos, exp);
rcmail.set_cookie(this.id, this.pos, exp);
};
} // end class rcube_splitter

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_base_replacer class
*
* @package Tests
*/
class Framework_BaseReplacer extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_base_replacer('test');
$this->assertInstanceOf('rcube_base_replacer', $object, "Class constructor");
}
}

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_browser class
*
* @package Tests
*/
class Framework_Browser extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_browser();
$this->assertInstanceOf('rcube_browser', $object, "Class constructor");
}
}

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_cache class
*
* @package Tests
*/
class Framework_Cache extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_cache('db', 1);
$this->assertInstanceOf('rcube_cache', $object, "Class constructor");
}
}

@ -0,0 +1,28 @@
<?php
/**
* Test class to test rcube_charset class
*
* @package Tests
*/
class Framework_Charset extends PHPUnit_Framework_TestCase
{
/**
* Data for test_clean()
*/
function data_clean()
{
return array(
array('', '', 'Empty string'),
);
}
/**
* @dataProvider data_clean
*/
function test_clean($input, $output, $title)
{
$this->assertEquals(rcube_charset::clean($input), $output, $title);
}
}

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_content_filter class
*
* @package Tests
*/
class Framework_ContentFilter extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_content_filter();
$this->assertInstanceOf('rcube_content_filter', $object, "Class constructor");
}
}

@ -0,0 +1,46 @@
<?php
/**
* Test class to test rcube_html class
*
* @package Tests
*/
class Framework_Html extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new html;
$this->assertInstanceOf('html', $object, "Class constructor");
}
/**
* Data for test_quote()
*/
function data_quote()
{
return array(
array('abc', 'abc'),
array('?', '?'),
array('"', '&quot;'),
array('<', '&lt;'),
array('>', '&gt;'),
array('&', '&amp;'),
array('&amp;', '&amp;amp;'),
array('&amp;', '&amp;', true),
);
}
/**
* Test for quote()
* @dataProvider data_quote
*/
function test_quote($str, $result, $validate = false)
{
$this->assertEquals(html::quote($str, $validate), $result);
}
}

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_image class
*
* @package Tests
*/
class Framework_Image extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_image('test');
$this->assertInstanceOf('rcube_image', $object, "Class constructor");
}
}

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_imap class
*
* @package Tests
*/
class Framework_Imap extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_imap;
$this->assertInstanceOf('rcube_imap', $object, "Class constructor");
}
}

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_imap_generic class
*
* @package Tests
*/
class Framework_ImapGeneric extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_imap_generic;
$this->assertInstanceOf('rcube_imap_generic', $object, "Class constructor");
}
}

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_message_header class
*
* @package Tests
*/
class Framework_MessageHeader extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_message_header;
$this->assertInstanceOf('rcube_message_header', $object, "Class constructor");
}
}

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_message_part class
*
* @package Tests
*/
class Framework_MessagePart extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_message_part;
$this->assertInstanceOf('rcube_message_part', $object, "Class constructor");
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save