#10081 Fix homescreen

This commit is contained in:
miguel angel rasteu 2023-05-11 16:44:11 +02:00
parent c1e35a5d17
commit ec658476b2
2 changed files with 17 additions and 1 deletions

View File

@ -54,6 +54,18 @@ if ($enterprise_include === true) {
enterprise_include_once('meta/include/functions_users_meta.php');
}
$homeScreenValues = [
HOME_SCREEN_DEFAULT => __('Default'),
HOME_SCREEN_VISUAL_CONSOLE => __('Visual console'),
HOME_SCREEN_EVENT_LIST => __('Event list'),
HOME_SCREEN_GROUP_VIEW => __('Group view'),
HOME_SCREEN_TACTICAL_VIEW => __('Tactical view'),
HOME_SCREEN_ALERT_DETAIL => __('Alert detail'),
HOME_SCREEN_EXTERNAL_LINK => __('External link'),
HOME_SCREEN_OTHER => __('Other'),
HOME_SCREEN_DASHBOARD => __('Dashboard'),
];
// This defines the working user. Beware with this, old code get confusses
// and operates with current logged user (dangerous).
$id = get_parameter('id', get_parameter('id_user', ''));
@ -414,6 +426,8 @@ if ($create_user === true) {
$values['data_section'] = get_parameter('data_section');
}
$values['section'] = $homeScreenValues[$values['section']];
if (enterprise_installed() === true) {
$values['force_change_pass'] = 1;
$values['last_pass_change'] = date('Y/m/d H:i:s', get_system_time());
@ -696,6 +710,8 @@ if ($update_user) {
$values['data_section'] = get_parameter('data_section');
}
$values['section'] = $homeScreenValues[$values['section']];
if (enterprise_installed() === true && is_metaconsole() === true) {
$values['metaconsole_access'] = get_parameter('metaconsole_access');
$values['metaconsole_agents_manager'] = get_parameter('metaconsole_agents_manager', '0');

View File

@ -624,7 +624,7 @@ $homeScreenTable->rowclass['fields_homescreen'] = 'field_half_width flex';
$homeScreenTable->data['fields_homescreen'][0] = html_print_select(
$homeScreenValues,
'section',
io_safe_output($user_info['section']),
array_search($user_info['section'], $homeScreenValues),
'show_data_section();',
'',
-1,