cosmetic
This commit is contained in:
parent
c954dc74f0
commit
36b4b65367
@ -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;
|
||||||
|
12
src/My.php
12
src/My.php
@ -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,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user