From 8f31483f9e9969dcbf02d5c740fe6d74b8663d2b Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 19 Mar 2023 21:27:02 +0100 Subject: [PATCH] fix init check --- src/Backend.php | 6 +++--- src/Manage.php | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Backend.php b/src/Backend.php index 24f47ac..ada2845 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -28,14 +28,14 @@ class Backend extends dcNsProcess { public static function init(): bool { - self::$init = defined('DC_CONTEXT_ADMIN'); + static::$init = defined('DC_CONTEXT_ADMIN'); - 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 5ad0e04..ea6addc 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -29,17 +29,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; } @@ -83,6 +80,10 @@ class Manage extends dcNsProcess public static function render(): void { + if (!static::$init) { + return; + } + dcPage::openModule( __('Pings'), dcPage::jsJson('dclog_list', [