diff --git a/src/Backend.php b/src/Backend.php index e41734f..496029a 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -30,7 +30,6 @@ class Backend extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && !is_null(dcCore::app()->auth) && dcCore::app()->auth->isSuperAdmin(); return static::$init; @@ -42,7 +41,7 @@ class Backend extends dcNsProcess return false; } - if (is_null(dcCore::app()->auth) || is_null(dcCore::app()->blog) || is_null(dcCore::app()->adminurl)) { + if (is_null(dcCore::app()->blog)) { return false; } diff --git a/src/Config.php b/src/Config.php index 78c0b54..709264b 100644 --- a/src/Config.php +++ b/src/Config.php @@ -39,7 +39,6 @@ class Config extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && !is_null(dcCore::app()->auth) && dcCore::app()->auth->isSuperAdmin(); return static::$init; @@ -55,7 +54,7 @@ class Config extends dcNsProcess return true; } - if (is_null(dcCore::app()->blog) || is_null(dcCore::app()->adminurl)) { + if (is_null(dcCore::app()->blog)) { return false; } @@ -88,7 +87,7 @@ class Config extends dcNsProcess return; } - if (is_null(dcCore::app()->blog) || is_null(dcCore::app()->adminurl)) { + if (is_null(dcCore::app()->blog)) { return; } diff --git a/src/Manage.php b/src/Manage.php index c9e030b..0c4d57c 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -54,7 +54,6 @@ class Manage extends dcNsProcess public static function init(): bool { static::$init = defined('DC_CONTEXT_ADMIN') - && !is_null(dcCore::app()->auth) && dcCore::app()->auth->isSuperAdmin(); return static::$init; diff --git a/src/Task/CssHeader.php b/src/Task/CssHeader.php index b49e8ce..415a5d6 100644 --- a/src/Task/CssHeader.php +++ b/src/Task/CssHeader.php @@ -162,7 +162,7 @@ class CssHeader extends Task public function openModule(): ?bool { - if (is_null(dcCore::app()->auth)) { + if (!isset(dcCore::app()->auth)) { $this->warning->add(__('Auth is not set')); return null; diff --git a/src/Task/PhpHeader.php b/src/Task/PhpHeader.php index 09b281a..f3b2ebf 100644 --- a/src/Task/PhpHeader.php +++ b/src/Task/PhpHeader.php @@ -161,7 +161,7 @@ class PhpHeader extends Task public function openModule(): ?bool { - if (is_null(dcCore::app()->auth)) { + if (!isset(dcCore::app()->auth)) { $this->warning->add(__('Auth is not set')); return null;