diff options
146 files changed, 1617 insertions, 707 deletions
diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..0e7d70f2a7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +# This file is for standardising the coding style between different editors +# http://editorconfig.org/ + +root = true + +[*] +end_of_line = lf +indent_size = 4 +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.yml] +indent_size = 4 +indent_style = space diff --git a/build/build.xml b/build/build.xml index ca71aae924..56fe802824 100644 --- a/build/build.xml +++ b/build/build.xml @@ -2,9 +2,9 @@ <project name="phpBB" description="The phpBB forum software" default="all" basedir="../"> <!-- a few settings for the build --> - <property name="newversion" value="3.1.0-RC3-dev" /> - <property name="prevversion" value="3.1.0-RC2" /> - <property name="olderversions" value="3.0.12, 3.1.0-a1, 3.1.0-a2, 3.1.0-a3, 3.1.0-b1, 3.1.0-b2, 3.1.0-b3, 3.1.0-b4, 3.1.0-RC1" /> + <property name="newversion" value="3.1.0-RC4-dev" /> + <property name="prevversion" value="3.1.0-RC3" /> + <property name="olderversions" value="3.0.12, 3.1.0-a1, 3.1.0-a2, 3.1.0-a3, 3.1.0-b1, 3.1.0-b2, 3.1.0-b3, 3.1.0-b4, 3.1.0-RC1, 3.1.0-RC2" /> <!-- no configuration should be needed beyond this point --> <property name="oldversions" value="${olderversions}, ${prevversion}" /> diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index 6049673e0a..d24d62497d 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -117,7 +117,6 @@ <dl> <dt><label>{L_AVATAR_TYPE}{L_COLON}</label></dt> <dd><select name="avatar_driver" id="avatar_driver" data-togglable-settings="true"> - <option value="">{L_NO_AVATAR}</option> <!-- BEGIN avatar_drivers --> <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting="#avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option> <!-- END avatar_drivers --> diff --git a/phpBB/adm/style/acp_users_avatar.html b/phpBB/adm/style/acp_users_avatar.html index 8ad4ad710b..8466985fb3 100644 --- a/phpBB/adm/style/acp_users_avatar.html +++ b/phpBB/adm/style/acp_users_avatar.html @@ -14,7 +14,6 @@ <dl> <dt><label>{L_AVATAR_TYPE}</label></dt> <dd><select name="avatar_driver" id="avatar_driver" data-togglable-settings="true"> - <option value="">{L_NO_AVATAR}</option> <!-- BEGIN avatar_drivers --> <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting="#avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option> <!-- END avatar_drivers --> diff --git a/phpBB/composer.json b/phpBB/composer.json index e74dd120f0..69f0de8479 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -44,6 +44,7 @@ "sami/sami": "1.*", "squizlabs/php_codesniffer": "1.*", "symfony/browser-kit": "2.3.*", + "symfony/css-selector": "2.3.*", "symfony/debug": "2.3.*", "symfony/dom-crawler": "2.3.*", "symfony/filesystem": "2.3.*", diff --git a/phpBB/composer.lock b/phpBB/composer.lock index 671daa70e1..b686bfef5c 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -3,7 +3,7 @@ "This file locks the dependencies of your project to a known state", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "27d5da149e0b5d76b76f43210306b666", + "hash": "d93446768ea0665b7c55c01890153a67", "packages": [ { "name": "lusitanian/oauth", @@ -108,17 +108,17 @@ }, { "name": "symfony/config", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/Config", "source": { "type": "git", "url": "https://github.com/symfony/Config.git", - "reference": "259722b5f2e87d3f487630abfd40f922cf2f6900" + "reference": "b34d2b32a92938476f0689486e7a11ea1aeb079e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/259722b5f2e87d3f487630abfd40f922cf2f6900", - "reference": "259722b5f2e87d3f487630abfd40f922cf2f6900", + "url": "https://api.github.com/repos/symfony/Config/zipball/b34d2b32a92938476f0689486e7a11ea1aeb079e", + "reference": "b34d2b32a92938476f0689486e7a11ea1aeb079e", "shasum": "" }, "require": { @@ -142,33 +142,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Config Component", "homepage": "http://symfony.com", - "time": "2014-04-22 08:09:28" + "time": "2014-08-02 07:53:48" }, { "name": "symfony/console", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "c6c5a354a9945a5e9a9a6a495ca19558eb8639e9" + "reference": "a2723f99716c2fa6411e2eb5842edbe680e4b462" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/c6c5a354a9945a5e9a9a6a495ca19558eb8639e9", - "reference": "c6c5a354a9945a5e9a9a6a495ca19558eb8639e9", + "url": "https://api.github.com/repos/symfony/Console/zipball/a2723f99716c2fa6411e2eb5842edbe680e4b462", + "reference": "a2723f99716c2fa6411e2eb5842edbe680e4b462", "shasum": "" }, "require": { @@ -197,33 +195,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2014-05-14 13:35:53" + "time": "2014-08-07 15:55:24" }, { "name": "symfony/debug", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/Debug", "source": { "type": "git", "url": "https://github.com/symfony/Debug.git", - "reference": "ca764f8af9cc4ba5d81b598c1b18b30db5508e18" + "reference": "91e3a1480c67601d2406cd938735abe0243e1c95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Debug/zipball/ca764f8af9cc4ba5d81b598c1b18b30db5508e18", - "reference": "ca764f8af9cc4ba5d81b598c1b18b30db5508e18", + "url": "https://api.github.com/repos/symfony/Debug/zipball/91e3a1480c67601d2406cd938735abe0243e1c95", + "reference": "91e3a1480c67601d2406cd938735abe0243e1c95", "shasum": "" }, "require": { @@ -255,33 +251,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Debug Component", "homepage": "http://symfony.com", - "time": "2014-04-29 19:42:43" + "time": "2014-07-07 10:13:42" }, { "name": "symfony/dependency-injection", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/DependencyInjection", "source": { "type": "git", "url": "https://github.com/symfony/DependencyInjection.git", - "reference": "5ebd813eac59b4051705a2e29e32f211a966b6ca" + "reference": "5ee5795515be251c56057d79154e561ee1efecd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/5ebd813eac59b4051705a2e29e32f211a966b6ca", - "reference": "5ebd813eac59b4051705a2e29e32f211a966b6ca", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/5ee5795515be251c56057d79154e561ee1efecd2", + "reference": "5ee5795515be251c56057d79154e561ee1efecd2", "shasum": "" }, "require": { @@ -313,33 +307,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony DependencyInjection Component", "homepage": "http://symfony.com", - "time": "2014-05-02 22:42:57" + "time": "2014-08-27 08:32:18" }, { "name": "symfony/event-dispatcher", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "cb7cd38c081507d10997553c4c522956a4d2afab" + "reference": "2c64e46d7e22bcafcab4413ff62bc389abf87ea5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/cb7cd38c081507d10997553c4c522956a4d2afab", - "reference": "cb7cd38c081507d10997553c4c522956a4d2afab", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/2c64e46d7e22bcafcab4413ff62bc389abf87ea5", + "reference": "2c64e46d7e22bcafcab4413ff62bc389abf87ea5", "shasum": "" }, "require": { @@ -369,33 +361,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony EventDispatcher Component", "homepage": "http://symfony.com", - "time": "2014-04-16 10:30:19" + "time": "2014-07-25 15:00:14" }, { "name": "symfony/filesystem", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "69e476c4db31c43ab7ab797adc5fc73d20aa5571" + "reference": "007359d2822d5eba4f04f6507bc9b46877c622b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/69e476c4db31c43ab7ab797adc5fc73d20aa5571", - "reference": "69e476c4db31c43ab7ab797adc5fc73d20aa5571", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/007359d2822d5eba4f04f6507bc9b46877c622b4", + "reference": "007359d2822d5eba4f04f6507bc9b46877c622b4", "shasum": "" }, "require": { @@ -418,33 +408,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Filesystem Component", "homepage": "http://symfony.com", - "time": "2014-04-16 10:30:19" + "time": "2014-08-31 03:30:23" }, { "name": "symfony/http-foundation", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/HttpFoundation", "source": { "type": "git", "url": "https://github.com/symfony/HttpFoundation.git", - "reference": "ad7891d4dfe221c5a9edca64b71bdb500f5b026a" + "reference": "d0125fed988da9e189864c2e6de967b3ee7f1d98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/ad7891d4dfe221c5a9edca64b71bdb500f5b026a", - "reference": "ad7891d4dfe221c5a9edca64b71bdb500f5b026a", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/d0125fed988da9e189864c2e6de967b3ee7f1d98", + "reference": "d0125fed988da9e189864c2e6de967b3ee7f1d98", "shasum": "" }, "require": { @@ -470,33 +458,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony HttpFoundation Component", "homepage": "http://symfony.com", - "time": "2014-05-22 16:20:26" + "time": "2014-09-03 07:39:11" }, { "name": "symfony/http-kernel", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/HttpKernel", "source": { "type": "git", "url": "https://github.com/symfony/HttpKernel.git", - "reference": "d8c00747f592183692afaacf622c444c36092613" + "reference": "a24817f69012b23ce7c554af6b4c7b53235c7c55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/d8c00747f592183692afaacf622c444c36092613", - "reference": "d8c00747f592183692afaacf622c444c36092613", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/a24817f69012b23ce7c554af6b4c7b53235c7c55", + "reference": "a24817f69012b23ce7c554af6b4c7b53235c7c55", "shasum": "" }, "require": { @@ -543,33 +529,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony HttpKernel Component", "homepage": "http://symfony.com", - "time": "2014-05-31 02:04:21" + "time": "2014-09-03 09:45:27" }, { "name": "symfony/routing", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/Routing", "source": { "type": "git", "url": "https://github.com/symfony/Routing.git", - "reference": "6e4c9024a04340b83e456a1a24597dba066dcdc9" + "reference": "aa2beef5d5f1d84250b5ca73a4056c0504e5969e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/6e4c9024a04340b83e456a1a24597dba066dcdc9", - "reference": "6e4c9024a04340b83e456a1a24597dba066dcdc9", + "url": "https://api.github.com/repos/symfony/Routing/zipball/aa2beef5d5f1d84250b5ca73a4056c0504e5969e", + "reference": "aa2beef5d5f1d84250b5ca73a4056c0504e5969e", "shasum": "" }, "require": { @@ -603,33 +587,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Routing Component", "homepage": "http://symfony.com", - "time": "2014-04-23 13:35:47" + "time": "2014-08-15 09:05:55" }, { "name": "symfony/yaml", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "2e257c292cfce88bf6c894a03d0fe8d782055aee" + "reference": "71ceeca3d8164f0c5313127b24ad056071ccf2c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/2e257c292cfce88bf6c894a03d0fe8d782055aee", - "reference": "2e257c292cfce88bf6c894a03d0fe8d782055aee", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/71ceeca3d8164f0c5313127b24ad056071ccf2c6", + "reference": "71ceeca3d8164f0c5313127b24ad056071ccf2c6", "shasum": "" }, "require": { @@ -652,19 +634,17 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-05-12 09:13:35" + "time": "2014-08-28 01:42:35" }, { "name": "twig/twig", @@ -2007,17 +1987,17 @@ }, { "name": "symfony/browser-kit", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/BrowserKit", "source": { "type": "git", "url": "https://github.com/symfony/BrowserKit.git", - "reference": "bc6cb0fe5196ecfe183483791928ed525ac41728" + "reference": "262d698efaa788ce24ff9c987378789bf3f81ce9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/bc6cb0fe5196ecfe183483791928ed525ac41728", - "reference": "bc6cb0fe5196ecfe183483791928ed525ac41728", + "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/262d698efaa788ce24ff9c987378789bf3f81ce9", + "reference": "262d698efaa788ce24ff9c987378789bf3f81ce9", "shasum": "" }, "require": { @@ -2048,33 +2028,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony BrowserKit Component", "homepage": "http://symfony.com", - "time": "2014-04-22 14:58:51" + "time": "2014-08-05 07:20:55" }, { "name": "symfony/css-selector", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/CssSelector", "source": { "type": "git", "url": "https://github.com/symfony/CssSelector.git", - "reference": "2ff53e8a7870b453836e879b083b971d455e174d" + "reference": "8953d325d3341c246abadb79be172de95ef80664" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/CssSelector/zipball/2ff53e8a7870b453836e879b083b971d455e174d", - "reference": "2ff53e8a7870b453836e879b083b971d455e174d", + "url": "https://api.github.com/repos/symfony/CssSelector/zipball/8953d325d3341c246abadb79be172de95ef80664", + "reference": "8953d325d3341c246abadb79be172de95ef80664", "shasum": "" }, "require": { @@ -2097,37 +2075,35 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" }, { "name": "Jean-François Simon", "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony CssSelector Component", "homepage": "http://symfony.com", - "time": "2014-05-12 09:13:35" + "time": "2014-08-27 08:24:06" }, { "name": "symfony/dom-crawler", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/DomCrawler", "source": { "type": "git", "url": "https://github.com/symfony/DomCrawler.git", - "reference": "5dd259d7842480fa7c5d4a45c4f911bd6fb60bc8" + "reference": "bad8d98561f071639fa67b20680bffcc256ce252" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/5dd259d7842480fa7c5d4a45c4f911bd6fb60bc8", - "reference": "5dd259d7842480fa7c5d4a45c4f911bd6fb60bc8", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/bad8d98561f071639fa67b20680bffcc256ce252", + "reference": "bad8d98561f071639fa67b20680bffcc256ce252", "shasum": "" }, "require": { @@ -2156,33 +2132,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony DomCrawler Component", "homepage": "http://symfony.com", - "time": "2014-05-26 22:15:18" + "time": "2014-08-21 00:21:59" }, { "name": "symfony/finder", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/Finder", "source": { "type": "git", "url": "https://github.com/symfony/Finder.git", - "reference": "32949721cc76afd75e4ac60d14ac3cf55b10a768" + "reference": "f7a5a5a3b1fc0ec9a1a5b4429223a8726e0f4b55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/32949721cc76afd75e4ac60d14ac3cf55b10a768", - "reference": "32949721cc76afd75e4ac60d14ac3cf55b10a768", + "url": "https://api.github.com/repos/symfony/Finder/zipball/f7a5a5a3b1fc0ec9a1a5b4429223a8726e0f4b55", + "reference": "f7a5a5a3b1fc0ec9a1a5b4429223a8726e0f4b55", "shasum": "" }, "require": { @@ -2205,33 +2179,31 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Finder Component", "homepage": "http://symfony.com", - "time": "2014-05-22 13:42:36" + "time": "2014-08-31 04:03:32" }, { "name": "symfony/process", - "version": "v2.3.16", + "version": "v2.3.19", "target-dir": "Symfony/Component/Process", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "2cd7d075df6cb0d564c069a66408b3877c07d4e3" + "reference": "b8fc0e4b6750e4c458a38d038e6b4d538d4fe2bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/2cd7d075df6cb0d564c069a66408b3877c07d4e3", - "reference": "2cd7d075df6cb0d564c069a66408b3877c07d4e3", + "url": "https://api.github.com/repos/symfony/Process/zipball/b8fc0e4b6750e4c458a38d038e6b4d538d4fe2bb", + "reference": "b8fc0e4b6750e4c458a38d038e6b4d538d4fe2bb", "shasum": "" }, "require": { @@ -2254,19 +2226,17 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Process Component", "homepage": "http://symfony.com", - "time": "2014-05-17 21:49:26" + "time": "2014-08-28 09:02:24" } ], "aliases": [ diff --git a/phpBB/config/auth_providers.yml b/phpBB/config/auth_providers.yml index db7c603bcd..89303a684a 100644 --- a/phpBB/config/auth_providers.yml +++ b/phpBB/config/auth_providers.yml @@ -52,6 +52,7 @@ services: - %tables.auth_provider_oauth_account_assoc% - @auth.provider.oauth.service_collection - %tables.users% + - @service_container - %core.root_path% - %core.php_ext% tags: diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 71971108b1..d882d2e3f4 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -46,8 +46,9 @@ <ol> <li><a href="#changelog">Changelog</a> <ol style="list-style-type: lower-roman;"> - <li><a href="#v310b3">Changes since 3.1.0-RC1</a></li> - <li><a href="#v310b3">Changes since 3.1.0-b4</a></li> + <li><a href="#v310RC2">Changes since 3.1.0-RC2</a></li> + <li><a href="#v310RC1">Changes since 3.1.0-RC1</a></li> + <li><a href="#v310b4">Changes since 3.1.0-b4</a></li> <li><a href="#v310b3">Changes since 3.1.0-b3</a></li> <li><a href="#v310b2">Changes since 3.1.0-b2</a></li> <li><a href="#v310b1">Changes since 3.1.0-b1</a></li> @@ -95,7 +96,131 @@ <div class="content"> - <a name="v310RC1"></a><h3>1.i. Changes since 3.1.0-RC1</h3> + <a name="v310RC2"></a><h3>1.i. Changes since 3.1.0-RC2</h3> + + <h4>Bug</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11148">PHPBB3-11148</a>] - Fix uploading attachments from Android 4 powered devices</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11480">PHPBB3-11480</a>] - Prevent Private Message system from returning "Unknown folder" when inbox folder is full</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11520">PHPBB3-11520</a>] - Post count not incremented when you fork a topic</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11854">PHPBB3-11854</a>] - Captcha code is still in includes/</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12232">PHPBB3-12232</a>] - MCP Banning: Max execution time exceeded</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12448">PHPBB3-12448</a>] - Migration tools don't allow adding columns with default == NULL</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12492">PHPBB3-12492</a>] - DB_TEST: Special chars are not supported.</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12535">PHPBB3-12535</a>] - The profile link should be better adjusted to the avatar image it surrounds in viewtopic.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12685">PHPBB3-12685</a>] - CLI doesn't load extension commands</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12710">PHPBB3-12710</a>] - phpBB 3.0.12 on Oracle fails to upgrade to 3.1.0</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12718">PHPBB3-12718</a>] - Hard Deleting Post does not Decrease Post Count</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12742">PHPBB3-12742</a>] - Notifications duplicate code that requires an event</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12744">PHPBB3-12744</a>] - RTL board header is one line higher than LTR</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12748">PHPBB3-12748</a>] - UCP Terms of Use Typo</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12770">PHPBB3-12770</a>] - search_wordmatch unique key name is too long</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12776">PHPBB3-12776</a>] - docs/INSTALL.html is missing 3.0 to 3.1 update instructions</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12789">PHPBB3-12789</a>] - Cached directories are not deleted when the cache is purged (with ACM memory enabled).</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12791">PHPBB3-12791</a>] - String profile fields do not use links, smilies and line breaks in memberlist</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12792">PHPBB3-12792</a>] - Profile field type strings function get_profile_contact_value duplicates raw()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12793">PHPBB3-12793</a>] - String '0' does not display for string profile fields</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12794">PHPBB3-12794</a>] - Google+ profile field validation is too strict</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12809">PHPBB3-12809</a>] - RTL styling issues with new jump-box dropdown</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12814">PHPBB3-12814</a>] - Error while trying to setup LDAP Authentication in ACP</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12822">PHPBB3-12822</a>] - Preselect avatar type if only 1 type is enabled</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12837">PHPBB3-12837</a>] - Viewing contact form displays "VIEWING_MEMBERS" on viewonline</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12842">PHPBB3-12842</a>] - Out of memory issue in code sniffer call for extensions</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12843">PHPBB3-12843</a>] - When you click on "Mark forums read" in the browser, a console error occurs</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12844">PHPBB3-12844</a>] - $dbpasswd is cleared too early in connection manager</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12845">PHPBB3-12845</a>] - HTML5 Invalid using role="navigation"</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12846">PHPBB3-12846</a>] - SQLite3 bug in profilefield_base_migration.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12849">PHPBB3-12849</a>] - ReferenceError in core.js</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12851">PHPBB3-12851</a>] - Font colour button title is not consistent with other buttons</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12853">PHPBB3-12853</a>] - Problems with ACP/MCP links in mobile design with other translations</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12854">PHPBB3-12854</a>] - Admin contact page should not be used when board emails are disabled</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12855">PHPBB3-12855</a>] - Container is being recompiled on every page request although DEBUG_CONTAINER is not set</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12859">PHPBB3-12859</a>] - Missing post button events from view pm template</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12870">PHPBB3-12870</a>] - Console database migrate function can not update from 3.0.12 to 3.1</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12873">PHPBB3-12873</a>] - Wrong identifier tested in \db\tools\sql_create_(unique_)index()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12875">PHPBB3-12875</a>] - Extension's info_acp_lang files don't fallback correctly when the user's language is not included in the extension</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12881">PHPBB3-12881</a>] - Debug error - Undefined index: mark_time</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12882">PHPBB3-12882</a>] - $config['search_type'] - is not correctly updated when updating from 3.0 to 3.1</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12883">PHPBB3-12883</a>] - Do not use basename() to get the search class in phpbb\cron\task\core\tidy_search</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12886">PHPBB3-12886</a>] - Redundant lock and unlock expressions for QuickMod in viewtopic.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12887">PHPBB3-12887</a>] - Typo in timezone handling code: 'offest' should be 'offset'</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12891">PHPBB3-12891</a>] - Long page generation time when banlist is long</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12895">PHPBB3-12895</a>] - ?style=1 appended to url after using the UCP</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12898">PHPBB3-12898</a>] - In cron.php we try to release the lock after the call to garbage_collection()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12901">PHPBB3-12901</a>] - Wrong type hint in show_available_child_styles() doc block</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12902">PHPBB3-12902</a>] - Remove duplicate entry in build_cfg_template() switch statement</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12903">PHPBB3-12903</a>] - Remove unused method in phpBB/phpbb/extension/metadata_manager.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12908">PHPBB3-12908</a>] - Fix broken operator assignment in increment.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12909">PHPBB3-12909</a>] - Use correct lang vars in cli extension enable</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12910">PHPBB3-12910</a>] - Profile fields: Two "simple text field" in dropdown menu</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12912">PHPBB3-12912</a>] - Undefined index when adding logs from extensions</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12918">PHPBB3-12918</a>] - Functional Tests Suite does not run on its own</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12919">PHPBB3-12919</a>] - Allow using class names as module identifier for extensions</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12922">PHPBB3-12922</a>] - Posts per page in MCP should have a minimum value of zero</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12931">PHPBB3-12931</a>] - General error on user registration when domain name is not set</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12932">PHPBB3-12932</a>] - Easy support of non-gregorian calendars</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12937">PHPBB3-12937</a>] - Without config file, extract($phpbb_config_php_file->get_all()); breaks</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12938">PHPBB3-12938</a>] - Board floods "store"-directory with packed attachments</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12940">PHPBB3-12940</a>] - Unused 'use' statements in download/file.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12950">PHPBB3-12950</a>] - Functional tests can not be run anymore if another language is present</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12954">PHPBB3-12954</a>] - Nginx setup on travis returns wrong SCRIPT_NAME info</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12956">PHPBB3-12956</a>] - Unknown column 'field_is_contact' in 'field list'</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12964">PHPBB3-12964</a>] - Undefined $row in download/file.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12967">PHPBB3-12967</a>] - Undefined variable: phpbb_dispatcher in mcp_queue.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12970">PHPBB3-12970</a>] - chema.json is not up to date with migration files</li> + </ul> + <h4>Improvement</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9165">PHPBB3-9165</a>] - Extend template loop to allow iteration step modification</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10073">PHPBB3-10073</a>] - Contact page</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12051">PHPBB3-12051</a>] - Optimise Composer Autoloader on Build</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12560">PHPBB3-12560</a>] - Add methods to set upload and temp paths in Plupload class</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12656">PHPBB3-12656</a>] - Translate existing CLI commands</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12663">PHPBB3-12663</a>] - Extract Command Line Interface language strings into their own file.</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12671">PHPBB3-12671</a>] - Possibility to use NOT LIKE expression</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12693">PHPBB3-12693</a>] - Add a travis test that checks file permissions</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12738">PHPBB3-12738</a>] - Move related code from functions_posting into remove_post_from_statistic()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12778">PHPBB3-12778</a>] - The automatic updater should have an option to automatically delete removed files during update</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12828">PHPBB3-12828</a>] - Add includes/ucp/ucp_prefs.php common core event to allow additional actions before the page load</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12832">PHPBB3-12832</a>] - Add footer links to the Quick Links menu</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12836">PHPBB3-12836</a>] - [Event] - core.functions.redirect</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12841">PHPBB3-12841</a>] - Allow extensions to position new config vars in an array</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12847">PHPBB3-12847</a>] - Allow extensions to define if they can be enabled</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12857">PHPBB3-12857</a>] - Add template events overall_header_breadcrumbs_before/after</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12864">PHPBB3-12864</a>] - Have an EVENT tag after STYLESHEETS in overall_header</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12871">PHPBB3-12871</a>] - Add PHPBB_DISPLAY_LOAD_TIME constant to config.php on installation</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12872">PHPBB3-12872</a>] - Add poster_id to viewtopic_modify_post_row</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12884">PHPBB3-12884</a>] - Add core event to the function upload_attachment()</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12892">PHPBB3-12892</a>] - S_NUM_ROWS does not scale</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12896">PHPBB3-12896</a>] - Add event in acp_main to allow php checks for admin notices</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12906">PHPBB3-12906</a>] - Add rel="help" to FAQ link</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12913">PHPBB3-12913</a>] - Add more parameters to core.submit_post_end event</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12942">PHPBB3-12942</a>] - Add core.add_form_key core event</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12944">PHPBB3-12944</a>] - Add core.login_forum_box core event</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12953">PHPBB3-12953</a>] - Page title not updated when notifications are marked as read</li> + </ul> + <h4>Sub-task</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12800">PHPBB3-12800</a>] - [Event] - Create core.functions_display.display_user_activity.actives_after</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12801">PHPBB3-12801</a>] - [Event] - core.functions_posting.load_drafts_draft_list_results</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12876">PHPBB3-12876</a>] - [Event] - core.mcp_mcp_front.mcp_front_view_queue_postid_list_after</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12880">PHPBB3-12880</a>] - [Event] - core.mcp_queue_!is_topics_query_before</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12927">PHPBB3-12927</a>] - [Event] - core.mcp_queue_get_posts2_query_before</li> + </ul> + <h4>Task</h4> + <ul> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10404">PHPBB3-10404</a>] - Remove create_function from includes/acp/auth.php</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12557">PHPBB3-12557</a>] - Fix doc block errors found by Sami</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12826">PHPBB3-12826</a>] - Investigate "catch (Exception"</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12860">PHPBB3-12860</a>] - Add template events to mcp_ban.html</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12861">PHPBB3-12861</a>] - Add event before assigning the posts to the template</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12917">PHPBB3-12917</a>] - Move commit check and file executable checks to 5.3.3 build on travis</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12920">PHPBB3-12920</a>] - Create composer installable app and core packages with subtree split</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12941">PHPBB3-12941</a>] - Check for Sami documentation errors on Travis CI</li> + <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12948">PHPBB3-12948</a>] - Remove Travis CI "broken opcache on PHP 5.5.7 and 5.5.8" workaround.</li> + </ul> + + <a name="v310RC1"></a><h3>1.ii. Changes since 3.1.0-RC1</h3> <h4>Bug</h4> <ul> @@ -166,7 +291,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12829">PHPBB3-12829</a>] - Remove check for pgsql 8.3/8.2</li> </ul> - <a name="v310b4"></a><h3>1.ii. Changes since 3.1.0-b4</h3> + <a name="v310b4"></a><h3>1.iii. Changes since 3.1.0-b4</h3> <h4>Bug</h4> <ul> @@ -286,7 +411,7 @@ </ul> - <a name="v310b3"></a><h3>1.iii. Changes since 3.1.0-b3</h3> + <a name="v310b3"></a><h3>1.iv. Changes since 3.1.0-b3</h3> <h4>Bug</h4> <ul> @@ -393,7 +518,7 @@ </ul> - <a name="v310b2"></a><h3>1.iv. Changes since 3.1.0-b2</h3> + <a name="v310b2"></a><h3>1.v. Changes since 3.1.0-b2</h3> <h4>Bug</h4> <ul> @@ -558,7 +683,7 @@ </ul> - <a name="v310b1"></a><h3>1.v. Changes since 3.1.0-b1</h3> + <a name="v310b1"></a><h3>1.vi. Changes since 3.1.0-b1</h3> <h4>Bug</h4> <ul> @@ -626,7 +751,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12302">PHPBB3-12302</a>] - Upgrade composer.phar to 1.0.0-alpha8</li> </ul> - <a name="v310a3"></a><h3>1.vi. Changes since 3.1.0-a3</h3> + <a name="v310a3"></a><h3>1.vii. Changes since 3.1.0-a3</h3> <h4>Bug</h4> <ul> @@ -773,7 +898,7 @@ </ul> - <a name="v310a2"></a><h3>1.vii. Changes since 3.1.0-a2</h3> + <a name="v310a2"></a><h3>1.viii. Changes since 3.1.0-a2</h3> <h4>Bug</h4> <ul> @@ -881,7 +1006,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12147">PHPBB3-12147</a>] - Remove Travis CI notification configuration</li> </ul> - <a name="v310a1"></a><h3>1.viii. Changes since 3.1.0-a1</h3> + <a name="v310a1"></a><h3>1.ix. Changes since 3.1.0-a1</h3> <h4>Bug</h4> <ul> @@ -957,7 +1082,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11998">PHPBB3-11998</a>] - Add console / command line client environment </li> </ul> - <a name="v30x"></a><h3>1.ix. Changes since 3.0.x</h3> + <a name="v30x"></a><h3>1.x. Changes since 3.0.x</h3> <h4>Bug</h4> <ul> @@ -1638,7 +1763,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11913">PHPBB3-11913</a>] - Apply reorganisation of download.phpbb.com to build_announcement.php</li> </ul> - <a name="v3011"></a><h3>1.x. Changes since 3.0.11</h3> + <a name="v3011"></a><h3>1.xi. Changes since 3.0.11</h3> <h4>Bug</h4> <ul> @@ -1793,7 +1918,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11753">PHPBB3-11753</a>] - Upgrade mysql_upgrader.php schema data.</li> </ul> - <a name="v3010"></a><h3>1.xi. Changes since 3.0.10</h3> + <a name="v3010"></a><h3>1.xii. Changes since 3.0.10</h3> <h4>Bug</h4> <ul> @@ -1918,7 +2043,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10909">PHPBB3-10909</a>] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2</li> </ul> - <a name="v309"></a><h3>1.xii. Changes since 3.0.9</h3> + <a name="v309"></a><h3>1.xiii. Changes since 3.0.9</h3> <h4>Bug</h4> <ul> @@ -2054,7 +2179,7 @@ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10480">PHPBB3-10480</a>] - Automate changelog building</li> </ul> - <a name="v308"></a><h3>1.xiii. Changes since 3.0.8</h3> + <a name="v308"></a><h3>1.xiv. Changes since 3.0.8</h3> <h4> Bug </h4> @@ -2422,7 +2547,7 @@ </ul> - <a name="v307-PL1"></a><h3>1.xiv. Changes since 3.0.7-PL1</h3> + <a name="v307-PL1"></a><h3>1.xv. Changes since 3.0.7-PL1</h3> <h4> Security </h4> <ul> @@ -2880,13 +3005,13 @@ </ul> - <a name="v307"></a><h3>1.xv. Changes since 3.0.7</h3> + <a name="v307"></a><h3>1.xvi. Changes since 3.0.7</h3> <ul> <li>[Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)</li> </ul> - <a name="v306"></a><h3>1.xvi. Changes since 3.0.6</h3> + <a name="v306"></a><h3>1.xvii. Changes since 3.0.6</h3> <ul> <li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li> @@ -2990,7 +3115,7 @@ </ul> - <a name="v305"></a><h3>1.xvii. Changes since 3.0.5</h3> + <a name="v305"></a><h3>1.xviii. Changes since 3.0.5</h3> <ul> <li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li> @@ -3212,7 +3337,7 @@ <li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li> </ul> - <a name="v304"></a><h3>1.xviii. Changes since 3.0.4</h3> + <a name="v304"></a><h3>1.xix. Changes since 3.0.4</h3> <ul> <li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li> @@ -3301,7 +3426,7 @@ <li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li> </ul> - <a name="v303"></a><h3>1.xix. Changes since 3.0.3</h3> + <a name="v303"></a><h3>1.xx. Changes since 3.0.3</h3> <ul> <li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li> @@ -3333,7 +3458,7 @@ <li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li> </ul> - <a name="v302"></a><h3>1.xx. Changes since 3.0.2</h3> + <a name="v302"></a><h3>1.xxi. Changes since 3.0.2</h3> <ul> <li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li> @@ -3432,7 +3557,7 @@ <li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li> </ul> - <a name="v301"></a><h3>1.xxi. Changes since 3.0.1</h3> + <a name="v301"></a><h3>1.xxii. Changes since 3.0.1</h3> <ul> <li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li> @@ -3480,7 +3605,7 @@ <li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li> </ul> - <a name="v300"></a><h3>1.xxii. Changes since 3.0.0</h3> + <a name="v300"></a><h3>1.xxiii. Changes since 3.0.0</h3> <ul> <li>[Change] Validate birthdays (Bug #15004)</li> @@ -3551,7 +3676,7 @@ <li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li> </ul> - <a name="v30rc8"></a><h3>1.xxiii. Changes since 3.0.RC8</h3> + <a name="v30rc8"></a><h3>1.xxiv. Changes since 3.0.RC8</h3> <ul> <li>[Fix] Cleaned usernames contain only single spaces, so "a_name" and "a__name" are treated as the same name (Bug #15634)</li> @@ -3560,7 +3685,7 @@ <li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li> </ul> - <a name="v30rc7"></a><h3>1.xxiv. Changes since 3.0.RC7</h3> + <a name="v30rc7"></a><h3>1.xxv. Changes since 3.0.RC7</h3> <ul> <li>[Fix] Fixed MSSQL related bug in the update system</li> @@ -3595,7 +3720,7 @@ <li>[Fix] No duplication of active topics (Bug #15474)</li> </ul> - <a name="v30rc6"></a><h3>1.xxv. Changes since 3.0.RC6</h3> + <a name="v30rc6"></a><h3>1.xxvi. Changes since 3.0.RC6</h3> <ul> <li>[Fix] Submitting language changes using acp_language (Bug #14736)</li> @@ -3605,7 +3730,7 @@ <li>[Fix] Able to request new password (Bug #14743)</li> </ul> - <a name="v30rc5"></a><h3>1.xxvi. Changes since 3.0.RC5</h3> + <a name="v30rc5"></a><h3>1.xxvii. Changes since 3.0.RC5</h3> <ul> <li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li> @@ -3668,7 +3793,7 @@ <li>[Sec] New password hashing mechanism for storing passwords (#i42)</li> </ul> - <a name="v30rc4"></a><h3>1.xxvii. Changes since 3.0.RC4</h3> + <a name="v30rc4"></a><h3>1.xxviii. Changes since 3.0.RC4</h3> <ul> <li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li> @@ -3719,7 +3844,7 @@ <li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li> </ul> - <a name="v30rc3"></a><h3>1.xxviii. Changes since 3.0.RC3</h3> + <a name="v30rc3"></a><h3>1.xxix. Changes since 3.0.RC3</h3> <ul> <li>[Fix] Fixing some subsilver2 and prosilver style issues</li> @@ -3828,7 +3953,7 @@ </ul> - <a name="v30rc2"></a><h3>1.xxix. Changes since 3.0.RC2</h3> + <a name="v30rc2"></a><h3>1.xxx. Changes since 3.0.RC2</h3> <ul> <li>[Fix] Re-allow searching within the memberlist</li> @@ -3874,7 +3999,7 @@ </ul> - <a name="v30rc1"></a><h3>1.xxx. Changes since 3.0.RC1</h3> + <a name="v30rc1"></a><h3>1.xxxi. Changes since 3.0.RC1</h3> <ul> <li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li> diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index d4c27183c7..e1308c71d1 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -434,6 +434,38 @@ memberlist_view_user_statistics_before * Since: 3.1.0-a1 * Purpose: Add entries before the user statistics part of any user profile +mcp_warn_post_add_warning_field_after +=== +* Locations: + + styles/prosilver/template/mcp_warn_post.html + + styles/subsilver2/template/mcp_warn_post.html +* Since: 3.1.0-RC4 +* Purpose: Add content during warning for a post - after add warning field. + +mcp_warn_post_add_warning_field_before +=== +* Locations: + + styles/prosilver/template/mcp_warn_post.html + + styles/subsilver2/template/mcp_warn_post.html +* Since: 3.1.0-RC4 +* Purpose: Add content during warning for a post - before add warning field. + +mcp_warn_user_add_warning_field_after +=== +* Locations: + + styles/prosilver/template/mcp_warn_user.html + + styles/subsilver2/template/mcp_warn_user.html +* Since: 3.1.0-RC4 +* Purpose: Add content during warning a user - after add warning field. + +mcp_warn_user_add_warning_field_before +=== +* Locations: + + styles/prosilver/template/mcp_warn_user.html + + styles/subsilver2/template/mcp_warn_user.html +* Since: 3.1.0-RC4 +* Purpose: Add content during warning a user - before add warning field. + navbar_header_logged_out_content === * Locations: @@ -1243,6 +1275,14 @@ viewtopic_body_postrow_post_before * Since: 3.1.0-a4 * Purpose: Add data before posts +viewtopic_body_postrow_post_content_footer +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.0-RC4 +* Purpose: Add data at the end of the posts. + viewtopic_body_postrow_post_notices_after === * Locations: diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index f10f0b1015..edfada1bf1 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -331,6 +331,28 @@ class acp_groups } } + if ($request->is_set_post('avatar_delete')) + { + if (confirm_box(true)) + { + $avatar_data['id'] = substr($avatar_data['id'], 1); + $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, GROUPS_TABLE, 'group_'); + + $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; + trigger_error($user->lang[$message] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array( + 'avatar_delete' => true, + 'i' => $id, + 'mode' => $mode, + 'g' => $group_id, + 'action' => $action)) + ); + } + } + // Did we submit? if ($update) { diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 71880c2267..40d8218a07 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -404,7 +404,7 @@ class acp_users if ($config['require_activation'] == USER_ACTIVATION_ADMIN) { $phpbb_notifications = $phpbb_container->get('notification_manager'); - $phpbb_notifications->delete_notifications('admin_activate_user', $user_row['user_id']); + $phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']); include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); @@ -465,25 +465,9 @@ class acp_users trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } - $sql_ary = array( - 'user_avatar' => '', - 'user_avatar_type' => '', - 'user_avatar_width' => 0, - 'user_avatar_height' => 0, - ); - - $sql = 'UPDATE ' . USERS_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " - WHERE user_id = $user_id"; - $db->sql_query($sql); - // Delete old avatar if present $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); - $driver = $phpbb_avatar_manager->get_driver($user_row['user_avatar_type']); - if ($driver) - { - $driver->delete($user_row); - } + $phpbb_avatar_manager->handle_avatar_delete($db, $user, $phpbb_avatar_manager->clean_row($user_row, 'user'), USERS_TABLE, 'user_'); add_log('admin', 'LOG_USER_DEL_AVATAR', $user_row['username']); add_log('user', $user_id, 'LOG_USER_DEL_AVATAR_USER'); @@ -1779,29 +1763,6 @@ class acp_users trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); } } - else - { - $driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type']); - if ($driver) - { - $driver->delete($avatar_data); - } - - // Removing the avatar - $result = array( - 'user_avatar' => '', - 'user_avatar_type' => '', - 'user_avatar_width' => 0, - 'user_avatar_height' => 0, - ); - - $sql = 'UPDATE ' . USERS_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $result) . ' - WHERE user_id = ' . (int) $user_id; - - $db->sql_query($sql); - trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); - } } else { @@ -1809,6 +1770,23 @@ class acp_users } } + // Handle deletion of avatars + if ($request->is_set_post('avatar_delete')) + { + if (!confirm_box(true)) + { + confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array( + 'avatar_delete' => true)) + ); + } + else + { + $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, USERS_TABLE, 'user_'); + + trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + } + $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user_row['user_avatar_type'])); foreach ($avatar_drivers as $current_driver) diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index cd4e19bf1d..0eac2e9417 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -28,7 +28,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.1.0-RC3-dev'); +define('PHPBB_VERSION', '3.1.0-RC4-dev'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c838876ddd..df613682a7 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -289,7 +289,6 @@ function phpbb_gmgetdate($time = false) * @param array $allowed_units only allow these units (data array indexes) * * @return mixed data array if $string_only is false -* @author bantu */ function get_formatted_filesize($value, $string_only = true, $allowed_units = false) { @@ -463,7 +462,6 @@ function phpbb_version_compare($version1, $version2, $operator = null) * @param int $perms Permissions to set * * @return bool true on success, otherwise false -* @author faw, phpBB Limited */ function phpbb_chmod($filename, $perms = CHMOD_READ) { @@ -1146,12 +1144,12 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ // Mark all topic notifications read for this user $phpbb_notifications->mark_notifications_read(array( - 'topic', - 'quote', - 'bookmark', - 'post', - 'approve_topic', - 'approve_post', + 'notification.type.topic', + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.post', + 'notification.type.approve_topic', + 'notification.type.approve_post', ), false, $user->data['user_id'], $post_time); if ($config['load_db_lastread'] && $user->data['is_registered']) @@ -1211,8 +1209,8 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ $phpbb_notifications = $phpbb_container->get('notification_manager'); $phpbb_notifications->mark_notifications_read_by_parent(array( - 'topic', - 'approve_topic', + 'notification.type.topic', + 'notification.type.approve_topic', ), $forum_id, $user->data['user_id'], $post_time); // Mark all post/quote notifications read for this user in this forum @@ -1228,10 +1226,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ $db->sql_freeresult($result); $phpbb_notifications->mark_notifications_read_by_parent(array( - 'quote', - 'bookmark', - 'post', - 'approve_post', + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.post', + 'notification.type.approve_post', ), $topic_ids, $user->data['user_id'], $post_time); // Add 0 to forums array to mark global announcements correctly @@ -1334,15 +1332,15 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ // Mark post notifications read for this user in this topic $phpbb_notifications->mark_notifications_read(array( - 'topic', - 'approve_topic', + 'notification.type.topic', + 'notification.type.approve_topic', ), $topic_id, $user->data['user_id'], $post_time); $phpbb_notifications->mark_notifications_read_by_parent(array( - 'quote', - 'bookmark', - 'post', - 'approve_post', + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.post', + 'notification.type.approve_post', ), $topic_id, $user->data['user_id'], $post_time); if ($config['load_db_lastread'] && $user->data['is_registered']) @@ -1638,7 +1636,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s if (empty($sql_sort)) { - $sql_sort = 'ORDER BY t.topic_last_post_time DESC'; + $sql_sort = 'ORDER BY t.topic_last_post_time DESC, t.topic_last_post_id DESC'; } if ($config['load_db_lastread'] && $user->data['is_registered']) @@ -3404,8 +3402,6 @@ function short_ipv6($ip, $length) * * @return mixed false if specified address is not valid, * string otherwise -* -* @author bantu */ function phpbb_ip_normalise($address) { @@ -3434,8 +3430,6 @@ function phpbb_ip_normalise($address) * * @return mixed false on failure, * string otherwise -* -* @author APTX */ function phpbb_inet_ntop($in_addr) { @@ -3505,8 +3499,6 @@ function phpbb_inet_ntop($in_addr) * * @return mixed false if address is invalid, * in_addr representation of the given address otherwise (string) -* -* @author APTX */ function phpbb_inet_pton($address) { @@ -3586,8 +3578,6 @@ function phpbb_inet_pton($address) * * Since null can also be returned, you probably want to compare the result * with === true or === false, -* -* @author bantu */ function phpbb_checkdnsrr($host, $type = 'MX') { @@ -4674,7 +4664,7 @@ function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config /** * Get avatar * -* @param array $row Row cleaned by \phpbb\avatar\driver\driver::clean_row +* @param array $row Row cleaned by \phpbb\avatar\manager::clean_row * @param string $alt Optional language string for alt tag within image, can be a language key or text * @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP * diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index accc8a6a83..e3e8657afb 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -27,8 +27,6 @@ if (!defined('IN_PHPBB')) * @param string $table constant or fullname of the table * @param int $parent_id parent_id of the current set (default = 0) * @param array $where contains strings to compare closer on the where statement (additional) -* -* @author EXreaction */ function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = array()) { @@ -315,8 +313,6 @@ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $incl * @param bool $add_log True if log entry should be added * * @return bool False on error -* -* @author bantu */ function copy_forum_permissions($src_forum_id, $dest_forum_ids, $clear_dest_perms = true, $add_log = true) { @@ -722,9 +718,9 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s $phpbb_notifications = $phpbb_container->get('notification_manager'); $phpbb_notifications->delete_notifications(array( - 'topic', - 'approve_topic', - 'topic_in_queue', + 'notification.type.topic', + 'notification.type.approve_topic', + 'notification.type.topic_in_queue', ), $topic_ids); return $return; @@ -739,9 +735,9 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = // Notifications types to delete $delete_notifications_types = array( - 'quote', - 'approve_post', - 'post_in_queue', + 'notification.type.quote', + 'notification.type.approve_post', + 'notification.type.post_in_queue', ); /** @@ -1224,8 +1220,6 @@ function delete_attachments($mode, $ids, $resync = true) * @param bool $auto_sync Will call sync() if this is true * * @return array Array with affected forums -* -* @author bantu */ function delete_topic_shadows($forum_id, $sql_more = '', $auto_sync = true) { diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index ee78364083..f275ed1dd1 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1323,7 +1323,6 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al * @param string $custom_profile_url optional parameter to specify a profile url. The user id get appended to this url as &u={user_id} * * @return string A string consisting of what is wanted based on $mode. -* @author BartVB, Acyd Burn */ function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false) { diff --git a/phpBB/includes/functions_mcp.php b/phpBB/includes/functions_mcp.php index 7593f08f4d..811d49f1de 100644 --- a/phpBB/includes/functions_mcp.php +++ b/phpBB/includes/functions_mcp.php @@ -521,21 +521,21 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by $limit_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'tt' => $user->lang['TOPIC_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); - $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'tt' => 't.topic_time', 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_posts_approved + t.topic_posts_unapproved + t.topic_posts_softdeleted' : 't.topic_posts_approved'), 's' => 't.topic_title', 'v' => 't.topic_views'); + $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'tt' => 't.topic_time', 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_posts_approved + t.topic_posts_unapproved + t.topic_posts_softdeleted' : 't.topic_posts_approved'), 's' => 't.topic_title', 'v' => 't.topic_views'); $limit_time_sql = ($min_time) ? "AND t.topic_last_post_time >= $min_time" : ''; break; case 'posts': $limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); - $sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.post_time', 's' => 'p.post_subject'); + $sort_by_sql = array('a' => 'u.username_clean', 't' => array('p.post_time', 'p.post_id'), 's' => 'p.post_subject'); $limit_time_sql = ($min_time) ? "AND p.post_time >= $min_time" : ''; break; case 'reports': $limit_days = array(0 => $user->lang['ALL_REPORTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']); - $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.post_time', 't' => 'r.report_time', 's' => 'p.post_subject'); + $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => array('p.post_time', 'p.post_id'), 't' => 'r.report_time', 's' => 'p.post_subject'); break; case 'pm_reports': @@ -558,7 +558,16 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by $sort_key = $default_key; } - $sort_order_sql = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); + $direction = ($sort_dir == 'd') ? 'DESC' : 'ASC'; + + if (is_array($sort_by_sql[$sort_key])) + { + $sort_order_sql = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; + } + else + { + $sort_order_sql = $sort_by_sql[$sort_key] . ' ' . $direction; + } $s_limit_days = $s_sort_key = $s_sort_dir = $sort_url = ''; gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $sort_url); diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 624ce187b9..768011fa5b 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1040,6 +1040,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id global $config, $phpbb_root_path, $phpEx, $phpbb_container; $phpbb_content_visibility = $phpbb_container->get('content.visibility'); + $sql_sort = ($mode == 'post_review') ? 'ASC' : 'DESC'; // Go ahead and pull all data for this topic $sql = 'SELECT p.post_id @@ -1048,8 +1049,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id, 'p.') . ' ' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . ' ' . (($mode == 'post_review_edit') ? " AND p.post_id = $cur_post_id" : '') . ' - ORDER BY p.post_time '; - $sql .= ($mode == 'post_review') ? 'ASC' : 'DESC'; + ORDER BY p.post_time ' . $sql_sort . ', p.post_id ' . $sql_sort; $result = $db->sql_query_limit($sql, $config['posts_per_page']); $post_list = array(); @@ -1342,7 +1342,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $ WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id AND p.post_visibility = " . ITEM_APPROVED . ' - ORDER BY p.post_time ASC'; + ORDER BY p.post_time ASC, p.post_id ASC'; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1354,7 +1354,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $ FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id - ORDER BY p.post_time ASC"; + ORDER BY p.post_time ASC, p.post_id ASC"; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1409,7 +1409,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $ WHERE topic_id = $topic_id AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id) . ' AND post_time > ' . $data['post_time'] . ' - ORDER BY post_time ASC'; + ORDER BY post_time ASC, post_id ASC'; $result = $db->sql_query_limit($sql, 1); $next_post_id = (int) $db->sql_fetchfield('post_id'); $db->sql_freeresult($result); @@ -2256,17 +2256,17 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u { case 'post': $phpbb_notifications->add_notifications(array( - 'quote', - 'topic', + 'notification.type.quote', + 'notification.type.topic', ), $notification_data); break; case 'reply': case 'quote': $phpbb_notifications->add_notifications(array( - 'quote', - 'bookmark', - 'post', + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.post', ), $notification_data); break; @@ -2275,10 +2275,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u case 'edit': case 'edit_last_post': $phpbb_notifications->update_notifications(array( - 'quote', - 'bookmark', - 'topic', - 'post', + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.topic', + 'notification.type.post', ), $notification_data); break; } @@ -2288,12 +2288,12 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u switch ($mode) { case 'post': - $phpbb_notifications->add_notifications('topic_in_queue', $notification_data); + $phpbb_notifications->add_notifications('notification.type.topic_in_queue', $notification_data); break; case 'reply': case 'quote': - $phpbb_notifications->add_notifications('post_in_queue', $notification_data); + $phpbb_notifications->add_notifications('notification.type.post_in_queue', $notification_data); break; case 'edit_topic': @@ -2310,20 +2310,20 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u { case 'edit_topic': case 'edit_first_post': - $phpbb_notifications->add_notifications('topic_in_queue', $notification_data); + $phpbb_notifications->add_notifications('notification.type.topic_in_queue', $notification_data); // Delete the approve_post notification so we can notify the user again, // when his post got reapproved - $phpbb_notifications->delete_notifications('approve_post', $notification_data['post_id']); + $phpbb_notifications->delete_notifications('notification.type.approve_post', $notification_data['post_id']); break; case 'edit': case 'edit_last_post': - $phpbb_notifications->add_notifications('post_in_queue', $notification_data); + $phpbb_notifications->add_notifications('notification.type.post_in_queue', $notification_data); // Delete the approve_post notification so we can notify the user again, // when his post got reapproved - $phpbb_notifications->delete_notifications('approve_post', $notification_data['post_id']); + $phpbb_notifications->delete_notifications('notification.type.approve_post', $notification_data['post_id']); break; case 'post': diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 488f46a398..29cea477e4 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -883,7 +883,7 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id) $phpbb_notifications = $phpbb_container->get('notification_manager'); - $phpbb_notifications->mark_notifications_read('pm', $msg_id, $user_id); + $phpbb_notifications->mark_notifications_read('notification.type.pm', $msg_id, $user_id); $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " SET pm_unread = 0 @@ -1114,7 +1114,7 @@ function delete_pm($user_id, $msg_ids, $folder_id) $phpbb_notifications = $phpbb_container->get('notification_manager'); - $phpbb_notifications->delete_notifications('pm', array_keys($delete_rows)); + $phpbb_notifications->delete_notifications('notification.type.pm', array_keys($delete_rows)); // Now we have to check which messages we can delete completely $sql = 'SELECT msg_id @@ -1296,7 +1296,7 @@ function phpbb_delete_users_pms($user_ids) AND ' . $db->sql_in_set('msg_id', $delivered_msg); $db->sql_query($sql); - $phpbb_notifications->delete_notifications('pm', $delivered_msg); + $phpbb_notifications->delete_notifications('notification.type.pm', $delivered_msg); } if (!empty($undelivered_msg)) @@ -1309,7 +1309,7 @@ function phpbb_delete_users_pms($user_ids) WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); $db->sql_query($sql); - $phpbb_notifications->delete_notifications('pm', $undelivered_msg); + $phpbb_notifications->delete_notifications('notification.type.pm', $undelivered_msg); } } @@ -1353,7 +1353,7 @@ function phpbb_delete_users_pms($user_ids) WHERE ' . $db->sql_in_set('msg_id', $delete_ids); $db->sql_query($sql); - $phpbb_notifications->delete_notifications('pm', $delete_ids); + $phpbb_notifications->delete_notifications('notification.type.pm', $delete_ids); } } @@ -1911,11 +1911,11 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) if ($mode == 'edit') { - $phpbb_notifications->update_notifications('pm', $pm_data); + $phpbb_notifications->update_notifications('notification.type.pm', $pm_data); } else { - $phpbb_notifications->add_notifications('pm', $pm_data); + $phpbb_notifications->add_notifications('notification.type.pm', $pm_data); } /** diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index fca183a225..42fdee364c 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -507,8 +507,6 @@ class ftp extends transfer /** * FTP fsock transfer class -* -* @author wGEric */ class ftp_fsock extends transfer { diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index d39be50251..38ae34c66c 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2675,7 +2675,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, foreach ($add_id_ary as $user_id) { - $phpbb_notifications->add_notifications('group_request', array( + $phpbb_notifications->add_notifications('notification.type.group_request', array( 'group_id' => $group_id, 'user_id' => $user_id, 'group_name' => $group_name, @@ -2832,7 +2832,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $phpbb_notifications = $phpbb_container->get('notification_manager'); - $phpbb_notifications->delete_notifications('group_request', $user_id_ary, $group_id); + $phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id); // Return false - no error return false; @@ -2996,12 +2996,12 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna $phpbb_notifications = $phpbb_container->get('notification_manager'); - $phpbb_notifications->add_notifications('group_request_approved', array( + $phpbb_notifications->add_notifications('notification.type.group_request_approved', array( 'user_ids' => $user_id_ary, 'group_id' => $group_id, 'group_name' => $group_name, )); - $phpbb_notifications->delete_notifications('group_request', $user_id_ary, $group_id); + $phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id); $log = 'LOG_USERS_APPROVED'; break; diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index b4ec0092e7..ebcf7ce643 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -66,7 +66,7 @@ function mcp_front_view($id, $mode, $action) FROM ' . POSTS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_list) . ' AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . ' - ORDER BY post_time DESC'; + ORDER BY post_time DESC, post_id DESC'; $result = $db->sql_query_limit($sql, 5); while ($row = $db->sql_fetchrow($result)) @@ -101,7 +101,7 @@ function mcp_front_view($id, $mode, $action) WHERE ' . $db->sql_in_set('p.post_id', $post_list) . ' AND t.topic_id = p.topic_id AND p.poster_id = u.user_id - ORDER BY p.post_time DESC'; + ORDER BY p.post_time DESC, p.post_id DESC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -190,7 +190,7 @@ function mcp_front_view($id, $mode, $action) AND p.poster_id = u2.user_id AND ' . $db->sql_in_set('p.forum_id', $forum_list), - 'ORDER_BY' => 'p.post_time DESC', + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', ); /** diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 92000c6ceb..f03bc034e4 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -1265,7 +1265,7 @@ function mcp_fork_topic($topic_ids) $sql = 'SELECT * FROM ' . POSTS_TABLE . " WHERE topic_id = $topic_id - ORDER BY post_time ASC"; + ORDER BY post_time ASC, post_id ASC"; $result = $db->sql_query($sql); $post_rows = array(); diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index 03e4ed4722..d76bedba98 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -95,7 +95,7 @@ class mcp_pm_reports $phpbb_notifications = $phpbb_container->get('notification_manager'); - $phpbb_notifications->mark_notifications_read_by_parent('report_pm', $report_id, $user->data['user_id']); + $phpbb_notifications->mark_notifications_read_by_parent('notification.type.report_pm', $report_id, $user->data['user_id']); $pm_id = $report['pm_id']; $report_id = $report['report_id']; diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index b7e47163a6..bfd30a5be2 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -165,7 +165,7 @@ class mcp_queue { $post_id = (int) $topic_info[$topic_id]['topic_first_post_id']; - $phpbb_notifications->mark_notifications_read('topic_in_queue', $topic_id, $user->data['user_id']); + $phpbb_notifications->mark_notifications_read('notification.type.topic_in_queue', $topic_id, $user->data['user_id']); } else { @@ -173,7 +173,7 @@ class mcp_queue } } - $phpbb_notifications->mark_notifications_read('post_in_queue', $post_id, $user->data['user_id']); + $phpbb_notifications->mark_notifications_read('notification.type.post_in_queue', $post_id, $user->data['user_id']); $post_info = phpbb_get_post_data(array($post_id), 'm_approve', true); @@ -701,11 +701,11 @@ class mcp_queue // A single topic approval may also happen here, so handle deleting the respective notification. if (!$post_data['topic_posts_approved']) { - $phpbb_notifications->delete_notifications('topic_in_queue', $post_data['topic_id']); + $phpbb_notifications->delete_notifications('notification.type.topic_in_queue', $post_data['topic_id']); if ($post_data['post_visibility'] == ITEM_UNAPPROVED) { - $phpbb_notifications->add_notifications(array('topic'), $post_data); + $phpbb_notifications->add_notifications(array('notification.type.topic'), $post_data); } if ($post_data['post_visibility'] != ITEM_APPROVED) { @@ -721,18 +721,18 @@ class mcp_queue if ($post_data['post_visibility'] == ITEM_UNAPPROVED) { $phpbb_notifications->add_notifications(array( - 'bookmark', - 'post', + 'notification.type.bookmark', + 'notification.type.post', ), $post_data); } } - $phpbb_notifications->add_notifications(array('quote'), $post_data); - $phpbb_notifications->delete_notifications('post_in_queue', $post_id); + $phpbb_notifications->add_notifications(array('notification.type.quote'), $post_data); + $phpbb_notifications->delete_notifications('notification.type.post_in_queue', $post_id); $phpbb_notifications->mark_notifications_read(array( - 'quote', - 'bookmark', - 'post', + 'notification.type.quote', + 'notification.type.bookmark', + 'notification.type.post', ), $post_data['post_id'], $user->data['user_id']); // Notify Poster? @@ -745,11 +745,11 @@ class mcp_queue if (!$post_data['topic_posts_approved']) { - $phpbb_notifications->add_notifications('approve_post', $post_data); + $phpbb_notifications->add_notifications('notification.type.approve_post', $post_data); } else { - $phpbb_notifications->add_notifications('approve_topic', $post_data); + $phpbb_notifications->add_notifications('notification.type.approve_topic', $post_data); } } } @@ -921,7 +921,7 @@ class mcp_queue 'post_username' => $topic_data['topic_first_poster_name'], )); - $phpbb_notifications->delete_notifications('topic_in_queue', $topic_id); + $phpbb_notifications->delete_notifications('notification.type.topic_in_queue', $topic_id); // Only add notifications, if we are not reapproving post // When the topic was already approved, but was edited and @@ -930,17 +930,17 @@ class mcp_queue if ($topic_data['topic_visibility'] == ITEM_UNAPPROVED) { $phpbb_notifications->add_notifications(array( - 'quote', - 'topic', + 'notification.type.quote', + 'notification.type.topic', ), $topic_data); } - $phpbb_notifications->mark_notifications_read('quote', $topic_data['post_id'], $user->data['user_id']); - $phpbb_notifications->mark_notifications_read('topic', $topic_id, $user->data['user_id']); + $phpbb_notifications->mark_notifications_read('notification.type.quote', $topic_data['post_id'], $user->data['user_id']); + $phpbb_notifications->mark_notifications_read('notification.type.topic', $topic_id, $user->data['user_id']); if ($notify_poster) { - $phpbb_notifications->add_notifications('approve_topic', $topic_data); + $phpbb_notifications->add_notifications('notification.type.approve_topic', $topic_data); } } } @@ -1178,12 +1178,12 @@ class mcp_queue $topic_information[$topic_id]['topic_posts_softdeleted'] == 0 && $topic_information[$topic_id]['topic_posts_unapproved'] == $topic_posts_unapproved[$topic_id]; - $phpbb_notifications->delete_notifications('post_in_queue', $post_id); + $phpbb_notifications->delete_notifications('notification.type.post_in_queue', $post_id); // Do we disapprove the whole topic? Remove potential notifications if ($disapprove_all_posts_in_topic) { - $phpbb_notifications->delete_notifications('topic_in_queue', $post_data['topic_id']); + $phpbb_notifications->delete_notifications('notification.type.topic_in_queue', $post_data['topic_id']); } // Notify Poster? @@ -1228,13 +1228,13 @@ class mcp_queue { // If there is only 1 post when disapproving the topic, // we send the user a "disapprove topic" notification... - $phpbb_notifications->add_notifications('disapprove_topic', $post_data); + $phpbb_notifications->add_notifications('notification.type.disapprove_topic', $post_data); } else { // ... otherwise there are multiple unapproved posts and // all of them are disapproved as posts. - $phpbb_notifications->add_notifications('disapprove_post', $post_data); + $phpbb_notifications->add_notifications('notification.type.disapprove_post', $post_data); } } } diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index a7d8bf18d6..247b9d1651 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -92,7 +92,7 @@ class mcp_reports $phpbb_notifications = $phpbb_container->get('notification_manager'); - $phpbb_notifications->mark_notifications_read('report_post', $post_id, $user->data['user_id']); + $phpbb_notifications->mark_notifications_read('notification.type.report_post', $post_id, $user->data['user_id']); if (!$report_id && $report['report_closed']) { @@ -364,6 +364,27 @@ class mcp_reports AND r.pm_id = 0 $limit_time_sql ORDER BY $sort_order_sql"; + + /** + * Alter sql query to get report id of all reports for requested forum and topic or just forum + * + * @event core.mcp_reports_get_reports_query_before + * @var string sql String with the query to be executed + * @var array forum_list List of forums that contain the posts + * @var int topic_id topic_id in the page request + * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string) + * @var string sort_order_sql String with the ORDER BY SQL code used in this query + * @since 3.1.0-RC4 + */ + $vars = array( + 'sql', + 'forum_list', + 'topic_id', + 'limit_time_sql', + 'sort_order_sql', + ); + extract($phpbb_dispatcher->trigger_event('core.mcp_reports_get_reports_query_before', compact($vars))); + $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); $i = 0; @@ -631,12 +652,12 @@ function close_report($report_id_list, $mode, $action, $pm = false) if ($pm) { add_log('mod', 0, 0, 'LOG_PM_REPORT_' . strtoupper($action) . 'D', $post_info[$report['pm_id']]['message_subject']); - $phpbb_notifications->delete_notifications('report_pm', $report['pm_id']); + $phpbb_notifications->delete_notifications('notification.type.report_pm', $report['pm_id']); } else { add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' . strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']); - $phpbb_notifications->delete_notifications('report_post', $report['post_id']); + $phpbb_notifications->delete_notifications('notification.type.report_post', $report['post_id']); } } @@ -654,7 +675,7 @@ function close_report($report_id_list, $mode, $action, $pm = false) if ($pm) { - $phpbb_notifications->add_notifications('report_pm_closed', array_merge($post_info[$post_id], array( + $phpbb_notifications->add_notifications('notification.type.report_pm_closed', array_merge($post_info[$post_id], array( 'reporter' => $reporter['user_id'], 'closer_id' => $user->data['user_id'], 'from_user_id' => $post_info[$post_id]['author_id'], @@ -662,7 +683,7 @@ function close_report($report_id_list, $mode, $action, $pm = false) } else { - $phpbb_notifications->add_notifications('report_post_closed', array_merge($post_info[$post_id], array( + $phpbb_notifications->add_notifications('notification.type.report_post_closed', array_merge($post_info[$post_id], array( 'reporter' => $reporter['user_id'], 'closer_id' => $user->data['user_id'], ))); diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index fb47522644..106b025757 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -535,7 +535,7 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) $message_parser = new parse_message(); - $message_parser->message = sprintf($lang['WARNING_PM_BODY'], $warning); + $message_parser->message = $user->lang('WARNING_PM_BODY', $warning); $message_parser->parse(true, true, true, false, false, true, true); $pm_data = array( @@ -553,7 +553,7 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) 'address_list' => array('u' => array($user_row['user_id'] => 'to')), ); - submit_pm('post', $lang['WARNING_PM_SUBJECT'], $pm_data, false); + submit_pm('post', $user->lang('WARNING_PM_SUBJECT'), $pm_data, false); } add_log('admin', 'LOG_USER_WARNING', $user_row['username']); diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index 53dec89aad..6e357b260a 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -111,7 +111,7 @@ class ucp_activate if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password) { $phpbb_notifications = $phpbb_container->get('notification_manager'); - $phpbb_notifications->delete_notifications('admin_activate_user', $user_row['user_id']); + $phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']); include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index e4931fbe23..b9606945b4 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -471,6 +471,29 @@ class ucp_groups $avatar_data = \phpbb\avatar\manager::clean_row($group_row, 'group'); } + // Handle deletion of avatars + if ($request->is_set_post('avatar_delete')) + { + if (confirm_box(true)) + { + $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, GROUPS_TABLE, 'group_'); + $cache->destroy('sql', GROUPS_TABLE); + + $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; + trigger_error($user->lang[$message] . $return_page); + } + else + { + confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array( + 'avatar_delete' => true, + 'i' => $id, + 'mode' => $mode, + 'g' => $group_id, + 'action' => $action)) + ); + } + } + // Did we submit? if ($update) { @@ -510,19 +533,6 @@ class ucp_groups $submit_ary = array_merge($submit_ary, $result); } } - else - { - if ($driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type'])) - { - $driver->delete($avatar_data); - } - - // Removing the avatar - $submit_ary['avatar_type'] = ''; - $submit_ary['avatar'] = ''; - $submit_ary['avatar_width'] = 0; - $submit_ary['avatar_height'] = 0; - } // Merge any avatars errors into the primary error array $error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error)); diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 304c04eb3d..a1624e78ec 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -81,7 +81,7 @@ class ucp_main FROM $sql_from WHERE t.topic_type = " . POST_GLOBAL . ' AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . ' - ORDER BY t.topic_last_post_time DESC'; + ORDER BY t.topic_last_post_time DESC, t.topic_last_post_id DESC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -693,7 +693,7 @@ class ucp_main AND t.topic_id = tw.topic_id AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true), - 'ORDER_BY' => 't.topic_last_post_time DESC' + 'ORDER_BY' => 't.topic_last_post_time DESC, t.topic_last_post_id DESC' ); $sql_array['LEFT_JOIN'] = array(); @@ -710,7 +710,7 @@ class ucp_main 'WHERE' => 'b.user_id = ' . $user->data['user_id'] . ' AND ' . $db->sql_in_set('f.forum_id', $forbidden_forum_ary, true, true), - 'ORDER_BY' => 't.topic_last_post_time DESC' + 'ORDER_BY' => 't.topic_last_post_time DESC, t.topic_last_post_id DESC' ); $sql_array['LEFT_JOIN'] = array(); diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index 0ed3084e9f..5691302b83 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -58,21 +58,21 @@ class ucp_notifications { foreach($notification_methods as $method => $method_data) { - if ($request->is_set_post($type . '_' . $method_data['id']) && (!isset($subscriptions[$type]) || !in_array($method_data['id'], $subscriptions[$type]))) + if ($request->is_set_post(str_replace('.', '_', $type . '_' . $method_data['id'])) && (!isset($subscriptions[$type]) || !in_array($method_data['id'], $subscriptions[$type]))) { $phpbb_notifications->add_subscription($type, 0, $method_data['id']); } - else if (!$request->is_set_post($type . '_' . $method_data['id']) && isset($subscriptions[$type]) && in_array($method_data['id'], $subscriptions[$type])) + else if (!$request->is_set_post(str_replace('.', '_', $type . '_' . $method_data['id'])) && isset($subscriptions[$type]) && in_array($method_data['id'], $subscriptions[$type])) { $phpbb_notifications->delete_subscription($type, 0, $method_data['id']); } } - if ($request->is_set_post($type . '_notification') && !isset($subscriptions[$type])) + if ($request->is_set_post(str_replace('.', '_', $type) . '_notification') && !isset($subscriptions[$type])) { $phpbb_notifications->add_subscription($type); } - else if (!$request->is_set_post($type . '_notification') && isset($subscriptions[$type])) + else if (!$request->is_set_post(str_replace('.', '_', $type) . '_notification') && isset($subscriptions[$type])) { $phpbb_notifications->delete_subscription($type); } diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index a8c8920a7d..b0a8e8d374 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -320,7 +320,7 @@ class ucp_prefs $limit_topic_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_topic_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); - $sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_posts_approved', 's' => 't.topic_title', 'v' => 't.topic_views'); + $sort_by_topic_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'r' => 't.topic_posts_approved', 's' => 't.topic_title', 'v' => 't.topic_views'); // Post ordering options $limit_post_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index a315b167d7..361dc831aa 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -564,30 +564,6 @@ class ucp_profile trigger_error($message); } } - else - { - if ($driver = $phpbb_avatar_manager->get_driver($avatar_data['avatar_type'])) - { - $driver->delete($avatar_data); - } - - $result = array( - 'user_avatar' => '', - 'user_avatar_type' => '', - 'user_avatar_width' => 0, - 'user_avatar_height' => 0, - ); - - $sql = 'UPDATE ' . USERS_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $result) . ' - WHERE user_id = ' . (int) $user->data['user_id']; - - $db->sql_query($sql); - - meta_refresh(3, $this->u_action); - $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); - trigger_error($message); - } } else { @@ -595,6 +571,27 @@ class ucp_profile } } + // Handle deletion of avatars + if ($request->is_set_post('avatar_delete')) + { + if (!confirm_box(true)) + { + confirm_box(false, $user->lang('CONFIRM_AVATAR_DELETE'), build_hidden_fields(array( + 'avatar_delete' => true, + 'i' => $id, + 'mode' => $mode)) + ); + } + else + { + $phpbb_avatar_manager->handle_avatar_delete($db, $user, $avatar_data, USERS_TABLE, 'user_'); + + meta_refresh(3, $this->u_action); + $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); + trigger_error($message); + } + } + $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user->data['user_avatar_type'])); foreach ($avatar_drivers as $current_driver) diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index a303197563..06baf7e5f2 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -389,7 +389,7 @@ class ucp_register if ($config['require_activation'] == USER_ACTIVATION_ADMIN) { $phpbb_notifications = $phpbb_container->get('notification_manager'); - $phpbb_notifications->add_notifications('admin_activate_user', array( + $phpbb_notifications->add_notifications('notification.type.admin_activate_user', array( 'user_id' => $user_id, 'user_actkey' => $user_row['user_actkey'], 'user_regdate' => $user_row['user_regdate'], diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 696075b07c..de0cccd234 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -38,7 +38,7 @@ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms); $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', 'version' => '1.0.3', - 'phpbb_version' => '3.1.0-RC2', + 'phpbb_version' => '3.1.0-RC3', 'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>', 'dbms' => $dbms, 'dbhost' => $dbhost, diff --git a/phpBB/install/schemas/schema.json b/phpBB/install/schemas/schema.json index 4e014c77ed..b71b1fecbe 100644 --- a/phpBB/install/schemas/schema.json +++ b/phpBB/install/schemas/schema.json @@ -2088,16 +2088,12 @@ "UINT", 0 ], - "pf_phpbb_skype": [ - "VCHAR", - "" - ], - "pf_phpbb_twitter": [ - "VCHAR", + "pf_phpbb_interests": [ + "MTEXT", "" ], - "pf_phpbb_youtube": [ - "VCHAR", + "pf_phpbb_occupation": [ + "MTEXT", "" ], "pf_phpbb_facebook": [ @@ -2108,19 +2104,19 @@ "VCHAR", "" ], - "pf_phpbb_interests": [ - "MTEXT", + "pf_phpbb_icq": [ + "VCHAR", "" ], - "pf_phpbb_occupation": [ - "MTEXT", + "pf_phpbb_location": [ + "VCHAR", "" ], - "pf_phpbb_icq": [ + "pf_phpbb_skype": [ "VCHAR", "" ], - "pf_phpbb_location": [ + "pf_phpbb_twitter": [ "VCHAR", "" ], @@ -2136,6 +2132,10 @@ "VCHAR", "" ], + "pf_phpbb_youtube": [ + "VCHAR", + "" + ], "pf_phpbb_aol": [ "VCHAR", "" diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 5589e10243..90b1ac8f92 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -273,7 +273,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0 INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-RC3-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-RC4-dev'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); @@ -813,9 +813,9 @@ INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_len INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_googleplus', 'profilefields.type.googleplus', 'phpbb_googleplus', '20', '3', '255', '', '', '[\w]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 13, 1, 'VIEW_GOOGLEPLUS_PROFILE', 'http://plus.google.com/%s'); # User Notification Options (for first user) -INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('post', 0, 2, ''); -INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('post', 0, 2, 'email'); -INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('topic', 0, 2, ''); -INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('topic', 0, 2, 'email'); +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.post', 0, 2, ''); +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.post', 0, 2, 'notification.method.email'); +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.topic', 0, 2, ''); +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.topic', 0, 2, 'notification.method.email'); # POSTGRES COMMIT # diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php index eb0f5bb357..0e7dc39b95 100644 --- a/phpBB/language/en/cli.php +++ b/phpBB/language/en/cli.php @@ -73,6 +73,9 @@ $lang = array_merge($lang, array( 'CLI_EXTENSION_PURGE_FAILURE' => 'Could not purge extension %s', 'CLI_EXTENSION_PURGE_SUCCESS' => 'Successfully purged extension %s', 'CLI_EXTENSION_NOT_FOUND' => 'No extensions were found.', + 'CLI_EXTENSIONS_AVAILABLE' => 'Available', + 'CLI_EXTENSIONS_DISABLED' => 'Disabled', + 'CLI_EXTENSIONS_ENABLED' => 'Enabled', 'CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS' => 'Successfully recalculated all email hashes.', )); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 4ce69e0b85..783faa8fad 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -167,6 +167,7 @@ $lang = array_merge($lang, array( 'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as it appears. All letters are case insensitive.', 'CONFIRM_CODE_WRONG' => 'The confirmation code you entered was incorrect.', 'CONFIRM_OPERATION' => 'Are you sure you wish to carry out this operation?', + 'CONFIRM_AVATAR_DELETE' => 'Are you sure you wish to delete this avatar?', 'CONGRATULATIONS' => 'Congratulations to', 'CONNECTION_FAILED' => 'Connection failed.', 'CONNECTION_SUCCESS' => 'Connection was successful!', @@ -481,7 +482,6 @@ $lang = array_merge($lang, array( 'NO_AUTH_ADMIN_USER_DIFFER' => 'You are not able to re-authenticate as a different user.', 'NO_AUTH_OPERATION' => 'You do not have the necessary permissions to complete this operation.', 'NO_AVATARS' => 'No avatars currently available', - 'NO_AVATAR_SELECTED' => 'You have not selected any avatar.', 'NO_CONNECT_TO_SMTP_HOST' => 'Could not connect to smtp host : %1$s : %2$s', 'NO_BIRTHDAYS' => 'No birthdays today', 'NO_EMAIL_MESSAGE' => 'Email message was blank.', diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 7b71e3c844..902c6ae84c 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -91,6 +91,13 @@ class oauth extends \phpbb\auth\provider\base protected $current_uri; /** + * DI container + * + * @var \Symfony\Component\DependencyInjection\ContainerInterface + */ + protected $phpbb_container; + + /** * phpBB root path * * @var string @@ -116,10 +123,11 @@ class oauth extends \phpbb\auth\provider\base * @param string $auth_provider_oauth_token_account_assoc * @param \phpbb\di\service_collection $service_providers Contains \phpbb\auth\provider\oauth\service_interface * @param string $users_table + * @param \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container DI container * @param string $phpbb_root_path * @param string $php_ext */ - public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request_interface $request, \phpbb\user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, \phpbb\di\service_collection $service_providers, $users_table, $phpbb_root_path, $php_ext) + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request_interface $request, \phpbb\user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, \phpbb\di\service_collection $service_providers, $users_table, \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container, $phpbb_root_path, $php_ext) { $this->db = $db; $this->config = $config; @@ -130,6 +138,7 @@ class oauth extends \phpbb\auth\provider\base $this->auth_provider_oauth_token_account_assoc = $auth_provider_oauth_token_account_assoc; $this->service_providers = $service_providers; $this->users_table = $users_table; + $this->phpbb_container = $phpbb_container; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; } @@ -160,7 +169,7 @@ class oauth extends \phpbb\auth\provider\base // Temporary workaround for only having one authentication provider available if (!$this->request->is_set('oauth_service')) { - $provider = new \phpbb\auth\provider\db($this->db, $this->config, $this->passwords_manager, $this->request, $this->user, $this->phpbb_root_path, $this->php_ext); + $provider = new \phpbb\auth\provider\db($this->db, $this->config, $this->passwords_manager, $this->request, $this->user, $this->phpbb_container, $this->phpbb_root_path, $this->php_ext); return $provider->login($username, $password); } diff --git a/phpBB/phpbb/avatar/driver/gravatar.php b/phpBB/phpbb/avatar/driver/gravatar.php index 4aa7445d20..2082e0fd02 100644 --- a/phpBB/phpbb/avatar/driver/gravatar.php +++ b/phpBB/phpbb/avatar/driver/gravatar.php @@ -69,6 +69,11 @@ class gravatar extends \phpbb\avatar\driver\driver $row['avatar_width'] = $request->variable('avatar_gravatar_width', 0); $row['avatar_height'] = $request->variable('avatar_gravatar_height', 0); + if (empty($row['avatar'])) + { + return false; + } + if (!function_exists('validate_data')) { require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext); diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php index ff1996854b..07b3ed59de 100644 --- a/phpBB/phpbb/avatar/driver/local.php +++ b/phpBB/phpbb/avatar/driver/local.php @@ -120,7 +120,6 @@ class local extends \phpbb\avatar\driver\driver if (empty($category) || empty($file)) { - $error[] = 'NO_AVATAR_SELECTED'; return false; } diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php index 455ddebf62..1bd7f6c927 100644 --- a/phpBB/phpbb/avatar/driver/remote.php +++ b/phpBB/phpbb/avatar/driver/remote.php @@ -53,6 +53,11 @@ class remote extends \phpbb\avatar\driver\driver $width = $request->variable('avatar_remote_width', 0); $height = $request->variable('avatar_remote_height', 0); + if (empty($url)) + { + return false; + } + if (!preg_match('#^(http|https|ftp)://#i', $url)) { $url = 'http://' . $url; diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index f5ba50451a..003b23659f 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -129,7 +129,6 @@ class upload extends \phpbb\avatar\driver\driver } else { - $error[] = 'NO_AVATAR_SELECTED'; return false; } diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php index 7cf136be2c..42ae61a9a2 100644 --- a/phpBB/phpbb/avatar/manager.php +++ b/phpBB/phpbb/avatar/manager.php @@ -41,8 +41,8 @@ class manager static protected $default_row = array( 'avatar' => '', 'avatar_type' => '', - 'avatar_width' => '', - 'avatar_height' => '', + 'avatar_width' => 0, + 'avatar_height' => 0, ); /** @@ -307,4 +307,36 @@ class manager return $error; } + + /** + * Handle deleting avatars + * + * @param \phpbb\db\driver\driver_interface $db phpBB dbal + * @param \phpbb\user $user phpBB user object + * @param array $avatar_data Cleaned user data containing the user's + * avatar data + * @param string $table Database table from which the avatar should be deleted + * @param string $prefix Prefix of user data columns in database + * @return null + */ + public function handle_avatar_delete(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, $avatar_data, $table, $prefix) + { + if ($driver = $this->get_driver($avatar_data['avatar_type'])) + { + $driver->delete($avatar_data); + } + + $result = self::$default_row; + + foreach ($result as $key => $value) + { + $result[$prefix . $key] = $value; + unset($result[$key]); + } + + $sql = 'UPDATE ' . $table . ' + SET ' . $db->sql_build_array('UPDATE', $result) . ' + WHERE ' . $prefix . 'id = ' . (int) $avatar_data['id']; + $db->sql_query($sql); + } } diff --git a/phpBB/phpbb/console/command/extension/show.php b/phpBB/phpbb/console/command/extension/show.php index 6ce9607098..f9322034d7 100644 --- a/phpBB/phpbb/console/command/extension/show.php +++ b/phpBB/phpbb/console/command/extension/show.php @@ -37,22 +37,22 @@ class show extends command } $enabled = array_keys($this->manager->all_enabled()); - $this->print_extension_list($output, 'Enabled', $enabled); + $this->print_extension_list($output, $this->user->lang('CLI_EXTENSIONS_ENABLED') . $this->user->lang('COLON'), $enabled); $output->writeln(''); $disabled = array_keys($this->manager->all_disabled()); - $this->print_extension_list($output, 'Disabled', $disabled); + $this->print_extension_list($output, $this->user->lang('CLI_EXTENSIONS_DISABLED') . $this->user->lang('COLON'), $disabled); $output->writeln(''); $purged = array_diff($all, $enabled, $disabled); - $this->print_extension_list($output, 'Available', $purged); + $this->print_extension_list($output, $this->user->lang('CLI_EXTENSIONS_AVAILABLE') . $this->user->lang('COLON'), $purged); } protected function print_extension_list(OutputInterface $output, $type, array $extensions) { - $output->writeln("<info>$type:</info>"); + $output->writeln("<info>$type</info>"); foreach ($extensions as $extension) { diff --git a/phpBB/phpbb/controller/provider.php b/phpBB/phpbb/controller/provider.php index fffd4f0428..7e26848290 100644 --- a/phpBB/phpbb/controller/provider.php +++ b/phpBB/phpbb/controller/provider.php @@ -73,7 +73,7 @@ class provider $this->routes = new RouteCollection; foreach ($this->routing_files as $file_path) { - $loader = new YamlFileLoader(new FileLocator($base_path)); + $loader = new YamlFileLoader(new FileLocator(phpbb_realpath($base_path))); $this->routes->addCollection($loader->load($file_path)); } diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php b/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php new file mode 100644 index 0000000000..f749b32119 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php @@ -0,0 +1,122 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class notifications_use_full_name extends \phpbb\db\migration\migration +{ + protected $notification_types = array( + 'admin_activate_user', + 'approve_post', + 'approve_topic', + 'bookmark', + 'disapprove_post', + 'disapprove_topic', + 'group_request', + 'group_request_approved', + 'pm', + 'post', + 'post_in_queue', + 'quote', + 'report_pm', + 'report_pm_closed', + 'report_post', + 'report_post_closed', + 'topic', + 'topic_in_queue'); + + protected $notification_methods = array( + 'email', + 'jabber', + ); + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\rc3'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_notifications_name'))), + array('custom', array(array($this, 'update_notifications_method_name'))), + ); + } + + public function revert_data() + { + return array( + array('custom', array(array($this, 'revert_notifications_name'))), + array('custom', array(array($this, 'revert_notifications_method_name'))), + ); + } + + public function update_notifications_method_name() + { + foreach ($this->notification_methods as $notification_method) + { + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET method = 'notification.method.{$notification_method}' + WHERE method = '{$notification_method}'"; + $this->db->sql_query($sql); + } + } + + public function revert_notifications_method_name() + { + foreach ($this->notification_methods as $notification_method) + { + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET method = '{$notification_method}' + WHERE method = 'notification.method.{$notification_method}'"; + $this->db->sql_query($sql); + } + } + + public function update_notifications_name() + { + $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . ' + SET notification_type_enabled = 0 + WHERE ' . $this->db->sql_in_set('notification_type_name', $this->notification_types, true); + $this->db->sql_query($sql); + + foreach ($this->notification_types as $notification_type) + { + $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . " + SET notification_type_name = 'notification.type.{$notification_type}' + WHERE notification_type_name = '{$notification_type}'"; + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET item_type = 'notification.type.{$notification_type}' + WHERE item_type = '{$notification_type}'"; + $this->db->sql_query($sql); + } + } + + public function revert_notifications_name() + { + foreach ($this->notification_types as $notification_type) + { + $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . " + SET notification_type_name = '{$notification_type}' + WHERE notification_type_name = 'notification.type.{$notification_type}'"; + $this->db->sql_query($sql); + + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET item_type = '{$notification_type}' + WHERE item_type = 'notification.type.{$notification_type}'"; + $this->db->sql_query($sql); + } + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/rc3.php b/phpBB/phpbb/db/migration/data/v310/rc3.php new file mode 100644 index 0000000000..0e6a452251 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/rc3.php @@ -0,0 +1,35 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class rc3 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\rc2', + '\phpbb\db\migration\data\v310\captcha_plugins', + '\phpbb\db\migration\data\v310\rename_too_long_indexes', + '\phpbb\db\migration\data\v310\search_type', + '\phpbb\db\migration\data\v310\topic_sort_username', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.0-RC3')), + ); + } +} diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 8bc63e564a..44bea3c5d2 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -715,60 +715,6 @@ class migrator } /** - * Load migration data files from a directory - * - * @param \phpbb\finder $finder - * @param string $path Path to migration data files - * @param bool $check_fulfillable If TRUE (default), we will check - * if all of the migrations are fulfillable after loading them. - * If FALSE, we will not check. You SHOULD check at least once - * to prevent errors (if including multiple directories, check - * with the last call to prevent throwing errors unnecessarily). - * @return array Array of migration names - * @throws \phpbb\db\migration\exception - */ - public function load_migrations(\phpbb\finder $finder, $path, $check_fulfillable = true) - { - if (!is_dir($path)) - { - throw new \phpbb\db\migration\exception('DIRECTORY INVALID', $path); - } - - $migrations = array(); - - $files = $finder - ->extension_directory("/") - ->find_from_paths(array('/' => $path)); - foreach ($files as $file) - { - $migrations[$file['path'] . $file['filename']] = ''; - } - $migrations = $finder->get_classes_from_files($migrations); - - foreach ($migrations as $migration) - { - if (!in_array($migration, $this->migrations)) - { - $this->migrations[] = $migration; - } - } - - if ($check_fulfillable) - { - foreach ($this->migrations as $name) - { - $unfulfillable = $this->unfulfillable($name); - if ($unfulfillable !== false) - { - throw new \phpbb\db\migration\exception('MIGRATION_NOT_FULFILLABLE', $name, $unfulfillable); - } - } - } - - return $this->migrations; - } - - /** * Creates the migrations table if it does not exist. * @return null */ diff --git a/phpBB/phpbb/feed/forum.php b/phpBB/phpbb/feed/forum.php index 610b755af3..7a2087c1cd 100644 --- a/phpBB/phpbb/feed/forum.php +++ b/phpBB/phpbb/feed/forum.php @@ -94,7 +94,7 @@ class forum extends \phpbb\feed\post_base WHERE forum_id = ' . $this->forum_id . ' AND topic_moved_id = 0 AND ' . $this->content_visibility->get_visibility_sql('topic', $this->forum_id) . ' - ORDER BY topic_last_post_time DESC'; + ORDER BY topic_last_post_time DESC, topic_last_post_id DESC'; $result = $this->db->sql_query_limit($sql, $this->num_items); $topic_ids = array(); @@ -123,7 +123,7 @@ class forum extends \phpbb\feed\post_base AND ' . $this->content_visibility->get_visibility_sql('post', $this->forum_id, 'p.') . ' AND p.post_time >= ' . $min_post_time . ' AND p.poster_id = u.user_id', - 'ORDER_BY' => 'p.post_time DESC', + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', ); return true; diff --git a/phpBB/phpbb/feed/news.php b/phpBB/phpbb/feed/news.php index ea5f4febf5..a02c199d85 100644 --- a/phpBB/phpbb/feed/news.php +++ b/phpBB/phpbb/feed/news.php @@ -99,7 +99,7 @@ class news extends \phpbb\feed\topic_base ), 'WHERE' => 'p.topic_id = t.topic_id AND ' . $this->db->sql_in_set('p.post_id', $post_ids), - 'ORDER_BY' => 'p.post_time DESC', + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', ); return true; diff --git a/phpBB/phpbb/feed/overall.php b/phpBB/phpbb/feed/overall.php index f6847c041e..ab452f5386 100644 --- a/phpBB/phpbb/feed/overall.php +++ b/phpBB/phpbb/feed/overall.php @@ -34,7 +34,7 @@ class overall extends \phpbb\feed\post_base FROM ' . TOPICS_TABLE . ' WHERE topic_moved_id = 0 AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $forum_ids) . ' - ORDER BY topic_last_post_time DESC'; + ORDER BY topic_last_post_time DESC, topic_last_post_id DESC'; $result = $this->db->sql_query_limit($sql, $this->num_items); $topic_ids = array(); @@ -71,7 +71,7 @@ class overall extends \phpbb\feed\post_base AND ' . $this->content_visibility->get_forums_visibility_sql('post', $forum_ids, 'p.') . ' AND p.post_time >= ' . $min_post_time . ' AND u.user_id = p.poster_id', - 'ORDER_BY' => 'p.post_time DESC', + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', ); return true; diff --git a/phpBB/phpbb/feed/topic.php b/phpBB/phpbb/feed/topic.php index 78e0b4b8ab..66c49e55cf 100644 --- a/phpBB/phpbb/feed/topic.php +++ b/phpBB/phpbb/feed/topic.php @@ -101,7 +101,7 @@ class topic extends \phpbb\feed\post_base 'WHERE' => 'p.topic_id = ' . $this->topic_id . ' AND ' . $this->content_visibility->get_visibility_sql('post', $this->forum_id, 'p.') . ' AND p.poster_id = u.user_id', - 'ORDER_BY' => 'p.post_time DESC', + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', ); return true; diff --git a/phpBB/phpbb/feed/topics.php b/phpBB/phpbb/feed/topics.php index 88ca7c33f3..2b9cb3501a 100644 --- a/phpBB/phpbb/feed/topics.php +++ b/phpBB/phpbb/feed/topics.php @@ -71,7 +71,7 @@ class topics extends \phpbb\feed\topic_base ), 'WHERE' => 'p.topic_id = t.topic_id AND ' . $this->db->sql_in_set('p.post_id', $post_ids), - 'ORDER_BY' => 'p.post_time DESC', + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', ); return true; diff --git a/phpBB/phpbb/feed/topics_active.php b/phpBB/phpbb/feed/topics_active.php index cde6d36f45..6d5eddfc16 100644 --- a/phpBB/phpbb/feed/topics_active.php +++ b/phpBB/phpbb/feed/topics_active.php @@ -56,7 +56,7 @@ class topics_active extends \phpbb\feed\topic_base WHERE topic_moved_id = 0 AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . ' ' . $last_post_time_sql . ' - ORDER BY topic_last_post_time DESC'; + ORDER BY topic_last_post_time DESC, topic_last_post_id DESC'; $result = $this->db->sql_query_limit($sql, $this->num_items); $post_ids = array(); @@ -88,7 +88,7 @@ class topics_active extends \phpbb\feed\topic_base ), 'WHERE' => 'p.topic_id = t.topic_id AND ' . $this->db->sql_in_set('p.post_id', $post_ids), - 'ORDER_BY' => 'p.post_time DESC', + 'ORDER_BY' => 'p.post_time DESC, p.post_id DESC', ); return true; diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index 5e4bab1530..81b450ebbd 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -570,7 +570,7 @@ class manager { $subscription_methods[$method_name] = array( 'id' => $method->get_type(), - 'lang' => 'NOTIFICATION_METHOD_' . strtoupper($method->get_type()), + 'lang' => str_replace('.', '_', strtoupper($method->get_type())), ); } } @@ -851,8 +851,6 @@ class manager */ public function get_item_type_class($notification_type_name, $data = array()) { - $notification_type_name = (strpos($notification_type_name, 'notification.type.') === 0) ? $notification_type_name : 'notification.type.' . $notification_type_name; - $item = $this->load_object($notification_type_name); $item->set_initial_data($data); @@ -865,8 +863,6 @@ class manager */ public function get_method_class($method_name) { - $method_name = (strpos($method_name, 'notification.method.') === 0) ? $method_name : 'notification.method.' . $method_name; - return $this->load_object($method_name); } diff --git a/phpBB/phpbb/notification/method/email.php b/phpBB/phpbb/notification/method/email.php index 424f0aaf57..a4b93bc85c 100644 --- a/phpBB/phpbb/notification/method/email.php +++ b/phpBB/phpbb/notification/method/email.php @@ -27,7 +27,7 @@ class email extends \phpbb\notification\method\messenger_base */ public function get_type() { - return 'email'; + return 'notification.method.email'; } /** diff --git a/phpBB/phpbb/notification/method/jabber.php b/phpBB/phpbb/notification/method/jabber.php index 55de50fecd..09f186e3ca 100644 --- a/phpBB/phpbb/notification/method/jabber.php +++ b/phpBB/phpbb/notification/method/jabber.php @@ -27,7 +27,7 @@ class jabber extends \phpbb\notification\method\messenger_base */ public function get_type() { - return 'jabber'; + return 'notification.method.jabber'; } /** diff --git a/phpBB/phpbb/notification/type/admin_activate_user.php b/phpBB/phpbb/notification/type/admin_activate_user.php index 364df74cc5..038ca3726e 100644 --- a/phpBB/phpbb/notification/type/admin_activate_user.php +++ b/phpBB/phpbb/notification/type/admin_activate_user.php @@ -25,7 +25,7 @@ class admin_activate_user extends \phpbb\notification\type\base */ public function get_type() { - return 'admin_activate_user'; + return 'notification.type.admin_activate_user'; } /** diff --git a/phpBB/phpbb/notification/type/approve_post.php b/phpBB/phpbb/notification/type/approve_post.php index 22c9076adc..a9e635b41a 100644 --- a/phpBB/phpbb/notification/type/approve_post.php +++ b/phpBB/phpbb/notification/type/approve_post.php @@ -27,7 +27,7 @@ class approve_post extends \phpbb\notification\type\post */ public function get_type() { - return 'approve_post'; + return 'notification.type.approve_post'; } /** diff --git a/phpBB/phpbb/notification/type/approve_topic.php b/phpBB/phpbb/notification/type/approve_topic.php index 77e53a0064..2f4678359c 100644 --- a/phpBB/phpbb/notification/type/approve_topic.php +++ b/phpBB/phpbb/notification/type/approve_topic.php @@ -27,7 +27,7 @@ class approve_topic extends \phpbb\notification\type\topic */ public function get_type() { - return 'approve_topic'; + return 'notification.type.approve_topic'; } /** diff --git a/phpBB/phpbb/notification/type/bookmark.php b/phpBB/phpbb/notification/type/bookmark.php index 21180b3b53..4f2d34cb60 100644 --- a/phpBB/phpbb/notification/type/bookmark.php +++ b/phpBB/phpbb/notification/type/bookmark.php @@ -27,7 +27,7 @@ class bookmark extends \phpbb\notification\type\post */ public function get_type() { - return 'bookmark'; + return 'notification.type.bookmark'; } /** diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php index 7b18ed70ea..6c7bcbcaee 100644 --- a/phpBB/phpbb/notification/type/disapprove_post.php +++ b/phpBB/phpbb/notification/type/disapprove_post.php @@ -27,7 +27,7 @@ class disapprove_post extends \phpbb\notification\type\approve_post */ public function get_type() { - return 'disapprove_post'; + return 'notification.type.disapprove_post'; } /** diff --git a/phpBB/phpbb/notification/type/disapprove_topic.php b/phpBB/phpbb/notification/type/disapprove_topic.php index 3f87741807..efa5eb7ecd 100644 --- a/phpBB/phpbb/notification/type/disapprove_topic.php +++ b/phpBB/phpbb/notification/type/disapprove_topic.php @@ -27,7 +27,7 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic */ public function get_type() { - return 'disapprove_topic'; + return 'notification.type.disapprove_topic'; } /** diff --git a/phpBB/phpbb/notification/type/group_request.php b/phpBB/phpbb/notification/type/group_request.php index 980234c129..4baf516fed 100644 --- a/phpBB/phpbb/notification/type/group_request.php +++ b/phpBB/phpbb/notification/type/group_request.php @@ -20,7 +20,7 @@ class group_request extends \phpbb\notification\type\base */ public function get_type() { - return 'group_request'; + return 'notification.type.group_request'; } /** diff --git a/phpBB/phpbb/notification/type/group_request_approved.php b/phpBB/phpbb/notification/type/group_request_approved.php index bf9cd0019f..d284046ffa 100644 --- a/phpBB/phpbb/notification/type/group_request_approved.php +++ b/phpBB/phpbb/notification/type/group_request_approved.php @@ -20,7 +20,7 @@ class group_request_approved extends \phpbb\notification\type\base */ public function get_type() { - return 'group_request_approved'; + return 'notification.type.group_request_approved'; } /** diff --git a/phpBB/phpbb/notification/type/pm.php b/phpBB/phpbb/notification/type/pm.php index 8445ca4b22..330a70c85a 100644 --- a/phpBB/phpbb/notification/type/pm.php +++ b/phpBB/phpbb/notification/type/pm.php @@ -27,7 +27,7 @@ class pm extends \phpbb\notification\type\base */ public function get_type() { - return 'pm'; + return 'notification.type.pm'; } /** diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index 1eba4a6a88..d9e74f2e95 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -27,7 +27,7 @@ class post extends \phpbb\notification\type\base */ public function get_type() { - return 'post'; + return 'notification.type.post'; } /** diff --git a/phpBB/phpbb/notification/type/post_in_queue.php b/phpBB/phpbb/notification/type/post_in_queue.php index 3bb1028619..315b8b0243 100644 --- a/phpBB/phpbb/notification/type/post_in_queue.php +++ b/phpBB/phpbb/notification/type/post_in_queue.php @@ -27,7 +27,7 @@ class post_in_queue extends \phpbb\notification\type\post */ public function get_type() { - return 'post_in_queue'; + return 'notification.type.post_in_queue'; } /** @@ -44,7 +44,7 @@ class post_in_queue extends \phpbb\notification\type\post * Array of data (including keys 'id', 'lang', and 'group') */ public static $notification_option = array( - 'id' => 'needs_approval', + 'id' => 'notification.type.needs_approval', 'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE', 'group' => 'NOTIFICATION_GROUP_MODERATION', ); diff --git a/phpBB/phpbb/notification/type/quote.php b/phpBB/phpbb/notification/type/quote.php index 5c3c822ec2..508ca92fa0 100644 --- a/phpBB/phpbb/notification/type/quote.php +++ b/phpBB/phpbb/notification/type/quote.php @@ -27,7 +27,7 @@ class quote extends \phpbb\notification\type\post */ public function get_type() { - return 'quote'; + return 'notification.type.quote'; } /** diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index 14a328e104..d39143f4b7 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -27,7 +27,7 @@ class report_pm extends \phpbb\notification\type\pm */ public function get_type() { - return 'report_pm'; + return 'notification.type.report_pm'; } /** @@ -61,7 +61,7 @@ class report_pm extends \phpbb\notification\type\pm * Array of data (including keys 'id', 'lang', and 'group') */ public static $notification_option = array( - 'id' => 'report', + 'id' => 'notification.type.report', 'lang' => 'NOTIFICATION_TYPE_REPORT', 'group' => 'NOTIFICATION_GROUP_MODERATION', ); diff --git a/phpBB/phpbb/notification/type/report_pm_closed.php b/phpBB/phpbb/notification/type/report_pm_closed.php index de7bf74a97..9f301ee2cc 100644 --- a/phpBB/phpbb/notification/type/report_pm_closed.php +++ b/phpBB/phpbb/notification/type/report_pm_closed.php @@ -27,7 +27,7 @@ class report_pm_closed extends \phpbb\notification\type\pm */ public function get_type() { - return 'report_pm_closed'; + return 'notification.type.report_pm_closed'; } /** diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php index bec59df9d5..027cca716b 100644 --- a/phpBB/phpbb/notification/type/report_post.php +++ b/phpBB/phpbb/notification/type/report_post.php @@ -26,7 +26,7 @@ class report_post extends \phpbb\notification\type\post_in_queue */ public function get_type() { - return 'report_post'; + return 'notification.type.report_post'; } /** @@ -67,7 +67,7 @@ class report_post extends \phpbb\notification\type\post_in_queue * Array of data (including keys 'id' and 'lang') */ public static $notification_option = array( - 'id' => 'report', + 'id' => 'notification.type.report', 'lang' => 'NOTIFICATION_TYPE_REPORT', 'group' => 'NOTIFICATION_GROUP_MODERATION', ); diff --git a/phpBB/phpbb/notification/type/report_post_closed.php b/phpBB/phpbb/notification/type/report_post_closed.php index cd1400f8fa..a0bb187a0d 100644 --- a/phpBB/phpbb/notification/type/report_post_closed.php +++ b/phpBB/phpbb/notification/type/report_post_closed.php @@ -27,7 +27,7 @@ class report_post_closed extends \phpbb\notification\type\post */ public function get_type() { - return 'report_post_closed'; + return 'notification.type.report_post_closed'; } /** diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php index af199fb765..cf0ec77099 100644 --- a/phpBB/phpbb/notification/type/topic.php +++ b/phpBB/phpbb/notification/type/topic.php @@ -27,7 +27,7 @@ class topic extends \phpbb\notification\type\base */ public function get_type() { - return 'topic'; + return 'notification.type.topic'; } /** diff --git a/phpBB/phpbb/notification/type/topic_in_queue.php b/phpBB/phpbb/notification/type/topic_in_queue.php index aef1487d77..4c60c6b858 100644 --- a/phpBB/phpbb/notification/type/topic_in_queue.php +++ b/phpBB/phpbb/notification/type/topic_in_queue.php @@ -27,7 +27,7 @@ class topic_in_queue extends \phpbb\notification\type\topic */ public function get_type() { - return 'topic_in_queue'; + return 'notification.type.topic_in_queue'; } /** @@ -44,7 +44,7 @@ class topic_in_queue extends \phpbb\notification\type\topic * Array of data (including keys 'id', 'lang', and 'group') */ public static $notification_option = array( - 'id' => 'needs_approval', + 'id' => 'notification.type.needs_approval', 'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE', 'group' => 'NOTIFICATION_GROUP_MODERATION', ); diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index 5e2057f818..a3b002f350 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -177,6 +177,10 @@ class twig extends \phpbb\template\base } $names = $this->get_user_style(); + // Add 'all' folder to $names array + // It allows extensions to load a template file from 'all' folder, + // if a style doesn't include it. + $names[] = 'all'; $paths = array(); foreach ($style_directories as $directory) diff --git a/phpBB/report.php b/phpBB/report.php index fd6fab6645..1b5d3c9d46 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -231,7 +231,7 @@ if ($submit && $reason_id) $lang_return = $user->lang['RETURN_TOPIC']; $lang_success = $user->lang['POST_REPORTED_SUCCESS']; - $phpbb_notifications->add_notifications('report_post', array_merge($report_data, $row, $forum_data, array( + $phpbb_notifications->add_notifications('notification.type.report_post', array_merge($report_data, $row, $forum_data, array( 'report_text' => $report_text, ))); } @@ -261,7 +261,7 @@ if ($submit && $reason_id) $lang_return = $user->lang['RETURN_PM']; $lang_success = $user->lang['PM_REPORTED_SUCCESS']; - $phpbb_notifications->add_notifications('report_pm', array_merge($report_data, $row, array( + $phpbb_notifications->add_notifications('notification.type.report_pm', array_merge($report_data, $row, array( 'report_text' => $report_text, 'from_user_id' => $report_data['author_id'], 'report_id' => $report_id, diff --git a/phpBB/search.php b/phpBB/search.php index 071db30f3d..67f6f4dbb5 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -281,12 +281,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) trigger_error($error); } - $common_words = $search->get_common_words(); - // let the search module split up the keywords if ($keywords) { $correct_query = $search->split_keywords($keywords, $search_terms); + $common_words = $search->get_common_words(); if (!$correct_query || (!$search->get_search_query() && !sizeof($author_id_ary) && !$search_id)) { $ignored = (sizeof($common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $common_words)) . '<br />' : ''; @@ -599,7 +598,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'SEARCH_MATCHES' => $l_search_matches, 'SEARCH_WORDS' => $keywords, 'SEARCHED_QUERY' => $search->get_search_query(), - 'IGNORED_WORDS' => (sizeof($common_words)) ? implode(' ', $common_words) : '', + 'IGNORED_WORDS' => (!empty($common_words)) ? implode(' ', $common_words) : '', 'PHRASE_SEARCH_DISABLED' => $phrase_search_disabled, diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg index 520b1f0e98..aea59021d6 100644 --- a/phpBB/styles/prosilver/style.cfg +++ b/phpBB/styles/prosilver/style.cfg @@ -21,8 +21,8 @@ # General Information about this style name = prosilver copyright = © phpBB Limited, 2007 -style_version = 3.1.0-RC2 -phpbb_version = 3.1.0-RC2 +style_version = 3.1.0-RC3 +phpbb_version = 3.1.0-RC3 # Defining a different template bitfield # template_bitfield = lNg= diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 0dd47bea9e..22859b2452 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -34,8 +34,8 @@ <!-- IF S_ENABLE_FEEDS and forumrow.S_FEED_ENABLED --><!-- <a class="feed-icon-forum" title="{L_FEED} - {forumrow.FORUM_NAME}" href="{U_FEED}?f={forumrow.FORUM_ID}"><img src="{T_THEME_PATH}/images/feed.gif" alt="{L_FEED} - {forumrow.FORUM_NAME}" /></a> --><!-- ENDIF --> <!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF --> - <a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br /> - {forumrow.FORUM_DESC} + <a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a> + <!-- IF forumrow.FORUM_DESC --><br />{forumrow.FORUM_DESC}<!-- ENDIF --> <!-- IF forumrow.MODERATORS --> <br /><strong>{forumrow.L_MODERATOR_STR}{L_COLON}</strong> {forumrow.MODERATORS} <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/mcp_warn_post.html b/phpBB/styles/prosilver/template/mcp_warn_post.html index 0dd2e14d92..59c7d0d495 100644 --- a/phpBB/styles/prosilver/template/mcp_warn_post.html +++ b/phpBB/styles/prosilver/template/mcp_warn_post.html @@ -44,6 +44,8 @@ </div> </div> +<!-- EVENT mcp_warn_post_add_warning_field_before --> + <div class="panel"> <div class="inner"> @@ -64,6 +66,8 @@ </div> </div> +<!-- EVENT mcp_warn_post_add_warning_field_after --> + <fieldset class="submit-buttons"> <input type="reset" value="{L_RESET}" name="reset" class="button2" /> <input type="submit" name="action[add_warning]" value="{L_SUBMIT}" class="button1" /> diff --git a/phpBB/styles/prosilver/template/mcp_warn_user.html b/phpBB/styles/prosilver/template/mcp_warn_user.html index 1541f2e5f6..1ad6df7ade 100644 --- a/phpBB/styles/prosilver/template/mcp_warn_user.html +++ b/phpBB/styles/prosilver/template/mcp_warn_user.html @@ -28,6 +28,8 @@ </div> </div> +<!-- EVENT mcp_warn_user_add_warning_field_before --> + <div class="panel"> <div class="inner"> @@ -48,6 +50,8 @@ </div> </div> +<!-- EVENT mcp_warn_user_add_warning_field_after --> + <fieldset class="submit-buttons"> <input type="reset" value="{L_RESET}" name="reset" class="button2" /> <input type="submit" name="action[add_warning]" value="{L_SUBMIT}" class="button1" /> diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html index 4fb383a0ba..bc71aa0969 100644 --- a/phpBB/styles/prosilver/template/memberlist_im.html +++ b/phpBB/styles/prosilver/template/memberlist_im.html @@ -1,6 +1,6 @@ <!-- INCLUDE simple_header.html --> -<h2 class="solo">{L_SEND_IM}</h2> +<h2>{L_SEND_IM}</h2> <form method="post" action="{S_IM_ACTION}"> diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index ffa57f9cc8..eb151af8df 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -10,7 +10,7 @@ <!-- IF AVATAR_IMG --> <dl class="left-box"> - <dt>{AVATAR_IMG}</dt> + <dt class="profile-avatar">{AVATAR_IMG}</dt> <!-- IF RANK_TITLE --><dd style="text-align: center;">{RANK_TITLE}</dd><!-- ENDIF --> <!-- IF RANK_IMG --><dd style="text-align: center;">{RANK_IMG}</dd><!-- ENDIF --> </dl> @@ -65,7 +65,7 @@ <dl class="details"> <!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}{L_COLON}</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER}</a></dd><!-- ENDIF --> <!-- IF U_PM --><dt>{L_PM}{L_COLON}</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd><!-- ENDIF --> - <!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}{L_COLON}</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}{L_COLON}</dt> <dd>{USER_JABBER}</dd><!-- ENDIF --> + <!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}{L_COLON}</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 750, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}{L_COLON}</dt> <dd>{USER_JABBER}</dd><!-- ENDIF --> <!-- BEGIN custom_fields --> <!-- IF custom_fields.S_PROFILE_CONTACT --> <dt>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</dt> diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index 25e3be3bcb..333e61008e 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -43,7 +43,7 @@ <!-- END smiley --> <!-- ENDIF --> <!-- IF S_SHOW_SMILEY_LINK and S_SMILIES_ALLOWED--> - <br /><a href="{U_MORE_SMILIES}" onclick="popup(this.href, 300, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a> + <br /><a href="{U_MORE_SMILIES}" onclick="popup(this.href, 750, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a> <!-- ENDIF --> <!-- IF BBCODE_STATUS --> @@ -107,7 +107,7 @@ <a href="#tabs" data-subpanel="attach-panel" role="tab" aria-controls="attach-panel"> {L_ATTACHMENTS} <strong id="file-total-progress"><strong id="file-total-progress-bar"></strong></strong> </a> - </li> + </li> <!-- ENDIF --> <!-- IF S_SHOW_POLL_BOX || S_POLL_DELETE --> <li id="poll-panel-tab" class="tab"> diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html index 0831d5f9dc..610e5d5582 100644 --- a/phpBB/styles/prosilver/template/simple_header.html +++ b/phpBB/styles/prosilver/template/simple_header.html @@ -36,6 +36,6 @@ <!-- EVENT simple_header_body_before --> -<div id="simple-wrap"> +<div id="wrap"> <a id="top" class="anchor" accesskey="t"></a> <div id="page-body"> diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options.html b/phpBB/styles/prosilver/template/ucp_avatar_options.html index ca077fdf5b..2cf9488ed0 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options.html @@ -17,7 +17,6 @@ <dl> <dt><label>{L_AVATAR_TYPE}{L_COLON}</label></dt> <dd><select name="avatar_driver" id="avatar_driver" data-togglable-settings="true"> - <option value="">{L_NO_AVATAR}</option> <!-- BEGIN avatar_drivers --> <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting="#avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option> <!-- END avatar_drivers --> diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index 941541c582..ddd95780d7 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -14,7 +14,7 @@ <!-- ENDIF --> -<div id="post-{MESSAGE_ID}" class="post pm<!-- IF S_POST_UNAPPROVED or S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF S_ONLINE --> online<!-- ENDIF -->"> +<div id="post-{MESSAGE_ID}" class="post pm has-profile<!-- IF S_POST_UNAPPROVED or S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF S_ONLINE --> online<!-- ENDIF -->"> <div class="inner"> <dl class="postprofile" id="profile{MESSAGE_ID}"> @@ -55,7 +55,7 @@ <!-- IF REMAINDER eq 0 --> <div> <!-- ENDIF --> - <a href="<!-- IF contact.U_CONTACT -->{contact.U_CONTACT}<!-- ELSE -->{contact.U_PROFILE_AUTHOR}<!-- ENDIF -->" title="{contact.NAME}"<!-- IF $S_LAST_CELL --> class="last-cell"<!-- ENDIF --><!-- IF contact.ID eq 'jabber' --> onclick="popup(this.href, 550, 320); return false;"<!-- ENDIF -->> + <a href="<!-- IF contact.U_CONTACT -->{contact.U_CONTACT}<!-- ELSE -->{contact.U_PROFILE_AUTHOR}<!-- ENDIF -->" title="{contact.NAME}"<!-- IF $S_LAST_CELL --> class="last-cell"<!-- ENDIF --><!-- IF contact.ID eq 'jabber' --> onclick="popup(this.href, 750, 320); return false;"<!-- ENDIF -->> <span class="contact-icon {contact.ID}-icon">{contact.NAME}</span> </a> <!-- IF REMAINDER eq 3 or contact.S_LAST_ROW --> diff --git a/phpBB/styles/prosilver/template/viewonline_whois.html b/phpBB/styles/prosilver/template/viewonline_whois.html index 031f18afdc..5d780490da 100644 --- a/phpBB/styles/prosilver/template/viewonline_whois.html +++ b/phpBB/styles/prosilver/template/viewonline_whois.html @@ -1,14 +1,10 @@ <!-- INCLUDE simple_header.html --> -<h2 class="whois-title">{L_WHOIS}</h2> +<h2>{L_WHOIS}</h2> <div class="panel"> <div class="inner"> - - <div class="postbody"><div class="content"> - <pre>{WHOIS}</pre> - </div></div> - + <pre>{WHOIS}</pre> </div> </div> <a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a> diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index ac9c9a362a..7ed8569798 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -51,7 +51,7 @@ <!-- IF .pagination or TOTAL_POSTS --> <div class="pagination"> - <!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --><a href="{U_VIEW_UNREAD_POST}" class="mark">{L_VIEW_UNREAD_POST}</a> • <!-- ENDIF -->{TOTAL_POSTS} + <!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --><a href="{U_VIEW_UNREAD_POST}" class="mark">{L_VIEW_UNREAD_POST}</a> • <!-- ENDIF -->{TOTAL_POSTS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> @@ -120,7 +120,7 @@ <!-- IF postrow.S_FIRST_UNREAD --> <a id="unread" class="anchor"<!-- IF S_UNREAD_VIEW --> data-url="{postrow.U_MINI_POST}"<!-- ENDIF -->></a> <!-- ENDIF --> - <div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF --><!-- IF postrow.POSTER_WARNINGS --> warned<!-- ENDIF -->"> + <div id="p{postrow.POST_ID}" class="post has-profile <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_POST_DELETED --> deleted<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_POST_HIDDEN --> online<!-- ENDIF --><!-- IF postrow.POSTER_WARNINGS --> warned<!-- ENDIF -->"> <div class="inner"> <dl class="postprofile" id="profile{postrow.POST_ID}"<!-- IF postrow.S_POST_HIDDEN --> style="display: none;"<!-- ENDIF -->> @@ -169,7 +169,7 @@ <!-- IF REMAINDER eq 0 --> <div> <!-- ENDIF --> - <a href="<!-- IF postrow.contact.U_CONTACT -->{postrow.contact.U_CONTACT}<!-- ELSE -->{postrow.contact.U_PROFILE_AUTHOR}<!-- ENDIF -->" title="{postrow.contact.NAME}"<!-- IF $S_LAST_CELL --> class="last-cell"<!-- ENDIF --><!-- IF postrow.contact.ID eq 'jabber' --> onclick="popup(this.href, 550, 320); return false;"<!-- ENDIF -->> + <a href="<!-- IF postrow.contact.U_CONTACT -->{postrow.contact.U_CONTACT}<!-- ELSE -->{postrow.contact.U_PROFILE_AUTHOR}<!-- ENDIF -->" title="{postrow.contact.NAME}"<!-- IF $S_LAST_CELL --> class="last-cell"<!-- ENDIF --><!-- IF postrow.contact.ID eq 'jabber' --> onclick="popup(this.href, 750, 320); return false;"<!-- ENDIF -->> <span class="contact-icon {postrow.contact.ID}-icon">{postrow.contact.NAME}</span> </a> <!-- IF REMAINDER eq 3 or postrow.contact.S_LAST_ROW --> @@ -302,6 +302,8 @@ <!-- IF postrow.BUMPED_MESSAGE --><div class="notice"><br /><br />{postrow.BUMPED_MESSAGE}</div><!-- ENDIF --> <!-- EVENT viewtopic_body_postrow_post_notices_after --> <!-- IF postrow.SIGNATURE --><div id="sig{postrow.POST_ID}" class="signature">{postrow.SIGNATURE}</div><!-- ENDIF --> + + <!-- EVENT viewtopic_body_postrow_post_content_footer --> </div> </div> @@ -361,7 +363,7 @@ <!-- IF .pagination or TOTAL_POSTS --> <div class="pagination"> - {TOTAL_POSTS} + {TOTAL_POSTS} <!-- IF .pagination --> <!-- INCLUDE pagination.html --> <!-- ELSE --> diff --git a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html index 83904bf63d..8378e3bcf4 100644 --- a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html +++ b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html @@ -1,4 +1,4 @@ -<!-- IF not S_IS_BOT and (U_WATCH_TOPIC or U_BOOKMARK_TOPIC or U_BUMP_TOPIC or S_HAS_ATTACHMENTS or U_EMAIL_TOPIC or U_PRINT_TOPIC or S_DISPLAY_TOPIC_TOOLS) --> +<!-- IF not S_IS_BOT and (U_WATCH_TOPIC or U_BOOKMARK_TOPIC or U_BUMP_TOPIC or U_EMAIL_TOPIC or U_PRINT_TOPIC or S_DISPLAY_TOPIC_TOOLS) --> <div class="dropdown-container dropdown-button-control topic-tools"> <span title="{L_TOPIC_TOOLS}" class="button icon-button tools-icon dropdown-trigger dropdown-select"></span> <div class="dropdown hidden"> diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index 0d98fe7a66..46fbbadef7 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -464,6 +464,11 @@ li.breadcrumbs span:first-child > a { float: right; } +.rtl .has-profile .postbody h3 { + margin-right: 0; + margin-left: 180px; +} + .rtl p.post-notice { padding-left: 5px; padding-right: 26px; @@ -655,6 +660,11 @@ li.breadcrumbs span:first-child > a { float: left; } +.rtl .has-profile .post-buttons { + left: 0; + right: auto; +} + .rtl .post-buttons li { float: right; } @@ -1090,4 +1100,8 @@ li.breadcrumbs span:first-child > a { margin-left: 5px; margin-right: 0; } + + .rtl .has-profile .post-buttons { + left: 20px; + } } diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css index b45aae5672..a08b49a81c 100644 --- a/phpBB/styles/prosilver/theme/buttons.css +++ b/phpBB/styles/prosilver/theme/buttons.css @@ -177,6 +177,14 @@ ul.linklist.bulletin > li.small-icon:before { margin-top: 2px; } +.has-profile .post-buttons { + float: none; + position: absolute; + margin: 0; + right: 0; + top: 5px; +} + .post-buttons > li { float: left; margin-right: 3px; diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 45cb88890d..a3a4157704 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -189,10 +189,6 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul { } } -#simple-wrap { - padding: 6px 0; -} - #page-body { margin: 4px 0; clear: both; @@ -303,6 +299,7 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul { background-repeat: no-repeat; background-position: 100% 0; border-radius: 7px; + position: relative; } .rowbg { @@ -768,6 +765,7 @@ table.info tbody th { float: left; width: auto; text-align: left; + max-width: 100%; } .left-box.profile-details { @@ -778,6 +776,7 @@ table.info tbody th { float: right; width: auto; text-align: right; + max-width: 100%; } dl.details { diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index 8b84545a2c..fa23a665f1 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -233,6 +233,7 @@ dd.option { line-height: 1.48em; width: 76%; float: left; + position: relative; } .postbody .ignore { @@ -249,7 +250,8 @@ dd.option { float: left; font-size: 1.5em; padding: 2px 0 0 0; - margin: 0 0 0.3em 0 !important; + margin-top: 0 !important; + margin-bottom: 0.3em !important; text-transform: none; border: none; font-family: "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif; @@ -261,6 +263,12 @@ dd.option { vertical-align: bottom; } +.has-profile .postbody h3 { + /* If there is a post-profile, we position the post-buttons differently */ + float: none !important; + margin-right: 180px; +} + .postbody .content { font-size: 1.3em; overflow-x: auto; @@ -759,6 +767,11 @@ dd.profile-contact { width: 30%; } +/* Profile used on view-profile */ +.profile-avatar img { + max-width: 100%; +} + /* pm list in compose message if mass pm is enabled */ dl.pmlist dt { width: 60% !important; diff --git a/phpBB/styles/prosilver/theme/images/created_by.jpg b/phpBB/styles/prosilver/theme/images/created_by.jpg Binary files differdeleted file mode 100644 index 68d56e2013..0000000000 --- a/phpBB/styles/prosilver/theme/images/created_by.jpg +++ /dev/null diff --git a/phpBB/assets/plupload/img/done.gif b/phpBB/styles/prosilver/theme/images/plupload/done.gif Binary files differindex 29f3ed7c97..29f3ed7c97 100644 --- a/phpBB/assets/plupload/img/done.gif +++ b/phpBB/styles/prosilver/theme/images/plupload/done.gif diff --git a/phpBB/assets/plupload/img/error.gif b/phpBB/styles/prosilver/theme/images/plupload/error.gif Binary files differindex 4682b63007..4682b63007 100644 --- a/phpBB/assets/plupload/img/error.gif +++ b/phpBB/styles/prosilver/theme/images/plupload/error.gif diff --git a/phpBB/assets/plupload/img/throbber.gif b/phpBB/styles/prosilver/theme/images/plupload/throbber.gif Binary files differindex 4ae8b16a5a..4ae8b16a5a 100644 --- a/phpBB/assets/plupload/img/throbber.gif +++ b/phpBB/styles/prosilver/theme/images/plupload/throbber.gif diff --git a/phpBB/styles/prosilver/theme/plupload.css b/phpBB/styles/prosilver/theme/plupload.css index f81064dbe6..7d4092c3fe 100644 --- a/phpBB/styles/prosilver/theme/plupload.css +++ b/phpBB/styles/prosilver/theme/plupload.css @@ -58,15 +58,15 @@ } .file-status.file-working { - background: url('../../../assets/plupload/img/throbber.gif'); + background: url('./images/plupload/throbber.gif'); } .file-status.file-uploaded { - background: url('../../../assets/plupload/img/done.gif'); + background: url('./images/plupload/done.gif'); } .file-status.file-error { - background: url('../../../assets/plupload/img/error.gif'); + background: url('./images/plupload/error.gif'); } .file-status { diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css index 3ef0044621..fc39e03da7 100644 --- a/phpBB/styles/prosilver/theme/responsive.css +++ b/phpBB/styles/prosilver/theme/responsive.css @@ -398,6 +398,10 @@ fieldset.polls dd.resultbar, fieldset.polls dd.poll_option_percent { /* Post ----------------------------------------*/ +.postbody { + position: inherit; +} + .postprofile, .postbody, .search .postbody { display: block; width: auto; @@ -412,6 +416,7 @@ fieldset.polls dd.resultbar, fieldset.polls dd.poll_option_percent { padding-bottom: 5px; margin: 0; margin-bottom: 5px; + min-height: 40px; overflow: hidden; } @@ -443,12 +448,18 @@ fieldset.polls dd.resultbar, fieldset.polls dd.poll_option_percent { max-height: 32px; } -@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 1.5dppx) -{ - /* Scale online image for HD displays */ - .online { - background-size: 40px; - } +.has-profile .postbody h3 { + margin-left: 0 !important; + margin-right: 0 !important; +} + +.has-profile .post-buttons { + right: 20px; + top: 15px; +} + +.online { + background-size: 40px; } /* Misc stuff diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg index 633acf66e0..3ef3154742 100644 --- a/phpBB/styles/subsilver2/style.cfg +++ b/phpBB/styles/subsilver2/style.cfg @@ -21,8 +21,8 @@ # General Information about this style name = subsilver2 copyright = © 2005 phpBB Limited -style_version = 3.1.0-RC2 -phpbb_version = 3.1.0-RC2 +style_version = 3.1.0-RC3 +phpbb_version = 3.1.0-RC3 # Defining a different template bitfield # template_bitfield = lNg= diff --git a/phpBB/styles/subsilver2/template/mcp_warn_post.html b/phpBB/styles/subsilver2/template/mcp_warn_post.html index 223457d158..68715eff2d 100644 --- a/phpBB/styles/subsilver2/template/mcp_warn_post.html +++ b/phpBB/styles/subsilver2/template/mcp_warn_post.html @@ -35,6 +35,8 @@ <form method="post" name="mcp" action="{U_POST_ACTION}"> +<!-- EVENT mcp_warn_post_add_warning_field_before --> + <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> <tr> <th align="center">{L_ADD_WARNING}</th> @@ -54,6 +56,9 @@ <td class="cat" align="center"><input class="btnmain" type="submit" name="action[add_warning]" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" /></td> </tr> </table> + +<!-- EVENT mcp_warn_post_add_warning_field_after --> + {S_FORM_TOKEN} </form> diff --git a/phpBB/styles/subsilver2/template/mcp_warn_user.html b/phpBB/styles/subsilver2/template/mcp_warn_user.html index 6b78c71557..20b57c6837 100644 --- a/phpBB/styles/subsilver2/template/mcp_warn_user.html +++ b/phpBB/styles/subsilver2/template/mcp_warn_user.html @@ -48,6 +48,8 @@ <form method="post" name="mcp" action="{U_POST_ACTION}"> +<!-- EVENT mcp_warn_user_add_warning_field_before --> + <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> <tr> <th align="center">{L_ADD_WARNING}</th> @@ -67,6 +69,9 @@ <td class="cat" align="center"><input class="btnmain" type="submit" name="action[add_warning]" value="{L_SUBMIT}" /> <input class="btnlite" type="reset" value="{L_RESET}" /></td> </tr> </table> + +<!-- EVENT mcp_warn_user_add_warning_field_after --> + {S_FORM_TOKEN} </form> diff --git a/phpBB/styles/subsilver2/template/ucp_groups_manage.html b/phpBB/styles/subsilver2/template/ucp_groups_manage.html index 55c1c20528..09d59c8ec0 100644 --- a/phpBB/styles/subsilver2/template/ucp_groups_manage.html +++ b/phpBB/styles/subsilver2/template/ucp_groups_manage.html @@ -78,7 +78,6 @@ <td class="row1" width="35%"><b class="genmed">{L_AVATAR_TYPE}{L_COLON}</b></td> <td class="row2"> <select name="avatar_driver" id="avatar_driver"> - <option value="">{L_NO_AVATAR}</option> <!-- BEGIN avatar_drivers --> <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF -->>{avatar_drivers.L_TITLE}</option> <!-- END avatar_drivers --> diff --git a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html index fc52c149c6..8b1e8cffac 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html @@ -28,7 +28,6 @@ <td class="row1" width="35%"><b class="genmed">{L_AVATAR_TYPE}{L_COLON}</b></td> <td class="row2"> <select name="avatar_driver" id="avatar_driver" data-togglable-settings="true"> - <option value="">{L_NO_AVATAR}</option> <!-- BEGIN avatar_drivers --> <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting=".avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option> <!-- END avatar_drivers --> diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index 0f34b50950..838f6c5f03 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -308,6 +308,8 @@ <!-- ENDIF --> <!-- EVENT viewtopic_body_postrow_post_notices_after --> + <!-- EVENT viewtopic_body_postrow_post_content_footer --> + <!-- IF not postrow.S_HAS_ATTACHMENTS --><br clear="all" /><br /><!-- ENDIF --> <table width="100%" cellspacing="0"> diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 9086feb390..9ecbdea77a 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -264,7 +264,7 @@ gen_forum_auth_level('forum', $forum_id, $forum_data['forum_status']); $limit_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); -$sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_posts_approved + t.topic_posts_unapproved + t.topic_posts_softdeleted' : 't.topic_posts_approved'), 's' => 't.topic_title', 'v' => 't.topic_views'); +$sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_posts_approved + t.topic_posts_unapproved + t.topic_posts_softdeleted' : 't.topic_posts_approved'), 's' => 't.topic_title', 'v' => 't.topic_views'); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param, $default_sort_days, $default_sort_key, $default_sort_dir); @@ -497,7 +497,7 @@ if ($start > $topics_count / 2) $store_reverse = true; // Select the sort order - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC'); + $direction = (($sort_dir == 'd') ? 'ASC' : 'DESC'); $sql_limit = $pagination->reverse_limit($start, $sql_limit, $topics_count); $sql_start = $pagination->reverse_start($start, $sql_limit, $topics_count); @@ -505,10 +505,19 @@ if ($start > $topics_count / 2) else { // Select the sort order - $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); + $direction = (($sort_dir == 'd') ? 'DESC' : 'ASC'); $sql_start = $start; } +if (is_array($sort_by_sql[$sort_key])) +{ + $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; +} +else +{ + $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; +} + if ($forum_data['forum_type'] == FORUM_POST || !sizeof($active_forum_ary)) { $sql_where = 't.forum_id = ' . $forum_id; diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 8d7ab5323d..20fea19f7c 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -94,7 +94,7 @@ if ($view && !$post_id) AND " . $phpbb_content_visibility->get_visibility_sql('post', $forum_id) . " AND post_time > $topic_last_read AND forum_id = $forum_id - ORDER BY post_time ASC"; + ORDER BY post_time ASC, post_id ASC"; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -146,7 +146,7 @@ if ($view && !$post_id) AND topic_moved_id = 0 AND topic_last_post_time $sql_condition {$row['topic_last_post_time']} AND " . $phpbb_content_visibility->get_visibility_sql('topic', $row['forum_id']) . " - ORDER BY topic_last_post_time $sql_ordering"; + ORDER BY topic_last_post_time $sql_ordering, topic_last_post_id $sql_ordering"; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -388,7 +388,7 @@ if (!isset($topic_tracking_info)) $limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); -$sort_by_sql = array('a' => array('u.username_clean', 'p.post_id'), 't' => 'p.post_time', 's' => array('p.post_subject', 'p.post_id')); +$sort_by_sql = array('a' => array('u.username_clean', 'p.post_id'), 't' => array('p.post_time', 'p.post_id'), 's' => array('p.post_subject', 'p.post_id')); $join_user_sql = array('a' => true, 't' => false, 's' => false); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; @@ -602,6 +602,35 @@ if (!empty($_EXTRA_URL)) // If we've got a hightlight set pass it on to pagination. $base_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . (($highlight_match) ? "&hilit=$highlight" : '')); + +/** +* Event to modify data before template variables are being assigned +* +* @event core.viewtopic_assign_template_vars_before +* @var string base_url URL to be passed to generate pagination +* @var int forum_id Forum ID +* @var int post_id Post ID +* @var array quickmod_array Array with quick moderation options data +* @var int start Pagination information +* @var array topic_data Array with topic data +* @var int topic_id Topic ID +* @var array topic_tracking_info Array with topic tracking data +* @var int total_posts Topic total posts count +* @since 3.1.0-RC4 +*/ +$vars = array( + 'base_url', + 'forum_id', + 'post_id', + 'quickmod_array', + 'start', + 'topic_data', + 'topic_id', + 'topic_tracking_info', + 'total_posts', +); +extract($phpbb_dispatcher->trigger_event('core.viewtopic_assign_template_vars_before', compact($vars))); + $pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_posts, $config['posts_per_page'], $start); // Send vars to template diff --git a/tests/avatar/fixtures/users.xml b/tests/avatar/fixtures/users.xml new file mode 100644 index 0000000000..3e6586e909 --- /dev/null +++ b/tests/avatar/fixtures/users.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<dataset> + <table name="phpbb_users"> + <column>user_id</column> + <column>username_clean</column> + <column>user_permissions</column> + <column>user_sig</column> + <column>user_avatar</column> + <column>user_avatar_type</column> + <column>user_avatar_width</column> + <column>user_avatar_height</column> + <row> + <value>1</value> + <value>barfoo</value> + <value></value> + <value></value> + <value>foobar@example.com</value> + <value>avatar.driver.gravatar</value> + <value>80</value> + <value>80</value> + </row> + <row> + <value>2</value> + <value>foobar</value> + <value></value> + <value></value> + <value></value> + <value></value> + <value></value> + <value></value> + </row> + </table> +</dataset> diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index 8463cdb6c2..81c153aed4 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -13,13 +13,18 @@ require_once dirname(__FILE__) . '/driver/foobar.php'; -class phpbb_avatar_manager_test extends \phpbb_test_case +class phpbb_avatar_manager_test extends \phpbb_database_test_case { /** @var \phpbb\avatar\manager */ protected $manager; protected $avatar_foobar; protected $avatar_barfoo; + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/users.xml'); + } + public function setUp() { global $phpbb_root_path, $phpEx; @@ -31,7 +36,7 @@ class phpbb_avatar_manager_test extends \phpbb_test_case ->will($this->returnArgument(0)); // Prepare dependencies for avatar manager and driver - $config = new \phpbb\config\config(array()); + $this->config = new \phpbb\config\config(array()); $cache = $this->getMock('\phpbb\cache\driver\driver_interface'); $path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( @@ -52,7 +57,7 @@ class phpbb_avatar_manager_test extends \phpbb_test_case $guesser = new \phpbb\mimetype\guesser($guessers); // $this->avatar_foobar will be needed later on - $this->avatar_foobar = $this->getMock('\phpbb\avatar\driver\foobar', array('get_name'), array($config, $phpbb_root_path, $phpEx, $path_helper, $cache)); + $this->avatar_foobar = $this->getMock('\phpbb\avatar\driver\foobar', array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $cache)); $this->avatar_foobar->expects($this->any()) ->method('get_name') ->will($this->returnValue('avatar.driver.foobar')); @@ -67,24 +72,26 @@ class phpbb_avatar_manager_test extends \phpbb_test_case { if ($driver !== 'upload') { - $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($config, $phpbb_root_path, $phpEx, $path_helper, $cache)); + $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $cache)); } else { - $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($config, $phpbb_root_path, $phpEx, $path_helper, $guesser, $cache)); + $cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $guesser, $cache)); } $cur_avatar->expects($this->any()) ->method('get_name') ->will($this->returnValue('avatar.driver.' . $driver)); - $config['allow_avatar_' . get_class($cur_avatar)] = false; + $this->config['allow_avatar_' . get_class($cur_avatar)] = $driver == 'gravatar'; $avatar_drivers[] = $cur_avatar; } - $config['allow_avatar_' . get_class($this->avatar_foobar)] = true; - $config['allow_avatar_' . get_class($this->avatar_barfoo)] = false; + $this->config['allow_avatar_' . get_class($this->avatar_foobar)] = true; + $this->config['allow_avatar_' . get_class($this->avatar_barfoo)] = false; // Set up avatar manager - $this->manager = new \phpbb\avatar\manager($config, $avatar_drivers, $phpbb_container); + $this->manager = new \phpbb\avatar\manager($this->config, $avatar_drivers, $phpbb_container); + $this->db = $this->new_dbal(); + $this->user = new \phpbb\user('\phpbb\datetime'); } protected function avatar_drivers() @@ -122,6 +129,7 @@ class phpbb_avatar_manager_test extends \phpbb_test_case { return array( array('avatar.driver.foobar', 'avatar.driver.foobar'), + array('avatar.driver.gravatar', 'avatar.driver.gravatar'), array('avatar.driver.foo_wrong', null), array('avatar.driver.local', null), array(AVATAR_GALLERY, null), @@ -196,8 +204,8 @@ class phpbb_avatar_manager_test extends \phpbb_test_case array( 'avatar' => '', 'avatar_type' => '', - 'avatar_width' => '', - 'avatar_height' => '', + 'avatar_width' => 0, + 'avatar_height' => 0, ), ), array( @@ -287,4 +295,42 @@ class phpbb_avatar_manager_test extends \phpbb_test_case array('FOOBAR_EXPLAIN', 'foo'), ))); } + + public function data_handle_avatar_delete() + { + return array( + array(array( + 'avatar' => '', + 'avatar_type' => '', + 'avatar_width' => 0, + 'avatar_height' => 0, + ), 1, array( + 'avatar' => 'foobar@example.com', + 'avatar_type' => 'avatar.driver.gravatar', + 'avatar_width' => '16', + 'avatar_height' => '16', + ), USERS_TABLE, 'user_'), + ); + } + + /** + * @dataProvider data_handle_avatar_delete + */ + public function test_handle_avatar_delete($expected, $id, $avatar_data, $table, $prefix) + { + $this->config['allow_avatar_gravatar'] = true; + $this->assertNull($this->manager->handle_avatar_delete($this->db, $this->user, $avatar_data, $table, $prefix)); + + $sql = 'SELECT * FROM ' . $table . ' + WHERE ' . $prefix . 'id = ' . $id; + $result = $this->db->sql_query_limit($sql, 1); + + $row = $this->manager->clean_row($this->db->sql_fetchrow($result), substr($prefix, 0, -1)); + $this->db->sql_freeresult($result); + + foreach ($expected as $key => $value) + { + $this->assertEquals($value, $row[$key]); + } + } } diff --git a/tests/console/config/config_test.php b/tests/console/config/config_test.php new file mode 100644 index 0000000000..7c098af004 --- /dev/null +++ b/tests/console/config/config_test.php @@ -0,0 +1,251 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Tester\CommandTester; + +class phpbb_console_command_config_test extends phpbb_test_case +{ + protected $config; + protected $command_name; + protected $user; + + public function setUp() + { + $this->config = new \phpbb\config\config(array()); + + $this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime')); + $this->user->method('lang')->will($this->returnArgument(0)); + } + + public function test_set_dynamic() + { + $this->assertEmpty($this->config); + + $command_tester = $this->get_command_tester('set'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + 'value' => 'test_value', + '--dynamic' => true, + )); + + $this->assertSame($this->config['test_key'], 'test_value'); + } + + public function test_set_no_dynamic() + { + $this->assertEmpty($this->config); + + $command_tester = $this->get_command_tester('set'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + 'value' => 'test_value', + '--dynamic' => false, + )); + + $this->assertSame($this->config['test_key'], 'test_value'); + } + + public function test_set_atomic_dynamic() + { + $this->assertEmpty($this->config); + + $this->config->set('test_key', 'old_value', true); + $this->assertSame($this->config['test_key'], 'old_value'); + + $command_tester = $this->get_command_tester('set_atomic'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + 'old' => 'old_value', + 'new' => 'new_value', + '--dynamic' => true, + )); + + $this->assertSame($this->config['test_key'], 'new_value'); + } + + public function test_set_atomic_no_dynamic() + { + $this->assertEmpty($this->config); + + $this->config->set('test_key', 'old_value', false); + $this->assertSame($this->config['test_key'], 'old_value'); + + $command_tester = $this->get_command_tester('set_atomic'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + 'old' => 'old_value', + 'new' => 'new_value', + '--dynamic' => false, + )); + + $this->assertSame($this->config['test_key'], 'new_value'); + } + + public function test_set_atomic_error_dynamic() + { + $this->assertEmpty($this->config); + + $this->config->set('test_key', 'wrong_value', true); + $this->assertSame($this->config['test_key'], 'wrong_value'); + + $command_tester = $this->get_command_tester('set_atomic'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + 'old' => 'old_value', + 'new' => 'new_value', + '--dynamic' => true, + )); + + $this->assertSame($this->config['test_key'], 'wrong_value'); + } + + public function test_get_no_new_line() + { + $this->config->set('test_key', 'test_value', false); + $this->assertSame($this->config['test_key'], 'test_value'); + + $command_tester = $this->get_command_tester('get'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + '--no-newline' => true, + )); + + $this->assertSame($this->config['test_key'], $command_tester->getDisplay()); + } + + public function test_get_new_line() + { + $this->config->set('test_key', 'test_value', false); + $this->assertSame($this->config['test_key'], 'test_value'); + + $command_tester = $this->get_command_tester('get'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + '--no-newline' => false, + )); + + $this->assertSame($this->config['test_key'] . PHP_EOL, $command_tester->getDisplay()); + } + + public function test_get_error() + { + $this->config->set('test_key', 'test_value', false); + $this->assertSame($this->config['test_key'], 'test_value'); + + $command_tester = $this->get_command_tester('get'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'wrong_key', + '--no-newline' => false, + )); + + $this->assertContains('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay()); + } + + public function test_increment_dynamic() + { + $this->config->set('test_key', 0, false); + $this->assertSame($this->config['test_key'], 0); + + $command_tester = $this->get_command_tester('increment'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + 'increment' => 2, + '--dynamic' => true, + )); + + $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); + $this->assertSame(2, $this->config['test_key']); + } + + public function test_increment_no_dynamic() + { + $this->config->set('test_key', 0, false); + $this->assertSame($this->config['test_key'], 0); + + $command_tester = $this->get_command_tester('increment'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + 'increment' => 2, + '--dynamic' => false, + )); + + $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); + $this->assertSame(2, $this->config['test_key']); + } + + public function test_increment_no_set() + { + $this->assertEmpty($this->config); + + $command_tester = $this->get_command_tester('increment'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + 'increment' => 2, + '--dynamic' => true, + )); + + $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); + $this->assertSame(2, $this->config['test_key']); + } + + public function test_delete_ok() + { + $this->config->set('test_key', 'test_value', false); + $this->assertSame($this->config['test_key'], 'test_value'); + + $command_tester = $this->get_command_tester('delete'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'test_key', + )); + + $this->assertContains('CLI_CONFIG_DELETE_SUCCESS', $command_tester->getDisplay()); + $this->assertEmpty($this->config); + } + + public function test_delete_error() + { + $this->assertEmpty($this->config); + + $command_tester = $this->get_command_tester('delete'); + $command_tester->execute(array( + 'command' => $this->command_name, + 'key' => 'wrong_key', + )); + + $this->assertContains('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay()); + $this->assertEmpty($this->config); + } + + public function get_command_tester($class_name) + { + $command_complete_name = '\phpbb\console\command\config' . '\\' . $class_name; + $application = new Application(); + $application->add(new $command_complete_name($this->user, $this->config)); + $command = $application->find('config:' . $this->command_name); + $this->command_name = $command->getName(); + return new CommandTester($command); + } +} diff --git a/tests/extension/ext/vendor4/bar/composer.json b/tests/extension/ext/vendor4/bar/composer.json new file mode 100644 index 0000000000..1a2fddc3f4 --- /dev/null +++ b/tests/extension/ext/vendor4/bar/composer.json @@ -0,0 +1,23 @@ +{ + "name": "vendor4/bar", + "type": "phpbb-extension", + "description": "An example/sample extension to be used for testing purposes in phpBB Development.", + "version": "1.0.0", + "time": "2012-02-15 01:01:01", + "license": "GPL-2.0", + "authors": [{ + "name": "John Smith", + "email": "email@phpbb.com", + "homepage": "http://phpbb.com", + "role": "N/A" + }], + "require": { + "php": ">=5.3" + }, + "extra": { + "display-name": "phpBB Bar Extension", + "soft-require": { + "phpbb/phpbb": "3.1.*@dev" + } + } +} diff --git a/tests/extension/ext/vendor4/bar/styles/all/template/foobar_body.html b/tests/extension/ext/vendor4/bar/styles/all/template/foobar_body.html new file mode 100644 index 0000000000..c8f8cf957e --- /dev/null +++ b/tests/extension/ext/vendor4/bar/styles/all/template/foobar_body.html @@ -0,0 +1 @@ +All folder diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index 5ec8e60a68..5c7cad89f6 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -36,7 +36,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case public function test_all_available() { // barfoo and vendor3/bar should not listed due to missing composer.json. barfoo also has incorrect dir structure. - $this->assertEquals(array('vendor/moo', 'vendor2/bar', 'vendor2/foo', 'vendor3/foo'), array_keys($this->extension_manager->all_available())); + $this->assertEquals(array('vendor/moo', 'vendor2/bar', 'vendor2/foo', 'vendor3/foo', 'vendor4/bar'), array_keys($this->extension_manager->all_available())); } public function test_all_enabled() diff --git a/tests/functional/avatar_acp_groups_test.php b/tests/functional/avatar_acp_groups_test.php index 35f7956252..925335a2f7 100644 --- a/tests/functional/avatar_acp_groups_test.php +++ b/tests/functional/avatar_acp_groups_test.php @@ -48,7 +48,7 @@ class phpbb_functional_avatar_acp_groups_test extends phpbb_functional_common_av ), // Delete avatar image to reset group settings array( - 'GROUP_UPDATED', + array('CONFIRM_AVATAR_DELETE', 'GROUP_UPDATED'), 'avatar_driver_gravatar', array( 'avatar_delete' => array('tick', ''), diff --git a/tests/functional/avatar_acp_users_test.php b/tests/functional/avatar_acp_users_test.php index 38e001f516..5eca473157 100644 --- a/tests/functional/avatar_acp_users_test.php +++ b/tests/functional/avatar_acp_users_test.php @@ -46,7 +46,7 @@ class phpbb_functional_avatar_acp_users_test extends phpbb_functional_common_ava ), // Reset avatar settings array( - 'USER_AVATAR_UPDATED', + array('CONFIRM_AVATAR_DELETE', 'USER_AVATAR_UPDATED'), 'avatar_driver_gravatar', array( 'avatar_delete' => array('tick', ''), diff --git a/tests/functional/avatar_ucp_groups_test.php b/tests/functional/avatar_ucp_groups_test.php index fddf66933f..1e8ca911c6 100644 --- a/tests/functional/avatar_ucp_groups_test.php +++ b/tests/functional/avatar_ucp_groups_test.php @@ -55,7 +55,7 @@ class phpbb_functional_avatar_ucp_groups_test extends phpbb_functional_common_av ), ), array( - 'GROUP_UPDATED', + array('CONFIRM_AVATAR_DELETE', 'GROUP_UPDATED'), 'avatar_driver_gravatar', array( 'avatar_delete' => array('tick', ''), diff --git a/tests/functional/avatar_ucp_users_test.php b/tests/functional/avatar_ucp_users_test.php index 62cd79c307..972bfa0fb2 100644 --- a/tests/functional/avatar_ucp_users_test.php +++ b/tests/functional/avatar_ucp_users_test.php @@ -36,18 +36,9 @@ class phpbb_functional_avatar_ucp_users_test extends phpbb_functional_common_ava 'avatar_gravatar_height' => 80, ), ), - // Wrong driver selected - array( - 'NO_AVATAR_SELECTED', - 'avatar_driver_upload', - array( - 'avatar_remote_url' => 'https://secure.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0.jpg', - 'avatar_remote_width' => 80, - 'avatar_remote_height' => 80, - ), - ), + array( - 'PROFILE_UPDATED', + array('CONFIRM_AVATAR_DELETE', 'PROFILE_UPDATED'), 'avatar_driver_gravatar', array( 'avatar_delete' => array('tick', ''), diff --git a/tests/functional/common_avatar_test.php b/tests/functional/common_avatar_test.php index 1bb9e5cd8e..82d7136c98 100644 --- a/tests/functional/common_avatar_test.php +++ b/tests/functional/common_avatar_test.php @@ -50,7 +50,7 @@ abstract class phpbb_functional_common_avatar_test extends phpbb_functional_test $this->assertContainsLang('CONFIG_UPDATED', $crawler->text()); } - public function assert_avatar_submit($expected, $type, $data, $button_text = 'SUBMIT') + public function assert_avatar_submit($expected, $type, $data, $delete = false, $button_text = 'SUBMIT') { $crawler = self::request('GET', $this->get_url() . '&sid=' . $this->sid); @@ -72,6 +72,12 @@ abstract class phpbb_functional_common_avatar_test extends phpbb_functional_test $crawler = self::submit($form); + if (is_array($expected)) + { + $delete_expected = $expected[1]; + $expected = $expected[0]; + } + try { $this->assertContainsLang($expected, $crawler->text()); @@ -80,5 +86,12 @@ abstract class phpbb_functional_common_avatar_test extends phpbb_functional_test { $this->assertContains($expected, $crawler->text()); } + + if ($delete) + { + $form = $crawler->selectButton('confirm')->form(); + $crawler = self::submit($form); + $this->assertContainsLang($delete_expected, $crawler->text()); + } } } diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 6490c1ead3..7be8957ec7 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -84,7 +84,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid); $this->assertCount(1, $crawler->filter('.ext_enabled')); - $this->assertCount(5, $crawler->filter('.ext_disabled')); + $this->assertCount(6, $crawler->filter('.ext_disabled')); $this->assertContains('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text()); $this->assertContainsLang('EXTENSION_DISABLE', $crawler->filter('.ext_enabled')->eq(0)->text()); diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index 532a160a47..18eb9ad4c6 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -26,6 +26,8 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c 'foo/bar/event/', 'foo/bar/language/en/', 'foo/bar/styles/prosilver/template/', + 'foo/foo/config/', + 'foo/foo/controller/', ); static public function setUpBeforeClass() @@ -65,6 +67,18 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c } /** + * Check a controller for extension foo/bar. + */ + public function test_routing_resources() + { + $this->phpbb_extension_manager->enable('foo/foo'); + $crawler = self::request('GET', 'app.php/foo/foo', array(), false); + self::assert_response_status_code(); + $this->assertContains("foo/foo controller handle() method", $crawler->filter('body')->text()); + $this->phpbb_extension_manager->purge('foo/foo'); + } + + /** * Check the output of a controller using the template system */ public function test_controller_with_template() diff --git a/tests/functional/fixtures/ext/foo/foo/composer.json b/tests/functional/fixtures/ext/foo/foo/composer.json new file mode 100644 index 0000000000..d85c76a6a2 --- /dev/null +++ b/tests/functional/fixtures/ext/foo/foo/composer.json @@ -0,0 +1,24 @@ +{ + "name": "foo/foo", + "type": "phpbb-extension", + "description": "Testing extensions", + "homepage": "", + "version": "1.0.0", + "time": "2013-03-21 01:01:01", + "license": "GPL-2.0", + "authors": [{ + "name": "Tristan Darricau", + "email": "nicofuma@phpbb.com", + "homepage": "http://www.phpbb.com", + "role": "Developer" + }], + "require": { + "php": ">=5.3" + }, + "extra": { + "display-name": "phpBB 3.1 Extension Testing", + "soft-require": { + "phpbb/phpbb": "3.1.*@dev" + } + } +} diff --git a/tests/functional/fixtures/ext/foo/foo/config/resource.yml b/tests/functional/fixtures/ext/foo/foo/config/resource.yml new file mode 100644 index 0000000000..ed1d018016 --- /dev/null +++ b/tests/functional/fixtures/ext/foo/foo/config/resource.yml @@ -0,0 +1,3 @@ +foo_foo_controller: + pattern: /foo + defaults: { _controller: foo_foo.controller:handle } diff --git a/tests/functional/fixtures/ext/foo/foo/config/routing.yml b/tests/functional/fixtures/ext/foo/foo/config/routing.yml new file mode 100644 index 0000000000..c2c401687d --- /dev/null +++ b/tests/functional/fixtures/ext/foo/foo/config/routing.yml @@ -0,0 +1,3 @@ +foo_foo.general: + resource: "resource.yml" + prefix: /foo diff --git a/tests/functional/fixtures/ext/foo/foo/config/services.yml b/tests/functional/fixtures/ext/foo/foo/config/services.yml new file mode 100644 index 0000000000..b3c7719715 --- /dev/null +++ b/tests/functional/fixtures/ext/foo/foo/config/services.yml @@ -0,0 +1,3 @@ +services: + foo_foo.controller: + class: foo\foo\controller\controller diff --git a/tests/functional/fixtures/ext/foo/foo/controller/controller.php b/tests/functional/fixtures/ext/foo/foo/controller/controller.php new file mode 100644 index 0000000000..771eaeacfc --- /dev/null +++ b/tests/functional/fixtures/ext/foo/foo/controller/controller.php @@ -0,0 +1,13 @@ +<?php + +namespace foo\foo\controller; + +use Symfony\Component\HttpFoundation\Response; + +class controller +{ + public function handle() + { + return new Response('foo/foo controller handle() method', 200); + } +} diff --git a/tests/functional/fixtures/ext/foo/foo/ext.php b/tests/functional/fixtures/ext/foo/foo/ext.php new file mode 100644 index 0000000000..80acda74fe --- /dev/null +++ b/tests/functional/fixtures/ext/foo/foo/ext.php @@ -0,0 +1,8 @@ +<?php + +namespace foo\foo; + +class ext extends \phpbb\extension\base +{ + +} diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php index e4a960f862..667d268b1e 100644 --- a/tests/functional/notification_test.php +++ b/tests/functional/notification_test.php @@ -21,20 +21,20 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case return array( // Rows inserted by phpBB/install/schemas/schema_data.sql // Also see PHPBB3-11460 - array('post_notification', true), - array('topic_notification', true), - array('post_email', true), - array('topic_email', true), + array('notification.type.post_notification', true), + array('notification.type.topic_notification', true), + array('notification.type.post_notification.method.email', true), + array('notification.type.topic_notification.method.email', true), // Default behaviour for in-board notifications: // If user did not opt-out, in-board notifications are on. - array('bookmark_notification', true), - array('quote_notification', true), + array('notification.type.bookmark_notification', true), + array('notification.type.quote_notification', true), // Default behaviour for email notifications: // If user did not opt-in, email notifications are off. - array('bookmark_email', false), - array('quote_email', false), + array('notification.type.bookmark_notification.method.email', false), + array('notification.type.quote_notification.method.email', false), ); } diff --git a/tests/lock/flock_test.php b/tests/lock/flock_test.php index 0ff38b6cc8..554b7e57f4 100644 --- a/tests/lock/flock_test.php +++ b/tests/lock/flock_test.php @@ -83,9 +83,9 @@ class phpbb_lock_flock_test extends phpbb_test_case sleep(1); $lock = new \phpbb\lock\flock($path); - $start = time(); + $start = microtime(true); $ok = $lock->acquire(); - $delta = time() - $start; + $delta = microtime(true) - $start; $this->assertTrue($ok); $this->assertTrue($lock->owns_lock()); $this->assertGreaterThan(0.5, $delta, 'First lock acquired too soon'); @@ -94,9 +94,9 @@ class phpbb_lock_flock_test extends phpbb_test_case $this->assertFalse($lock->owns_lock()); // acquire again, this should be instantaneous - $start = time(); + $start = microtime(true); $ok = $lock->acquire(); - $delta = time() - $start; + $delta = microtime(true) - $start; $this->assertTrue($ok); $this->assertTrue($lock->owns_lock()); $this->assertLessThan(0.1, $delta, 'Second lock not acquired instantaneously'); diff --git a/tests/notification/base.php b/tests/notification/base.php index bfa9d2a1a4..c97b7c24e2 100644 --- a/tests/notification/base.php +++ b/tests/notification/base.php @@ -21,21 +21,21 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case { return array( 'test', - 'approve_post', - 'approve_topic', - 'bookmark', - 'disapprove_post', - 'disapprove_topic', - 'pm', - 'post', - 'post_in_queue', - 'quote', - 'report_pm', - 'report_pm_closed', - 'report_post', - 'report_post_closed', - 'topic', - 'topic_in_queue', + 'notification.type.approve_post', + 'notification.type.approve_topic', + 'notification.type.bookmark', + 'notification.type.disapprove_post', + 'notification.type.disapprove_topic', + 'notification.type.pm', + 'notification.type.post', + 'notification.type.post_in_queue', + 'notification.type.quote', + 'notification.type.report_pm', + 'notification.type.report_pm_closed', + 'notification.type.report_post', + 'notification.type.report_post_closed', + 'notification.type.topic', + 'notification.type.topic_in_queue', ); } @@ -92,10 +92,11 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case $types = array(); foreach ($this->get_notification_types() as $type) { - $class = $this->build_type('phpbb\notification\type\\' . $type); + $type_parts = explode('.', $type); + $class = $this->build_type('phpbb\notification\type\\' . array_pop($type_parts)); $types[$type] = $class; - $this->container->set('notification.type.' . $type, $class); + $this->container->set($type, $class); } $this->notifications->set_var('notification_types', $types); diff --git a/tests/notification/fixtures/submit_post_bookmark.xml b/tests/notification/fixtures/submit_post_notification.type.bookmark.xml index 525d0484e0..a1413e2cf8 100644 --- a/tests/notification/fixtures/submit_post_bookmark.xml +++ b/tests/notification/fixtures/submit_post_notification.type.bookmark.xml @@ -50,7 +50,7 @@ <column>notification_type_enabled</column> <row> <value>1</value> - <value>bookmark</value> + <value>notification.type.bookmark</value> <value>1</value> </row> </table> @@ -123,35 +123,35 @@ <column>method</column> <column>notify</column> <row> - <value>bookmark</value> + <value>notification.type.bookmark</value> <value>0</value> <value>2</value> <value></value> <value>1</value> </row> <row> - <value>bookmark</value> + <value>notification.type.bookmark</value> <value>0</value> <value>3</value> <value></value> <value>1</value> </row> <row> - <value>bookmark</value> + <value>notification.type.bookmark</value> <value>0</value> <value>4</value> <value></value> <value>1</value> </row> <row> - <value>bookmark</value> + <value>notification.type.bookmark</value> <value>0</value> <value>5</value> <value></value> <value>1</value> </row> <row> - <value>bookmark</value> + <value>notification.type.bookmark</value> <value>0</value> <value>6</value> <value></value> diff --git a/tests/notification/fixtures/submit_post_post.xml b/tests/notification/fixtures/submit_post_notification.type.post.xml index a38ca77ea0..ed75787c70 100644 --- a/tests/notification/fixtures/submit_post_post.xml +++ b/tests/notification/fixtures/submit_post_notification.type.post.xml @@ -50,7 +50,7 @@ <column>notification_type_enabled</column> <row> <value>1</value> - <value>post</value> + <value>notification.type.post</value> <value>1</value> </row> </table> @@ -153,49 +153,49 @@ <column>method</column> <column>notify</column> <row> - <value>post</value> + <value>notification.type.post</value> <value>0</value> <value>2</value> <value></value> <value>1</value> </row> <row> - <value>post</value> + <value>notification.type.post</value> <value>0</value> <value>3</value> <value></value> <value>1</value> </row> <row> - <value>post</value> + <value>notification.type.post</value> <value>0</value> <value>4</value> <value></value> <value>1</value> </row> <row> - <value>post</value> + <value>notification.type.post</value> <value>0</value> <value>5</value> <value></value> <value>1</value> </row> <row> - <value>post</value> + <value>notification.type.post</value> <value>0</value> <value>6</value> <value></value> <value>1</value> </row> <row> - <value>post</value> + <value>notification.type.post</value> <value>0</value> <value>7</value> <value></value> <value>1</value> </row> <row> - <value>post</value> + <value>notification.type.post</value> <value>0</value> <value>8</value> <value></value> diff --git a/tests/notification/fixtures/submit_post_post_in_queue.xml b/tests/notification/fixtures/submit_post_notification.type.post_in_queue.xml index 28cb69be36..2dea8e34dd 100644 --- a/tests/notification/fixtures/submit_post_post_in_queue.xml +++ b/tests/notification/fixtures/submit_post_notification.type.post_in_queue.xml @@ -22,7 +22,7 @@ <column>notification_type_enabled</column> <row> <value>1</value> - <value>post_in_queue</value> + <value>notification.type.post_in_queue</value> <value>1</value> </row> </table> @@ -107,49 +107,49 @@ <column>method</column> <column>notify</column> <row> - <value>needs_approval</value> + <value>notification.type.needs_approval</value> <value>0</value> <value>2</value> <value></value> <value>1</value> </row> <row> - <value>needs_approval</value> + <value>notification.type.needs_approval</value> <value>0</value> <value>3</value> <value></value> <value>1</value> </row> <row> - <value>needs_approval</value> + <value>notification.type.needs_approval</value> <value>0</value> <value>4</value> <value></value> <value>1</value> </row> <row> - <value>needs_approval</value> + <value>notification.type.needs_approval</value> <value>0</value> <value>5</value> <value></value> <value>1</value> </row> <row> - <value>needs_approval</value> + <value>notification.type.needs_approval</value> <value>0</value> <value>6</value> <value></value> <value>1</value> </row> <row> - <value>needs_approval</value> + <value>notification.type.needs_approval</value> <value>0</value> <value>7</value> <value></value> <value>0</value> </row> <row> - <value>needs_approval</value> + <value>notification.type.needs_approval</value> <value>0</value> <value>9</value> <value></value> diff --git a/tests/notification/fixtures/submit_post_quote.xml b/tests/notification/fixtures/submit_post_notification.type.quote.xml index 2b11992e54..dd5bc620cd 100644 --- a/tests/notification/fixtures/submit_post_quote.xml +++ b/tests/notification/fixtures/submit_post_notification.type.quote.xml @@ -22,7 +22,7 @@ <column>notification_type_enabled</column> <row> <value>1</value> - <value>quote</value> + <value>notification.type.quote</value> <value>1</value> </row> </table> @@ -95,35 +95,35 @@ <column>method</column> <column>notify</column> <row> - <value>quote</value> + <value>notification.type.quote</value> <value>0</value> <value>2</value> <value></value> <value>1</value> </row> <row> - <value>quote</value> + <value>notification.type.quote</value> <value>0</value> <value>3</value> <value></value> <value>1</value> </row> <row> - <value>quote</value> + <value>notification.type.quote</value> <value>0</value> <value>4</value> <value></value> <value>1</value> </row> <row> - <value>quote</value> + <value>notification.type.quote</value> <value>0</value> <value>5</value> <value></value> <value>1</value> </row> <row> - <value>quote</value> + <value>notification.type.quote</value> <value>0</value> <value>6</value> <value></value> diff --git a/tests/notification/fixtures/submit_post_topic.xml b/tests/notification/fixtures/submit_post_notification.type.topic.xml index 5e179d9b99..1ba8d05699 100644 --- a/tests/notification/fixtures/submit_post_topic.xml +++ b/tests/notification/fixtures/submit_post_notification.type.topic.xml @@ -42,7 +42,7 @@ <column>notification_type_enabled</column> <row> <value>1</value> - <value>topic</value> + <value>notification.type.topic</value> <value>1</value> </row> </table> @@ -103,28 +103,28 @@ <column>method</column> <column>notify</column> <row> - <value>topic</value> + <value>notification.type.topic</value> <value>0</value> <value>2</value> <value></value> <value>1</value> </row> <row> - <value>topic</value> + <value>notification.type.topic</value> <value>0</value> <value>6</value> <value></value> <value>1</value> </row> <row> - <value>topic</value> + <value>notification.type.topic</value> <value>0</value> <value>7</value> <value></value> <value>1</value> </row> <row> - <value>topic</value> + <value>notification.type.topic</value> <value>0</value> <value>8</value> <value></value> diff --git a/tests/notification/group_request_test.php b/tests/notification/group_request_test.php index 14ed4ff62c..afbc586601 100644 --- a/tests/notification/group_request_test.php +++ b/tests/notification/group_request_test.php @@ -25,8 +25,8 @@ class phpbb_notification_group_request_test extends phpbb_tests_notification_bas return array_merge( parent::get_notification_types(), array( - 'group_request', - 'group_request_approved', + 'notification.type.group_request', + 'notification.type.group_request_approved', ) ); } diff --git a/tests/notification/manager_helper.php b/tests/notification/manager_helper.php index 24030f5775..75b7275d3a 100644 --- a/tests/notification/manager_helper.php +++ b/tests/notification/manager_helper.php @@ -43,7 +43,8 @@ class phpbb_notification_manager_helper extends \phpbb\notification\manager */ public function get_item_type_class($item_type, $data = array()) { - $item_type = 'phpbb\notification\type\\' . $item_type; + $item_parts = explode('.', $item_type); + $item_type = 'phpbb\notification\type\\' . array_pop($item_parts); $item = new $item_type($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, $this->notifications_table, $this->user_notifications_table); diff --git a/tests/notification/notification_test.php b/tests/notification/notification_test.php index 27ea8ddb44..79fa5338c4 100644 --- a/tests/notification/notification_test.php +++ b/tests/notification/notification_test.php @@ -25,22 +25,22 @@ class phpbb_notification_test extends phpbb_tests_notification_base public function test_get_notification_type_id() { // They should be inserted the first time - $post_type_id = $this->notifications->get_notification_type_id('post'); - $quote_type_id = $this->notifications->get_notification_type_id('quote'); + $post_type_id = $this->notifications->get_notification_type_id('notification.type.post'); + $quote_type_id = $this->notifications->get_notification_type_id('notification.type.quote'); $test_type_id = $this->notifications->get_notification_type_id('test'); $this->assertEquals(array( 'test' => $test_type_id, - 'quote' => $quote_type_id, - 'post' => $post_type_id, + 'notification.type.quote' => $quote_type_id, + 'notification.type.post' => $post_type_id, ), $this->notifications->get_notification_type_ids(array( 'test', - 'quote', - 'post', + 'notification.type.quote', + 'notification.type.post', ) )); - $this->assertEquals($quote_type_id, $this->notifications->get_notification_type_id('quote')); + $this->assertEquals($quote_type_id, $this->notifications->get_notification_type_id('notification.type.quote')); try { @@ -58,12 +58,12 @@ class phpbb_notification_test extends phpbb_tests_notification_base $this->assertArrayHasKey('NOTIFICATION_GROUP_MISCELLANEOUS', $subscription_types); $this->assertArrayHasKey('NOTIFICATION_GROUP_POSTING', $subscription_types); - $this->assertArrayHasKey('bookmark', $subscription_types['NOTIFICATION_GROUP_POSTING']); - $this->assertArrayHasKey('post', $subscription_types['NOTIFICATION_GROUP_POSTING']); - $this->assertArrayHasKey('quote', $subscription_types['NOTIFICATION_GROUP_POSTING']); - $this->assertArrayHasKey('topic', $subscription_types['NOTIFICATION_GROUP_POSTING']); + $this->assertArrayHasKey('notification.type.bookmark', $subscription_types['NOTIFICATION_GROUP_POSTING']); + $this->assertArrayHasKey('notification.type.post', $subscription_types['NOTIFICATION_GROUP_POSTING']); + $this->assertArrayHasKey('notification.type.quote', $subscription_types['NOTIFICATION_GROUP_POSTING']); + $this->assertArrayHasKey('notification.type.topic', $subscription_types['NOTIFICATION_GROUP_POSTING']); - $this->assertArrayHasKey('pm', $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']); + $this->assertArrayHasKey('notification.type.pm', $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']); //get_subscription_types //get_subscription_methods @@ -72,12 +72,12 @@ class phpbb_notification_test extends phpbb_tests_notification_base public function test_subscriptions() { $expected_subscriptions = array( - 'post' => array(''), - 'topic' => array(''), - 'quote' => array(''), - 'bookmark' => array(''), + 'notification.type.post' => array(''), + 'notification.type.topic' => array(''), + 'notification.type.quote' => array(''), + 'notification.type.bookmark' => array(''), 'test' => array(''), - 'pm' => array(''), + 'notification.type.pm' => array(''), ); $subscriptions = $this->notifications->get_global_subscriptions(2); @@ -92,20 +92,20 @@ class phpbb_notification_test extends phpbb_tests_notification_base $this->assert_array_content_equals($methods, $expected_subscriptions[$item_type]); } - $this->notifications->delete_subscription('post', 0, '', 2); + $this->notifications->delete_subscription('notification.type.post', 0, '', 2); - $this->assertArrayNotHasKey('post', $this->notifications->get_global_subscriptions(2)); + $this->assertArrayNotHasKey('notification.type.post', $this->notifications->get_global_subscriptions(2)); - $this->notifications->add_subscription('post', 0, '', 2); + $this->notifications->add_subscription('notification.type.post', 0, '', 2); - $this->assertArrayHasKey('post', $this->notifications->get_global_subscriptions(2)); + $this->assertArrayHasKey('notification.type.post', $this->notifications->get_global_subscriptions(2)); } public function test_notifications() { $this->db->sql_query('DELETE FROM phpbb_notification_types'); - $types = array('quote', 'bookmark', 'post', 'test'); + $types = array('notification.type.quote', 'notification.type.bookmark', 'notification.type.post', 'test'); foreach ($types as $id => $type) { $this->db->sql_query('INSERT INTO phpbb_notification_types ' . @@ -150,7 +150,7 @@ class phpbb_notification_test extends phpbb_tests_notification_base 'post_time' => 1349413323, )); - $this->notifications->add_notifications(array('quote', 'bookmark', 'post', 'test'), array( + $this->notifications->add_notifications(array('notification.type.quote', 'notification.type.bookmark', 'notification.type.post', 'test'), array( 'post_id' => '4', 'topic_id' => '2', 'post_time' => 1349413324, @@ -166,7 +166,7 @@ class phpbb_notification_test extends phpbb_tests_notification_base 'user_id' => 0, ))); - $this->notifications->add_notifications(array('quote', 'bookmark', 'post', 'test'), array( + $this->notifications->add_notifications(array('notification.type.quote', 'notification.type.bookmark', 'notification.type.post', 'test'), array( 'post_id' => '5', 'topic_id' => '2', 'post_time' => 1349413325, @@ -258,7 +258,7 @@ class phpbb_notification_test extends phpbb_tests_notification_base 'post_time' => 1234, // change time )); - $this->notifications->update_notifications(array('quote', 'bookmark', 'post', 'test'), array( + $this->notifications->update_notifications(array('notification.type.quote', 'notification.type.bookmark', 'notification.type.post', 'test'), array( 'post_id' => '5', 'topic_id' => '2', 'poster_id' => 2, diff --git a/tests/notification/submit_post_type_bookmark_test.php b/tests/notification/submit_post_type_bookmark_test.php index 6d7747c2ba..7c3b9f938f 100644 --- a/tests/notification/submit_post_type_bookmark_test.php +++ b/tests/notification/submit_post_type_bookmark_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/submit_post_base.php'; class phpbb_notification_submit_post_type_bookmark_test extends phpbb_notification_submit_post_base { - protected $item_type = 'bookmark'; + protected $item_type = 'notification.type.bookmark'; public function setUp() { diff --git a/tests/notification/submit_post_type_post_in_queue_test.php b/tests/notification/submit_post_type_post_in_queue_test.php index 6bd9c8c93f..1390e92d96 100644 --- a/tests/notification/submit_post_type_post_in_queue_test.php +++ b/tests/notification/submit_post_type_post_in_queue_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/submit_post_base.php'; class phpbb_notification_submit_post_type_post_in_queue_test extends phpbb_notification_submit_post_base { - protected $item_type = 'post_in_queue'; + protected $item_type = 'notification.type.post_in_queue'; public function setUp() { diff --git a/tests/notification/submit_post_type_post_test.php b/tests/notification/submit_post_type_post_test.php index 5007424690..037c326bc0 100644 --- a/tests/notification/submit_post_type_post_test.php +++ b/tests/notification/submit_post_type_post_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/submit_post_base.php'; class phpbb_notification_submit_post_type_post_test extends phpbb_notification_submit_post_base { - protected $item_type = 'post'; + protected $item_type = 'notification.type.post'; public function setUp() { diff --git a/tests/notification/submit_post_type_quote_test.php b/tests/notification/submit_post_type_quote_test.php index 94979fd154..61e3840773 100644 --- a/tests/notification/submit_post_type_quote_test.php +++ b/tests/notification/submit_post_type_quote_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/submit_post_base.php'; class phpbb_notification_submit_post_type_quote_test extends phpbb_notification_submit_post_base { - protected $item_type = 'quote'; + protected $item_type = 'notification.type.quote'; public function setUp() { diff --git a/tests/notification/submit_post_type_topic_test.php b/tests/notification/submit_post_type_topic_test.php index 52e9353c7c..c095fbc4ba 100644 --- a/tests/notification/submit_post_type_topic_test.php +++ b/tests/notification/submit_post_type_topic_test.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/submit_post_base.php'; class phpbb_notification_submit_post_type_topic_test extends phpbb_notification_submit_post_base { - protected $item_type = 'topic'; + protected $item_type = 'notification.type.topic'; public function setUp() { diff --git a/tests/template/template_allfolder_test.php b/tests/template/template_allfolder_test.php new file mode 100644 index 0000000000..b4ad84e9c3 --- /dev/null +++ b/tests/template/template_allfolder_test.php @@ -0,0 +1,59 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +require_once dirname(__FILE__) . '/template_test_case.php'; + +class phpbb_template_allfolder_test extends phpbb_template_template_test_case +{ + public function test_allfolder() + { + $this->setup_engine_for_allfolder(); + + $this->run_template('foobar_body.html', array(), array(), array(), "All folder"); + } + + protected function setup_engine_for_allfolder(array $new_config = array()) + { + global $phpbb_root_path, $phpEx; + + $defaults = $this->config_defaults(); + $config = new \phpbb\config\config(array_merge($defaults, $new_config)); + $this->user = new \phpbb\user('\phpbb\datetime'); + + $path_helper = new \phpbb\path_helper( + new \phpbb\symfony_request( + new phpbb_mock_request() + ), + new \phpbb\filesystem(), + $this->getMock('\phpbb\request\request'), + $phpbb_root_path, + $phpEx + ); + + $this->extension_manager = new phpbb_mock_extension_manager( + dirname(__FILE__) . '/', + array( + 'vendor4/bar' => array( + 'ext_name' => 'vendor4/bar', + 'ext_active' => '1', + 'ext_path' => 'ext/vendor4/bar/', + ), + ) + ); + + $this->template_path = $this->test_path . '/templates'; + $this->ext_template_path = 'tests/extension/ext/vendor4/bar/styles/all/template'; + $this->template = new \phpbb\template\twig\twig($path_helper, $config, $this->user, new \phpbb\template\context(), $this->extension_manager); + $this->template->set_custom_style('all', array($this->template_path, $this->ext_template_path)); + } +} |