This commit is contained in:
Jean-Christian Denis 2023-10-21 22:52:54 +02:00
parent c954dc74f0
commit 36b4b65367
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
3 changed files with 17 additions and 19 deletions

View file

@ -1,15 +1,5 @@
<?php <?php
/**
* @brief testMail, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Osku and contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1); declare(strict_types=1);
namespace Dotclear\Plugin\testMail; namespace Dotclear\Plugin\testMail;

View file

@ -17,11 +17,19 @@ use Dotclear\Module\MyPlugin;
*/ */
class My extends MyPlugin class My extends MyPlugin
{ {
/** @var string Mailer name */ /**
* Mailer name.
*
* @var string X_MAILER
*/
public const X_MAILER = 'Dotclear'; public const X_MAILER = 'Dotclear';
public static function checkCustomContext(int $context): ?bool public static function checkCustomContext(int $context): ?bool
{ {
return App::task()->checkContext('BACKEND') && App::auth()->isSuperAdmin(); // Limit to super admin
return match ($context) {
self::MODULE => App::auth()->isSuperAdmin(),
default => null,
};
} }
} }