From 57990d80a8b022d4797699b47e9bcc5b34cc556c Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 11 Jan 2018 13:05:31 +0100 Subject: [PATCH] fixed warnings php --- pandora_console/include/functions_config.php | 2 +- pandora_console/include/functions_modules.php | 16 +++++++++++++--- .../include/functions_reporting_html.php | 10 ++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index a057dd1b62..b2fc9d65d3 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1630,7 +1630,7 @@ function config_process_config () { if ($is_user_updating == 'operation/users/user_edit') { $id = get_parameter_get ("id", $config["id_user"]); // ID given as parameter $user_info = get_user_info ($id); - + //If current user is editing himself or if the user has UM (User Management) rights on any groups the user is part of AND the authorization scheme allows for users/admins to update info if (($config["id_user"] == $id || check_acl ($config["id_user"], users_get_groups ($id), "UM")) && $config["user_can_update_info"]) { $view_mode = false; diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 15058a3a4b..0822169265 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -2552,7 +2552,9 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal foreach ($rows_temp as $module_group_key => $modules_group_val) $rows_temp_processed[$modules_group_val['name']] = $modules_group_val['name']; - $rows_select = array_unique(array_merge($rows_select, $rows_temp_processed)); + if(is_array($rows_select) && is_array($rows_temp_processed)){ + $rows_select = array_unique(array_merge($rows_select, $rows_temp_processed)); + } } $groups_temp = users_get_groups_for_select(false, "AR", true, true, false); @@ -2565,7 +2567,9 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal } if (!empty($groups_temp_processed)) { - $groups_select = array_unique(array_merge($groups_select, $groups_temp_processed)); + if(is_array($rows_select) && is_array($rows_temp_processed)){ + $groups_select = array_unique(array_merge($groups_select, $groups_temp_processed)); + } } if (!empty($modules_temp)) @@ -2574,7 +2578,13 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal metaconsole_restore_db(); } unset($groups_select[__('All')]); - $key_group_all = array_search(__('All'), $groups_select); + if(is_array($groups_select)){ + $key_group_all = array_search(__('All'), $groups_select); + } + else{ + $key_group_all = false; + } + if ($key_group_all !== false) unset($groups_select[$key_group_all]); return $modules; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 88c7220001..619f986d63 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -3625,7 +3625,7 @@ function reporting_get_total_servers ($num_servers) { function reporting_get_events ($data, $links = false) { global $config; - + $table_events = new stdClass(); $table_events->width = "100%"; if (defined('METACONSOLE')) $style = " vertical-align:middle;"; @@ -3697,7 +3697,7 @@ function reporting_get_last_activity() { global $config; // Show last activity from this user - + $table = new stdClass(); $table->width = '100%'; $table->data = array (); $table->size = array (); @@ -4010,8 +4010,10 @@ function reporting_get_event_histogram_meta ($width) { $events = db_get_all_rows_sql($sql); $events_criticity = array(); - foreach ($events as $key => $value) { - array_push($events_criticity,$value['criticity']); + if(is_array($events)){ + foreach ($events as $key => $value) { + array_push($events_criticity,$value['criticity']); + } } if (!empty($events)) {