Permalink
Browse files

Merge https://github.com/roundcube/roundcubemail into crypt_hash_branch

  • Loading branch information...
defa committed Sep 5, 2012
2 parents 5c603c4 + e263994 commit 921408eba600a7dc51271c35480e9114cac5ecec
Showing with 625 additions and 684 deletions.
  1. +8 −0 CHANGELOG
  2. +1 −2 plugins/acl/acl.php
  3. +4 −0 plugins/acl/skins/larry/acl.css
  4. +4 −4 plugins/acl/skins/larry/templates/table.html
  5. +0 −7 plugins/managesieve/tests/Makefile
  6. +54 −0 plugins/managesieve/tests/Parser.php
  7. +33 −0 plugins/managesieve/tests/Tokenizer.php
  8. +0 −120 plugins/managesieve/tests/parser.phpt
  9. +0 −49 plugins/managesieve/tests/parser_body.phpt
  10. +0 −28 plugins/managesieve/tests/parser_imapflags.phpt
  11. +0 −30 plugins/managesieve/tests/parser_include.phpt
  12. +0 −19 plugins/managesieve/tests/parser_kep14.phpt
  13. +0 −25 plugins/managesieve/tests/parser_prefix.phpt
  14. +0 −25 plugins/managesieve/tests/parser_relational.phpt
  15. +0 −39 plugins/managesieve/tests/parser_vacation.phpt
  16. +0 −39 plugins/managesieve/tests/parser_variables.phpt
  17. +0 −38 plugins/managesieve/tests/parset_subaddress.phpt
  18. +52 −0 plugins/managesieve/tests/src/parser
  19. +52 −0 plugins/managesieve/tests/src/parser.out
  20. +17 −0 plugins/managesieve/tests/src/parser_body
  21. +7 −0 plugins/managesieve/tests/src/parser_imapflags
  22. +7 −0 plugins/managesieve/tests/src/parser_include
  23. +2 −0 plugins/managesieve/tests/src/parser_kep14
  24. +3 −0 plugins/managesieve/tests/src/parser_kep14.out
  25. +5 −0 plugins/managesieve/tests/src/parser_prefix
  26. +6 −0 plugins/managesieve/tests/src/parser_relational
  27. +11 −0 plugins/managesieve/tests/src/parser_subaddress
  28. +12 −0 plugins/managesieve/tests/src/parser_vacation
  29. +12 −0 plugins/managesieve/tests/src/parser_variables
  30. +0 −66 plugins/managesieve/tests/tokenize.phpt
  31. +4 −0 plugins/password/drivers/virtualmin.php
  32. +6 −0 program/include/rcube_charset.php
  33. +4 −0 program/include/rcube_imap.php
  34. +3 −2 program/include/rcube_imap_generic.php
  35. +19 −7 program/include/rcube_message.php
  36. +30 −1 program/include/rcube_output_html.php
  37. +0 −2 program/include/rcube_shared.inc
  38. +1 −1 program/include/rcube_storage.php
  39. +57 −38 program/js/app.js
  40. +2 −2 program/js/list.js
  41. +10 −3 program/steps/mail/func.inc
  42. +2 −1 program/steps/mail/headers.inc
  43. +3 −1 program/steps/settings/folders.inc
  44. +4 −1 program/steps/settings/save_folder.inc
  45. +2 −13 skins/classic/templates/message.html
  46. +2 −13 skins/classic/templates/messageerror.html
  47. +0 −1 skins/larry/addressbook.css
  48. +3 −3 skins/larry/ie7hacks.css
  49. +1 −1 skins/larry/iehacks.css
  50. BIN skins/larry/images/contactpic_32px.png
  51. BIN skins/larry/images/contactpic_48px.png
  52. +40 −50 skins/larry/mail.css
  53. +4 −2 skins/larry/styles.css
  54. +2 −0 skins/larry/svggradient.php
  55. +1 −1 skins/larry/svggradients.css
  56. +38 −23 skins/larry/templates/message.html
  57. +4 −6 skins/larry/templates/messageerror.html
  58. +3 −2 skins/larry/templates/messagepreview.html
  59. +40 −16 skins/larry/ui.js
  60. +43 −0 tests/Framework/Shared.php
  61. +2 −2 tests/HtmlToText.php
  62. +1 −1 tests/MailFunc.php
  63. +4 −0 tests/phpunit.xml
View
@@ -1,6 +1,14 @@
CHANGELOG Roundcube Webmail
===========================
- 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)
View
@@ -233,8 +233,7 @@ function templ_rights($attrib)
// 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 />
@@ -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
Oops, something went wrong.

0 comments on commit 921408e

Please sign in to comment.