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

@ -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;

View File

@ -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;

View File

@ -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)) {