fixed warnings php

This commit is contained in:
daniel 2018-01-11 13:05:31 +01:00
parent 12faad0217
commit 57990d80a8
3 changed files with 20 additions and 8 deletions

View File

@ -2552,8 +2552,10 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal
foreach ($rows_temp as $module_group_key => $modules_group_val) foreach ($rows_temp as $module_group_key => $modules_group_val)
$rows_temp_processed[$modules_group_val['name']] = $modules_group_val['name']; $rows_temp_processed[$modules_group_val['name']] = $modules_group_val['name'];
if(is_array($rows_select) && is_array($rows_temp_processed)){
$rows_select = array_unique(array_merge($rows_select, $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); $groups_temp = users_get_groups_for_select(false, "AR", true, true, false);
@ -2565,8 +2567,10 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal
} }
if (!empty($groups_temp_processed)) { if (!empty($groups_temp_processed)) {
if(is_array($rows_select) && is_array($rows_temp_processed)){
$groups_select = array_unique(array_merge($groups_select, $groups_temp_processed)); $groups_select = array_unique(array_merge($groups_select, $groups_temp_processed));
} }
}
if (!empty($modules_temp)) if (!empty($modules_temp))
$modules = array_merge($modules, $modules_temp); $modules = array_merge($modules, $modules_temp);
@ -2574,7 +2578,13 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal
metaconsole_restore_db(); metaconsole_restore_db();
} }
unset($groups_select[__('All')]); unset($groups_select[__('All')]);
if(is_array($groups_select)){
$key_group_all = array_search(__('All'), $groups_select); $key_group_all = array_search(__('All'), $groups_select);
}
else{
$key_group_all = false;
}
if ($key_group_all !== false) if ($key_group_all !== false)
unset($groups_select[$key_group_all]); unset($groups_select[$key_group_all]);
return $modules; return $modules;

View File

@ -3625,7 +3625,7 @@ function reporting_get_total_servers ($num_servers) {
function reporting_get_events ($data, $links = false) { function reporting_get_events ($data, $links = false) {
global $config; global $config;
$table_events = new stdClass();
$table_events->width = "100%"; $table_events->width = "100%";
if (defined('METACONSOLE')) if (defined('METACONSOLE'))
$style = " vertical-align:middle;"; $style = " vertical-align:middle;";
@ -3697,7 +3697,7 @@ function reporting_get_last_activity() {
global $config; global $config;
// Show last activity from this user // Show last activity from this user
$table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->data = array (); $table->data = array ();
$table->size = array (); $table->size = array ();
@ -4010,9 +4010,11 @@ function reporting_get_event_histogram_meta ($width) {
$events = db_get_all_rows_sql($sql); $events = db_get_all_rows_sql($sql);
$events_criticity = array(); $events_criticity = array();
if(is_array($events)){
foreach ($events as $key => $value) { foreach ($events as $key => $value) {
array_push($events_criticity,$value['criticity']); array_push($events_criticity,$value['criticity']);
} }
}
if (!empty($events)) { if (!empty($events)) {
if(array_search('4',$events_criticity) !== false){ if(array_search('4',$events_criticity) !== false){