From d5ef3a383432a309f12cf4be591ee8473484b1f2 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 14 Nov 2025 12:11:42 -0700 Subject: [PATCH] Prevent warningx in get_classname --- app/system/resources/dashboard/system_services.php | 7 +++++-- app/system/system.php | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/system/resources/dashboard/system_services.php b/app/system/resources/dashboard/system_services.php index a99d41fbfc..b45c28c283 100644 --- a/app/system/resources/dashboard/system_services.php +++ b/app/system/resources/dashboard/system_services.php @@ -39,9 +39,12 @@ //function to parse a FusionPBX service from a .service file if (!function_exists('get_classname')) { function get_classname(string $file) { + if (!file_exists($file)) { + return ''; + } $parsed = parse_ini_file($file); - $exec_cmd = $parsed['ExecStart']; - $parts = explode(' ', $exec_cmd); + $exec_cmd = $parsed['ExecStart'] ?? ''; + $parts = explode(' ', $exec_cmd ?? ''); $php_file = $parts[1] ?? ''; if (!empty($php_file)) { return $php_file; diff --git a/app/system/system.php b/app/system/system.php index 494aa1a127..34ee58084c 100644 --- a/app/system/system.php +++ b/app/system/system.php @@ -28,6 +28,7 @@ Con Portions created by the Initial Developer are Copyright (C) 2008-2025 //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; + //check permissions if (!permission_exists('system_view_info') || !permission_exists('system_view_cpu')