This commit is contained in:
Jean-Christian Paul 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
/**
* @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);
namespace Dotclear\Plugin\testMail;

View File

@ -17,11 +17,19 @@ use Dotclear\Module\MyPlugin;
*/
class My extends MyPlugin
{
/** @var string Mailer name */
/**
* Mailer name.
*
* @var string X_MAILER
*/
public const X_MAILER = 'Dotclear';
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,
};
}
}