From e9886ee44416983191db4cdf7233a9a02f88846e Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Tue, 21 Mar 2023 20:51:47 +0100 Subject: [PATCH] use dcNsProcess --- src/Backend.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Backend.php b/src/Backend.php index 84b47a8..70a0ba6 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -16,6 +16,7 @@ namespace Dotclear\Plugin\tinyPacker; /* dotclear */ use dcCore; +use dcNsProcess; use dcPage; /* clearbricks */ @@ -33,23 +34,18 @@ use Exception; * * Add action and button to modules lists. */ -class Backend +class Backend extends dcNsProcess { - private static $init = false; - public static function init(): bool { - if (defined('DC_CONTEXT_ADMIN')) { - dcPage::checkSuper(); - self::$init = true; - } + static::$init = defined('DC_CONTEXT_ADMIN') && dcCOre::app()->auth->isSuperAdmin(); - return self::$init; + return static::$init; } public static function process(): bool { - if (!self::$init) { + if (!static::$init) { return false; }