fix init check

This commit is contained in:
Jean-Christian Paul Denis 2023-03-21 21:19:48 +01:00
parent 83fa868c91
commit 7e6fac2990
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
2 changed files with 10 additions and 12 deletions

View File

@ -24,17 +24,14 @@ class Backend extends dcNsProcess
{ {
public static function init(): bool public static function init(): bool
{ {
if (defined('DC_CONTEXT_ADMIN')) { static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->isSuperAdmin();
dcPage::checkSuper();
self::$init = true;
}
return self::$init; return static::$init;
} }
public static function process(): bool public static function process(): bool
{ {
if (!self::$init) { if (!static::$init) {
return false; return false;
} }

View File

@ -36,17 +36,14 @@ class Manage extends dcNsProcess
{ {
public static function init(): bool public static function init(): bool
{ {
if (defined('DC_CONTEXT_ADMIN')) { static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->isSuperAdmin();
dcPage::checkSuper();
self::$init = true;
}
return self::$init; return static::$init;
} }
public static function process(): bool public static function process(): bool
{ {
if (!self::$init) { if (!static::$init) {
return false; return false;
} }
@ -86,6 +83,10 @@ class Manage extends dcNsProcess
public static function render(): void public static function render(): void
{ {
if (!static::$init) {
return;
}
dcpage::openModule(My::name()); dcpage::openModule(My::name());
echo echo