From 8497144053e9960089a62c8a2271e999f2f9a650 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Fri, 14 Jul 2023 15:01:46 +0900 Subject: [PATCH] Admin\Backend level check, DB\IO Error/Warning message update on Admin\Backend init check that the provided default acl level is valid DB\IO warning and error drop the "db :" prefix part as this is not needed we have [DB_ERROR] and [DB_WARNING] sub prefixes anyway, also we run dedicated log level alerts with context --- www/lib/CoreLibs/Admin/Backend.php | 4 ++++ www/lib/CoreLibs/DB/IO.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/www/lib/CoreLibs/Admin/Backend.php b/www/lib/CoreLibs/Admin/Backend.php index 67f6659b..2a8a1dcf 100644 --- a/www/lib/CoreLibs/Admin/Backend.php +++ b/www/lib/CoreLibs/Admin/Backend.php @@ -164,6 +164,10 @@ class Backend ); } $this->default_acl = $set_default_acl_level ?? DEFAULT_ACL_LEVEL; + // if negative or larger than 100, reset to 0 + if ($this->default_acl < 0 || $this->default_acl > 100) { + $this->default_acl = 0; + } // queue key if (preg_match("/^(add|save|delete|remove|move|up|down|push_live)$/", $this->action)) { diff --git a/www/lib/CoreLibs/DB/IO.php b/www/lib/CoreLibs/DB/IO.php index 622c4f72..3a9d885d 100644 --- a/www/lib/CoreLibs/DB/IO.php +++ b/www/lib/CoreLibs/DB/IO.php @@ -814,13 +814,13 @@ class IO switch ($id) { case 'DB_ERROR': $this->log->error( - $debug_id . ' :' . $prefix . $error_string, + $prefix . $error_string, $context ); break; case 'DB_WARNING': $this->log->warning( - $debug_id . ' :' . $prefix . $error_string, + $prefix . $error_string, $context ); break;