diff --git a/www/admin/class_test.error_msg.php b/www/admin/class_test.error_msg.php index 2cf777c2..c83a3cc5 100644 --- a/www/admin/class_test.error_msg.php +++ b/www/admin/class_test.error_msg.php @@ -61,6 +61,8 @@ print "ErrorsIds:
" . $log->prAr($em->getErrorIds()) . "
"; print "Errors:
" . $log->prAr($em->getErrorMsg()) . "
"; print "JumpTargets:
" . $log->prAr($em->getJumpTarget()) . "
"; +print "IS info > ok: " . ml::fromName('info')->isHigherThan(ml::ok) . "
"; + print ""; $log->debug('[END]', '==========================================>'); diff --git a/www/lib/CoreLibs/Admin/Backend.php b/www/lib/CoreLibs/Admin/Backend.php index 44b771d2..d35ccdc1 100644 --- a/www/lib/CoreLibs/Admin/Backend.php +++ b/www/lib/CoreLibs/Admin/Backend.php @@ -117,18 +117,20 @@ class Backend /** * main class constructor * - * @param \CoreLibs\DB\IO $db Database connection class - * @param \CoreLibs\Logging\Logging $log Logging class - * @param \CoreLibs\Create\Session $session Session interface class - * @param \CoreLibs\Language\L10n $l10n l10n language class - * @param int|null $set_default_acl_level Default ACL level + * @param \CoreLibs\DB\IO $db Database connection class + * @param \CoreLibs\Logging\Logging $log Logging class + * @param \CoreLibs\Create\Session $session Session interface class + * @param \CoreLibs\Language\L10n $l10n l10n language class + * @param int|null $set_default_acl_level [default=null] Default ACL level + * @param bool $init_action_vars [default=true] If the action vars should be set */ public function __construct( \CoreLibs\DB\IO $db, \CoreLibs\Logging\Logging $log, \CoreLibs\Create\Session $session, \CoreLibs\Language\L10n $l10n, - ?int $set_default_acl_level = null + ?int $set_default_acl_level = null, + bool $init_action_vars = true ) { // attach db class $this->db = $db; @@ -151,9 +153,9 @@ class Backend // set the page name $this->page_name = \CoreLibs\Get\System::getPageName(); - // set the action ids - foreach ($this->action_list as $_action) { - $this->$_action = $_POST[$_action] ?? ''; + // NOTE: if any of the "action" vars are used somewhere, it is recommended to NOT set them here + if ($init_action_vars) { + $this->adbSetActionVars(); } if ($set_default_acl_level === null) { @@ -195,6 +197,29 @@ class Backend $this->acl = $acl; } + /** + * Return current set ACL + * + * @return array + */ + public function adbGetAcl(): array + { + return $this->acl; + } + + /** + * Set _POST action vars if needed + * + * @return void + */ + public function adbSetActionVars() + { + // set the action ids + foreach ($this->action_list as $_action) { + $this->$_action = $_POST[$_action] ?? ''; + } + } + /** * writes all action vars plus other info into edit_log table *