diff --git a/src/Backend.php b/src/Backend.php index ada2845..bedd1e1 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -28,7 +28,9 @@ class Backend extends dcNsProcess { public static function init(): bool { - static::$init = defined('DC_CONTEXT_ADMIN'); + static::$init = defined('DC_CONTEXT_ADMIN') + && dcCore::app()->auth?->isSuperAdmin() + && My::phpCompliant(); return static::$init; } diff --git a/src/Manage.php b/src/Manage.php index ea6addc..2367e70 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -29,7 +29,9 @@ class Manage extends dcNsProcess { public static function init(): bool { - static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->isSuperAdmin(); + static::$init = defined('DC_CONTEXT_ADMIN') + && dcCore::app()->auth?->isSuperAdmin() + && My::phpCompliant(); return static::$init; } diff --git a/src/My.php b/src/My.php index fb4b656..72e6510 100644 --- a/src/My.php +++ b/src/My.php @@ -18,6 +18,14 @@ use dcCore; class My { + /** + * @var string PHP min version + */ + public const PHP_MIN = '8.1'; + + /** + * @var string Admin list ID + */ public const BACKEND_LIST_ID = 'dcloglist'; /** @@ -35,4 +43,12 @@ class My { return __((string) dcCore::app()->plugins->moduleInfo(self::id(), 'name')); } + + /** + * Check php version + */ + public static function phpCompliant(): bool + { + return version_compare(phpversion(), self::PHP_MIN, '>='); + } }