cosmetic
This commit is contained in:
parent
c954dc74f0
commit
36b4b65367
3 changed files with 17 additions and 19 deletions
|
@ -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;
|
||||||
|
@ -17,8 +7,8 @@ namespace Dotclear\Plugin\testMail;
|
||||||
use Dotclear\Core\Process;
|
use Dotclear\Core\Process;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief testMail backend class.
|
* @brief testMail backend class.
|
||||||
* @ingroup testMail
|
* @ingroup testMail
|
||||||
*
|
*
|
||||||
* @author Osku (author)
|
* @author Osku (author)
|
||||||
* @author Jean-Christian Denis (author)
|
* @author Jean-Christian Denis (author)
|
||||||
|
|
|
@ -26,8 +26,8 @@ use Dotclear\Helper\Text;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief testMail manage class.
|
* @brief testMail manage class.
|
||||||
* @ingroup testMail
|
* @ingroup testMail
|
||||||
*
|
*
|
||||||
* @author Osku (author)
|
* @author Osku (author)
|
||||||
* @author Jean-Christian Denis (author)
|
* @author Jean-Christian Denis (author)
|
||||||
|
|
16
src/My.php
16
src/My.php
|
@ -8,8 +8,8 @@ use Dotclear\App;
|
||||||
use Dotclear\Module\MyPlugin;
|
use Dotclear\Module\MyPlugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief testMail My helper.
|
* @brief testMail My helper.
|
||||||
* @ingroup testMail
|
* @ingroup testMail
|
||||||
*
|
*
|
||||||
* @author Osku (author)
|
* @author Osku (author)
|
||||||
* @author Jean-Christian Denis (author)
|
* @author Jean-Christian Denis (author)
|
||||||
|
@ -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 a new issue