diff --git a/CHANGELOG.md b/CHANGELOG.md index a92bc76..8b1648f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +testMail 0.6 - 2023.10.07 +=========================================================== +* Require Dotclear 2.28 +* Require PHP 8.1 +* Upgrade to Dotclear 2.28 + testMail 0.5 - 2023.08.13 =========================================================== * Require Dotclear 2.27 diff --git a/README.md b/README.md index 9c411c8..1946b7a 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,22 @@ # README -[![Release](https://img.shields.io/badge/release-0.5-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/testMail/releases) -[![Date](https://img.shields.io/badge/date-2023.08.13-c44d58.svg)](https://git.dotclear.watch/JcDenis/testMail/releases) -[![Dotclear](https://img.shields.io/badge/dotclear-v2.27-137bbb.svg)](https://fr.dotclear.org/download) +[![Release](https://img.shields.io/badge/release-0.6-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/testMail/releases) +![Date](https://img.shields.io/badge/date-2023.10.07-c44d58.svg) +[![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download) [![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/testMail) -[![License](https://img.shields.io/github/license/JcDenis/testMail)](https://git.dotclear.watch/JcDenis/testMail/blob/master/LICENSE) +[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/testMail/src/branch/master/LICENSE) -## WHAT IS TESTMAIL ? +## ABOUT -_testMail_ is a plugin for the open-source -web publishing software called Dotclear. +_testmail_ is a plugin for the open-source web publishing software called [Dotclear](https://www.dotclear.org). -It helps dev to test dotclear mail system. +> It helps dev to test dotclear mail system. ## REQUIREMENTS -_testMail_ requires: - * super admin permission -* Dotclear 2.27 -* PHP 7.4 +* Dotclear 2.28 +* PHP 8.1+ ## USAGE @@ -30,9 +27,10 @@ Access mail form from admin sidebar system menu **Mail test**. ## LINKS -* License : [GNU GPL v2](https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html) -* Source & contribution : [Gitea Page](https://git.dotclear.watch/JcDenis/testMail) or [GitHub Page](https://github.com/JcDenis/testMail) -* Packages & details: [Gitea Page](https://git.dotclear.watch/JcDenis/testMail/releases) or [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/testMail) +* [License](https://git.dotclear.watch/JcDenis/testMail/src/branch/master/LICENSE) +* [Packages & details](https://git.dotclear.watch/JcDenis/testMail/releases) (or on [Dotaddict](https://plugins.dotaddict.org/dc2/details/testMail)) +* [Sources & contributions](https://git.dotclear.watch/JcDenis/testMail) (or on [GitHub](https://github.com/JcDenis/testMail)) +* [Issues & security](https://git.dotclear.watch/JcDenis/testMail/issues) (or on [GitHub](https://github.com/JcDenis/testMail/issues)) ## CONTRIBUTORS diff --git a/_define.php b/_define.php index 35d0909..ab0be5e 100644 --- a/_define.php +++ b/_define.php @@ -20,9 +20,9 @@ $this->registerModule( 'Mail test', 'Send a simple mail from admin', 'Osku and contributors', - '0.5', + '0.6', [ - 'requires' => [['core', '2.27']], + 'requires' => [['core', '2.28']], 'permissions' => null, 'type' => 'plugin', 'support' => 'https://git.dotclear.watch/JcDenis/' . basename(__DIR__) . '/issues', diff --git a/dcstore.xml b/dcstore.xml index 2a8b463..c91f651 100644 --- a/dcstore.xml +++ b/dcstore.xml @@ -2,11 +2,11 @@ Mail test - 0.5 + 0.6 Osku and contributors Send a simple mail from admin - https://git.dotclear.watch/JcDenis/testMail/releases/download/v0.5/plugin-testMail.zip - 2.27 + https://git.dotclear.watch/JcDenis/testMail/releases/download/v0.6/plugin-testMail.zip + 2.28 https://git.dotclear.watch/JcDenis/testMail/src/branch/master/README.md https://git.dotclear.watch/JcDenis/testMail/issues diff --git a/src/Manage.php b/src/Manage.php index 1a063a1..a4ada9b 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -14,7 +14,7 @@ declare(strict_types=1); namespace Dotclear\Plugin\testMail; -use dcCore; +use Dotclear\App; use Dotclear\Core\Backend\{ Notices, Page @@ -75,7 +75,7 @@ class Manage extends Process return true; } catch (Exception $e) { - dcCore::app()->error->add($e->getMessage()); + App::error()->add($e->getMessage()); } } @@ -136,7 +136,7 @@ class Manage extends Process ->__call('items', [[ (new Checkbox('active_headers', false)) ->__call('value', [1]), - (new Label(__('Active mail headers'))) + (new Label(__('Active mail headers'), Label::OUTSIDE_LABEL_AFTER)) ->__call('for', ['active_headers']) ->__call('class', ['classic']), ]]), @@ -156,20 +156,15 @@ class Manage extends Process private static function getHeaders(): array { - // nullsafe - if (is_null(dcCore::app()->blog)) { - return []; - } - return [ - 'From: ' . Mail::B64Header(dcCore::app()->blog->name) . + 'From: ' . Mail::B64Header(App::blog()->name()) . '', 'Content-Type: text/HTML; charset=UTF-8;' . 'X-Originating-IP: ' . Http::realIP(), 'X-Mailer: ' . My::X_MAILER, - 'X-Blog-Id: ' . Mail::B64Header(dcCore::app()->blog->id), - 'X-Blog-Name: ' . Mail::B64Header(dcCore::app()->blog->name), - 'X-Blog-Url: ' . Mail::B64Header(dcCore::app()->blog->url), + 'X-Blog-Id: ' . Mail::B64Header(App::blog()->id()), + 'X-Blog-Name: ' . Mail::B64Header(App::blog()->name()), + 'X-Blog-Url: ' . Mail::B64Header(App::blog()->url()), ]; } } diff --git a/src/My.php b/src/My.php index c7d92c1..c1b30c2 100644 --- a/src/My.php +++ b/src/My.php @@ -14,7 +14,7 @@ declare(strict_types=1); namespace Dotclear\Plugin\testMail; -use dcCore; +use Dotclear\App; use Dotclear\Module\MyPlugin; /** @@ -27,6 +27,6 @@ class My extends MyPlugin public static function checkXustomContext(int $context): ?bool { - return defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->isSuperAdmin(); + return defined('DC_CONTEXT_ADMIN') && App::auth()->isSuperAdmin(); } }