From 7e6fac2990ff3f9330eb43d8c854c08f95213f0c Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Tue, 21 Mar 2023 21:19:48 +0100 Subject: [PATCH] fix init check --- src/Backend.php | 9 +++------ src/Manage.php | 13 +++++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Backend.php b/src/Backend.php index e731bec..5a8f346 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -24,17 +24,14 @@ class Backend extends dcNsProcess { 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; } diff --git a/src/Manage.php b/src/Manage.php index d069f0d..3f7413e 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -36,17 +36,14 @@ class Manage extends dcNsProcess { 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; } @@ -86,6 +83,10 @@ class Manage extends dcNsProcess public static function render(): void { + if (!static::$init) { + return; + } + dcpage::openModule(My::name()); echo