diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql index f540abf454..6632e39f2b 100644 --- a/pandora_console/extras/mr/62.sql +++ b/pandora_console/extras/mr/62.sql @@ -155,6 +155,8 @@ INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`, `filename`, `path`) VALUES (20, 'zoom_en_graficas.png', 'images/tips/'), (22, 'politica_de_pass.png', 'images/tips/'); +ALTER TABLE `tusuario` ADD COLUMN `show_tips_startup` TINYINT UNSIGNED NOT NULL DEFAULT 1; + CREATE TABLE IF NOT EXISTS `tfavmenu_user` ( `id` INT NOT NULL AUTO_INCREMENT, `id_user` VARCHAR(255) NOT NULL, diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 40f6c3a382..b0cbc0cec5 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -407,7 +407,6 @@ echo sprintf('
', $menuTypeClass); // User. - // $headerUserImage = (is_user_admin($config['id_user']) === true) ? 'images/header_user_admin_green.png' : 'images/header_user_green.png'; $headerUser = []; $headerUser[] = html_print_image( 'images/edit_user@header.svg', diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 0e01bd051a..0d7e5fc0b6 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -406,9 +406,9 @@ $filterTable->data[1][0] = html_print_submit_button( ); // Print filter table. -echo '
'; +$form = ''; ui_toggle( - html_print_table($filterTable, true), + $form.html_print_table($filterTable, true).'
', ''.__('Filter').'', __('Filter'), 'filter', @@ -418,7 +418,6 @@ ui_toggle( 'white-box-content no_border', 'filter-datatable-main box-flat white_table_graph fixed_filter_bar' ); -echo ''; // Data table. $selected = true; diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index bc544b2861..55fa922381 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -1071,27 +1071,50 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr echo ''; } -$modalCreateModule = '
'; -$input_type = html_print_input_hidden('edit_module', 1, true); -$input_type .= html_print_select( - policies_type_modules_availables($sec2), - 'moduletype', - '', - '', - '', - '', - true, - false, - false, - '', - false, - 'max-width:300px;' +// Form table for Module creation. +$createModuleTable = new stdClass(); +$createModuleTable->id = 'module_creation_modal'; +$createModuleTable->class = 'filter-table-adv'; +$createModuleTable->data = []; + +$createModuleTable->data[0][] = html_print_label_input_block( + __('Select module type'), + html_print_select( + policies_type_modules_availables($sec2), + 'moduletype', + '', + '', + '', + '', + true, + false, + false, + '', + false, + 'max-width:300px;' + ) ); -$modalCreateModule .= $input_type; +$createModuleTable->data[1][] = html_print_label_input_block( + '', + html_print_anchor( + [ + 'href' => 'https://pandorafms.com/Library/Library/', + 'class' => 'color-black-grey invert_filter', + 'content' => __('Get more modules on Monitoring Library'), + ], + true + ) +); + +$createModuleFormTable = html_print_input_hidden('edit_module', 1, true); +$createModuleFormTable .= html_print_table($createModuleTable, true); +// Form definition. +$modalCreateModule = ''; +$modalCreateModule .= $createModuleFormTable; $modalCreateModule .= html_print_div( [ - 'class' => 'action-buttons', + 'class' => 'action-buttons-right-forced', 'content' => html_print_submit_button( __('Create'), 'create_module', diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 2cceb5fa34..0231245274 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -444,7 +444,8 @@ $tableBasicThresholds->data = []; $tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width pdd_t_10px'; $tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width'; $tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').' '; -if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) { + +if ((isset($stringTypeModule) === false || $stringTypeModule === false)) { $tableBasicThresholds->data['caption_warning_threshold'][0] .= '('.__('Min / Max').')'; $tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text( 'min_warning', @@ -482,7 +483,7 @@ if ($edit_module === false && (isset($stringTypeModule) === false || $stringType ); } -if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) { +if (isset($stringTypeModule) === true && $stringTypeModule === true) { $basicThresholdsIntervalWarning = []; $basicThresholdsIntervalWarning[] = ''.__('Inverse interval').''; $basicThresholdsIntervalWarning[] = html_print_checkbox_switch( @@ -531,7 +532,7 @@ $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div( $tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px'; $tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width'; $tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').' '; -if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) { +if ((isset($stringTypeModule) === false || $stringTypeModule === false)) { $tableBasicThresholds->data['caption_critical_threshold'][0] .= '('.__('Min / Max').')'; $tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text( 'min_critical', @@ -569,7 +570,7 @@ if ($edit_module === false && (isset($stringTypeModule) === false || $stringType ); } -if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) { +if (isset($stringTypeModule) === true && $stringTypeModule === true) { $basicThresholdsIntervalCritical = []; $basicThresholdsIntervalCritical[] = ''.__('Inverse interval').''; $basicThresholdsIntervalCritical[] = html_print_checkbox_switch( @@ -1906,77 +1907,50 @@ $(document).ready (function () { $('.switch_radio_button label').on('click', function(){ var thisLabel = $(this).attr('for'); - $('#'+thisLabel).attr('checked', 'checked'); - $('#'+thisLabel).siblings().attr('checked', false); + $('#'+thisLabel).prop('checked', true); + $('#'+thisLabel).siblings().prop('checked', false); - if ($('#radius-warning_inverse').prop('checked') === true) { - //$('#percentage_warning').hide(); - $("#svg_dinamic").show(); - } - - if ($('#radius-critical_inverse').prop('checked') === true) { - //$('#percentage_critical').hide(); + if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) { + $("#svg_dinamic").hide(); + } else { + paint_graph_values(); $("#svg_dinamic").show(); } if ($('#radius-percentage_warning').prop('checked') === true) { - //$('#warning_inverse').hide(); - $("#svg_dinamic").hide(); + $('#radius-warning_inverse').hide(); + $('#label-radius-warning_inverse').hide(); } + if ($('#radius-warning_inverse').prop('checked') === true) { + $('#radius-percentage_warning').hide(); + $('#label-radius-percentage_warning').hide(); + } + + if ($('#radius-normal_warning').prop('checked') === true) { + $('#radius-warning_inverse').show(); + $('#label-radius-warning_inverse').show(); + $('#radius-percentage_warning').show(); + $('#label-radius-percentage_warning').show(); + } + + if ($('#radius-percentage_critical').prop('checked') === true) { - //$('#critical_inverse').hide(); - $("#svg_dinamic").hide(); + $('#radius-critical_inverse').hide(); + $('#label-radius-critical_inverse').hide(); } - $('#radius-warning_inverse').change (function() { - paint_graph_values(); - if ($('#radius-warning_inverse').prop('checked') === true){ - $('#radius-percentage_warning').prop('checked', false); - $('#percentage_warning').attr('onClick', 'return false;'); - $('#percentage_warning>em').addClass('color_666'); - } else { - $('#percentage_warning').removeAttr('onClick'); - $('#percentage_warning>em').removeClass('color_666'); - } - }); + if ($('#radius-critical_inverse').prop('checked') === true) { + $('#radius-percentage_critical').hide(); + $('#label-radius-percentage_critical').hide(); + } - $('#radius-critical_inverse').change (function() { - paint_graph_values(); - - if ($('#radius-critical_inverse').prop('checked') === true){ - $('#radius-percentage_critical').prop('checked', false); - $('#percentage_critical').attr('onClick', 'return false;'); - $('#percentage_critical>em').addClass('color_666'); - } else { - $('#percentage_critical').removeAttr('onClick'); - $('#percentage_critical>em').removeClass('color_666'); - } - }); - - $('#radius-percentage_warning').change (function() { - paint_graph_values(); - if ($('#radius-percentage_warning').prop('checked') === true){ - $('#radius-warning_inverse').prop('checked', false); - $('#warning_inverse').attr('onClick', 'return false;'); - $('#warning_inverse>em').addClass('color_666'); - } else { - $('#warning_inverse').removeAttr('onClick'); - $('#warning_inverse>em').removeClass('color_666'); - } - }); - - $('#radius-percentage_critical').change (function() { - paint_graph_values(); - if ($('#radius-percentage_critical').prop('checked') === true){ - $('#radius-critical_inverse').prop('checked', false); - $('#critical_inverse').attr('onClick', 'return false;'); - $('#critical_inverse>em').addClass('color_666'); - } else { - $('#critical_inverse').removeAttr('onClick'); - $('#critical_inverse>em').removeClass('color_666'); - } - }); + if ($('#radius-normal_critical').prop('checked') === true) { + $('#radius-critical_inverse').show(); + $('#label-radius-critical_inverse').show(); + $('#radius-percentage_critical').show(); + $('#label-radius-percentage_critical').show(); + } }); @@ -2235,91 +2209,66 @@ function validate_post_process() { } } -//function paint graph +//function paint graph. function paint_graph_values(){ - //Parse integrer var min_w = parseFloat($('#text-min_warning').val()); - if(min_w == '0.00'){ min_w = 0; } - var max_w = parseFloat($('#text-max_warning').val()); - if(max_w == '0.00'){ max_w = 0; } - var min_c = parseFloat($('#text-min_critical').val()); - if(min_c =='0.00'){ min_c = 0; } - var max_c = parseFloat($('#text-max_critical').val()); - if(max_c =='0.00'){ max_c = 0; } - var inverse_w = $('input:radio[name=warning_inverse]:checked').val(); - if(!inverse_w){ inverse_w = 0; } - var inverse_c = $('input:radio[name=critical_inverse]:checked').val(); - if(!inverse_c){ inverse_c = 0; } + if(min_w == '0.00' || isNaN(min_w)){ min_w = 0; } - //inicialiced error + var max_w = parseFloat($('#text-max_warning').val()); + if(max_w == '0.00' || isNaN(max_w)){ max_w = 0; } + + var min_c = parseFloat($('#text-min_critical').val()); + if(min_c =='0.00' || isNaN(min_c)){ min_c = 0; } + + var max_c = parseFloat($('#text-max_critical').val()); + if(max_c =='0.00' || isNaN(max_c)){ max_c = 0; } + + var inverse_w = $('input:radio[value=warning_inverse]:checked').val(); + if(!inverse_w){ inverse_w = 0; } + + var inverse_c = $('input:radio[value=critical_inverse]:checked').val(); + if(!inverse_c){ inverse_c = 0; } + + //inicialiced error. var error_w = 0; var error_c = 0; - //messages legend + + //messages legend. var legend_normal = ''; var legend_warning = ''; var legend_critical = ''; - //messages error + + //messages error. var message_error_warning = ''; var message_error_critical = ''; var message_error_percentage = ''; - - - //Percentage selector - var percentage_w = $('#checkbox-percentage_warning').prop('checked'); - var percentage_c = $('#checkbox-percentage_critical').prop('checked'); - - if(percentage_w == true || percentage_c == true) { - d3.select("#svg_dinamic rect").remove(); - //create svg - var svg = d3.select("#svg_dinamic"); - svg.selectAll("g").remove(); - if (percentage_w === true) { - if(max_w < 0 || min_w < 0) { - paint_graph_status(0,0,0,0,0,0,1,0,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage); - } else { - $("#text-max_warning").removeClass("input_error"); - $("#text-min_warning").removeClass("input_error"); - } - - } - - if(percentage_c === true) { - if(max_c < 0 || min_c < 0) { - paint_graph_status(0,0,0,0,0,0,0,1,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage); - } else { - $("#text-min-critical").removeClass("input_error"); - $("#text-max_critical").removeClass("input_error"); - - } - } - - return; - - } else { - $('#svg_dinamic').show(); - } //if haven't error if(max_w == 0 || max_w > min_w){ if(max_c == 0 || max_c > min_c){ - paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, - inverse_c, error_w, error_c, - legend_normal, legend_warning, legend_critical, - message_error_warning, message_error_critical); + paint_graph_status( + min_w, max_w, min_c, max_c, inverse_w, + inverse_c, error_w, error_c, + legend_normal, legend_warning, legend_critical, + message_error_warning, message_error_critical + ); } else { error_c = 1; - paint_graph_status(0,0,0,0,0,0, error_w, error_c, - legend_normal, legend_warning, legend_critical, - message_error_warning, message_error_critical); + paint_graph_status( + 0,0,0,0,0,0, error_w, error_c, + legend_normal, legend_warning, legend_critical, + message_error_warning, message_error_critical + ); } } else { error_w = 1; - paint_graph_status(0,0,0,0,0,0, error_w, error_c, - legend_normal, legend_warning, legend_critical, - message_error_warning, message_error_critical); + paint_graph_status( + 0,0,0,0,0,0, error_w, error_c, + legend_normal, legend_warning, legend_critical, + message_error_warning, message_error_critical + ); } } -/* End of relationship javascript */ /* ]]> */ diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 45e7a26714..a2b0f242da 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -672,7 +672,7 @@ foreach ($simple_alerts as $alert) { '[…]', '' ); - $data[2] .= ' '; $data[2] .= html_print_image( 'images/details.svg', diff --git a/pandora_console/godmode/alerts/alert_view.php b/pandora_console/godmode/alerts/alert_view.php index 67b31ed3f3..e8b906b220 100644 --- a/pandora_console/godmode/alerts/alert_view.php +++ b/pandora_console/godmode/alerts/alert_view.php @@ -61,13 +61,19 @@ if ($default_action != 0) { } // Header. -ui_print_page_header( +ui_print_standard_header( __('Alert details'), 'images/op_alerts.png', false, '', false, - '' + [], + [ + [ + 'link' => '', + 'label' => __('Alerts'), + ], + ] ); // TABLE DETAILS. diff --git a/pandora_console/godmode/netflow/nf_edit.php b/pandora_console/godmode/netflow/nf_edit.php index b267b40254..1d2bdd48ad 100644 --- a/pandora_console/godmode/netflow/nf_edit.php +++ b/pandora_console/godmode/netflow/nf_edit.php @@ -1,16 +1,31 @@ 'index.php?sec=main', - 'text' => __('Main'), + 'link' => '', + 'label' => __('Netflow'), ], - [ - 'link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit', - 'text' => __('Netflow filters'), - ], - ]; + ], +); - ui_meta_print_page_header($nav_bar); - - ui_meta_print_header(__('Netflow filters')); +$is_windows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); +if ($is_windows === true) { + ui_print_error_message(__('Not supported in Windows systems')); } $delete = (bool) get_parameter('delete'); @@ -190,30 +195,37 @@ foreach ($filters as $filter) { if (check_acl_restricted_all($config['id_user'], $filter['id_group'], 'AW')) { $table->cellclass[][3] = 'table_action_buttons'; - $data[3] = "".html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter']).''; + $data[3] = ''; + $data[3] .= html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'main_menu_icon invert_filter']); + $data[3] .= ''; } array_push($table->data, $data); } -if (isset($data)) { - echo ""; +$buttons = html_print_submit_button( + __('Create filter'), + 'crt', + false, + ['icon' => 'wand'], + true +); + +// hd($filters); +if (empty($filters) === false) { + echo ''; html_print_input_hidden('multiple_delete', 1); html_print_table($table); - echo "
"; - - html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); - echo '
'; echo '
'; + $buttons .= html_print_submit_button(__('Delete'), 'delete_btn', false, ['icon' => 'delete', 'mode' => 'secondary', 'form' => 'multiple_delete'], true); } else { ui_print_info_message(['no_close' => true, 'message' => __('There are no defined filters') ]); } echo '
'; -echo "
"; -html_print_submit_button(__('Create filter'), 'crt', false, 'class="sub wand"'); -echo '
'; +html_print_action_buttons( + $buttons +); echo '
'; ?> @@ -221,27 +233,14 @@ echo ''; diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php index 15f9e391c3..6b5dda8159 100755 --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -875,7 +875,7 @@ if (defined('METACONSOLE')) { ], true ); - $form .= html_print_input_hidden('action', 'filter', true); + $form .= html_print_input_hidden('action', 'sort_items', true); $form .= ''; ui_toggle($form, __('Sort items'), '', '', false); diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index bb1c5d1c73..06d06c9823 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -1,5 +1,4 @@ 'user_form_title', - 'content' => ((bool) $id === true) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'), - ] - ); -} - if (!$new_user) { $user_id = '

'.__('User ID').':

'; $user_id .= ''.$id.''; $user_id .= html_print_input_hidden('id_user', $id, true); $user_id .= '
'; - $apiTokenContentElements[] = ''.__('API Token').''; + $apiTokenContentElements[] = ''.__('API Token').''; $apiTokenContentElements[] = html_print_button( __('Renew'), 'renew_api_token', false, sprintf( - 'javascript:renewAPIToken(\'%s\', \'%s\', \'%s\')', + 'javascript:renewAPIToken("%s", "%s", "%s")', __('Warning'), __('The API token will be renewed. After this action, the last token you were using will not work. Are you sure?'), 'user_profile_form', @@ -1033,7 +1023,7 @@ if (!$new_user) { 'show_api_token', false, sprintf( - 'javascript:showAPIToken(\'%s\', \'%s\')', + 'javascript:showAPIToken("%s", "%s")', __('API Token'), base64_encode(__('Your API Token is:').' 
'.users_get_API_token($id).'
 '.__('Please, avoid share this string with others.')), ), @@ -1282,8 +1272,9 @@ if (is_metaconsole() === false) { if (is_metaconsole() === true) { $array_filters = get_filters_custom_fields_view(0, true); - $search_custom_fields_view = '

'.__('Search custom field view').' '.ui_print_help_tip(__('Load by default the selected view in custom field view'), true).'

'; - $search_custom_fields_view .= html_print_select( + $searchCustomFieldView = []; + $searchCustomFieldView[] = __('Search custom field view'); + $searchCustomFieldView[] = html_print_select( $array_filters, 'default_custom_view', $user_info['default_custom_view'], @@ -1295,7 +1286,10 @@ if (is_metaconsole() === true) { true, '', false - ).'
'; + ).ui_print_input_placeholder( + __('Load by default the selected view in custom field view'), + true + ); } $values = [ @@ -1377,6 +1371,8 @@ $home_screen .= html_print_input_text( false ); +$home_screen = ''; + $size_pagination = '

'.__('Block size for pagination').'

'; $size_pagination .= html_print_input_text( 'block_size', @@ -1395,19 +1391,20 @@ if ($id === $config['id_user']) { ); } -if (enterprise_installed() && is_metaconsole() === true) { +if (enterprise_installed() === true && is_metaconsole() === true) { $user_info_metaconsole_access = 'only_console'; if (isset($user_info['metaconsole_access'])) { $user_info_metaconsole_access = $user_info['metaconsole_access']; } - // TODO review help tips on meta. - $meta_access = '

'.__('Metaconsole access').' './* ui_print_help_icon('meta_access', true). */ '

'; $metaconsole_accesses = [ 'basic' => __('Basic'), 'advanced' => __('Advanced'), ]; - $meta_access .= html_print_select( + + $outputMetaAccess = []; + $outputMetaAccess[] = __('Metaconsole access'); + $outputMetaAccess[] = html_print_select( $metaconsole_accesses, 'metaconsole_access', $user_info_metaconsole_access, @@ -1417,51 +1414,9 @@ if (enterprise_installed() && is_metaconsole() === true) { true, false, false - ).'
'; + ); } -/* - $not_login = '

'.__('Not Login').'

'; - $not_login .= ui_print_help_tip( - __('The user with not login set only can access to API.'), - true - ); - $not_login .= html_print_checkbox_switch( - 'not_login', - 1, - $user_info['not_login'], - true - ).'
'; - - $local_user = '

'.__('Local user').'

'; - $local_user .= ui_print_help_tip( - __('The user with local authentication enabled will always use local authentication.'), - true - ); - $local_user .= html_print_checkbox_switch( - 'local_user', - 1, - $user_info['local_user'], - true - ).'
'; - - $session_time = '

'.__('Session Time'); - $session_time .= ui_print_help_tip( - __('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'), - true - ).'

'; - $session_time .= html_print_input_text( - 'session_time', - $user_info['session_time'], - '', - 5, - 5, - true.false, - false, - '', - 'class="input_line_small"' - ).'
'; -*/ $user_groups = implode(',', array_keys((users_get_groups($id, 'AR', $display_all_group)))); if (empty($user_groups) === false) { @@ -1582,31 +1537,6 @@ if (empty($doubleAuthElementsContent) === false) { $doubleAuthentication = ''; } - -/* - if (isset($double_authentication)) { - $double_authentication .= '
'; -}*/ - - - - - - - - - - - - - - - - - - - - $autorefresh_list_out = []; if (is_metaconsole() === false || is_centralized() === true) { $autorefresh_list_out['operation/agentes/estado_agente'] = 'Agent detail'; @@ -1665,31 +1595,32 @@ if (isset($autorefresh_list) === false) { } } - - if (is_metaconsole() === true) { enterprise_include_once('include/functions_metaconsole.php'); $access_node = db_get_value('metaconsole_access_node', 'tusuario', 'id_user', $id); - $metaconsole_agents_manager = '

'.__('Enable agents managment').'

'; - $metaconsole_agents_manager .= html_print_checkbox_switch( + $metaconsoleAgentManager = []; + $metaconsoleAgentManager[] = __('Enable agents managment'); + $metaconsoleAgentManager[] = html_print_checkbox_switch( 'metaconsole_agents_manager', 1, $user_info['metaconsole_agents_manager'], true - ).'
'; + ); - $metaconsole_access_node = '

'.__('Enable node access').ui_print_help_tip(__('With this option enabled, the user will can access to nodes console'), true).'

'; - $metaconsole_access_node .= html_print_checkbox( + $metaconsoleAgentManager[] = __('Enable node access').ui_print_help_tip( + __('With this option enabled, the user will can access to nodes console'), + true + ); + $metaconsoleAgentManager[] = html_print_checkbox_switch( 'metaconsole_access_node', 1, $access_node, true - ).'
'; + ); } - echo '
'; echo '
'; @@ -1701,137 +1632,8 @@ if (!$id) { $user_id_create = $user_id; } -if (is_metaconsole() === true) { - $access_or_pagination = $meta_access; - if ($id != '' && !$is_err) { - $div_user_info = ' - '; - } else { - $div_user_info = ' - '; - } - - echo '
-
- -

Extra info

'.$email.$phone.$not_login.$local_user.$session_time.'
-
-
-
'.$language.$access_or_pagination.$skin.$default_event_filter.$double_authentication.'
- -
'.$timezone; - - echo $search_custom_fields_view.$metaconsole_agents_manager.$metaconsole_access_node; - - $autorefresh_show = '

'._('Autorefresh').ui_print_help_tip( - __('This will activate autorefresh in selected pages'), - true - ).'

'; - $select_out = html_print_select( - $autorefresh_list_out, - 'autorefresh_list_out[]', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width:100%' - ); - $arrows = ' '; - $select_in = html_print_select( - $autorefresh_list, - 'autorefresh_list[]', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width:100%' - ); - - $table_ichanges = ''; - - $autorefresh_show .= $table_ichanges; - - // Time autorefresh. - $times = get_refresh_time_array(); - $time_autorefresh = '

'.__('Time autorefresh'); - $time_autorefresh .= ui_print_help_tip( - __('Interval of autorefresh of the elements, by default they are 30 seconds, needing to enable the autorefresh first'), - true - ).'

'; - $time_autorefresh .= html_print_select( - $times, - 'time_autorefresh', - $user_info['time_autorefresh'], - '', - '', - '', - true, - false, - false - ).'
'; - - - echo '
-
-
'.$autorefresh_show.$time_autorefresh.'
-
-
'.$comments.'
-
'; - - if (empty($ehorus) === false) { - html_print_div( - [ - 'class' => 'user_edit_third_row white_box', - 'content' => $ehorus, - ], - true - ); - } -} else { - $access_or_pagination = $size_pagination; - // WIP: Only for node. - include_once 'user_management.php'; -} - +// User management form. +require_once 'user_management.php'; if ((bool) $config['admin_can_add_user'] === true) { html_print_csrf_hidden(); @@ -1912,7 +1714,7 @@ if (is_metaconsole() === false) { $(document).ready(function() { // Set up the picker to update target timezone and country select lists. $('#timezone-image').timezonePicker({ - target: '#timezone', + target: '#timezone1', }); // Optionally an auto-detect button to trigger JavaScript geolocation. @@ -1934,23 +1736,13 @@ if (is_metaconsole() === false) { var json_profile = $('#hidden-json_profile'); /* ) { id_imodule = $(value).attr('value'); - $("select[name='autorefresh_list[]']").append($("").val(id_imodule).html('' + imodule_name + '')); + $("select[name='autorefresh_list[]'] option").each(function() { $(this).attr("selected", true) }); + $("select[name='autorefresh_list[]']").append($("").val(id_imodule).html('' + imodule_name + '').attr("selected", true)); $("#autorefresh_list_out").find("option[value='" + id_imodule + "']").remove(); $("#autorefresh_list").find("option[value='']").remove(); $("#autorefresh_list").find("option[value='0']").remove(); diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index e4fe4225fa..57ddd56d50 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -395,8 +395,6 @@ if ($delete_user === true) { __('There was a problem deleting the user from %s', io_safe_input($server['server_name'])) ); } - - header('Refresh:1'); } } else { ui_print_error_message(__('There was a problem deleting the user')); @@ -463,43 +461,72 @@ if (($filter_group == 0) && ($filter_search == '')) { $filterTable = new stdClass(); $filterTable->width = '100%'; -$filterTable->class = 'fixed_filter_bar'; +$filterTable->class = 'filter-table-adv'; $filterTable->rowclass[0] = ''; $filterTable->cellstyle[0][0] = 'width:0'; $filterTable->cellstyle[0][1] = 'width:0'; -$filterTable->data[0][0] = __('Group'); -$filterTable->data[1][0] = html_print_select_groups( - false, - 'AR', - true, - 'filter_group', - $filter_group, - '', - '', - 0, - true +$filterTable->data[0][] = html_print_label_input_block( + __('Group'), + html_print_select_groups( + false, + 'AR', + true, + 'filter_group', + $filter_group, + '', + '', + 0, + true + ) ); -$filterTable->data[0][1] = __('Search').ui_print_help_tip(__('Search by username, fullname or email'), true); -$filterTable->data[1][1] = html_print_input_text( - 'filter_search', - $filter_search, - __('Search by username, fullname or email'), - 30, - 90, - true -); -$filterTable->cellstyle[1][2] = 'vertical-align: bottom'; -$filterTable->data[1][2] = html_print_submit_button( + +$filterTable->data[0][] = html_print_label_input_block( __('Search'), - 'search', - false, + html_print_input_text( + 'filter_search', + $filter_search, + __('Search by username, fullname or email'), + 30, + 90, + true + ).ui_print_input_placeholder( + __('Search by username, fullname or email'), + true + ) +); + +$form_filter = ""; +$form_filter .= html_print_table($filterTable, true); +$form_filter .= html_print_div( [ - 'icon' => 'search', - 'class' => 'float-right', - 'mode' => 'secondary mini', + 'class' => 'action-buttons-right-forced', + 'content' => html_print_submit_button( + __('Search'), + 'search', + false, + [ + 'icon' => 'search', + 'class' => 'float-right', + 'mode' => 'secondary mini', + ], + true + ), ], true ); +$form_filter .= ''; + +ui_toggle( + $form_filter, + ''.__('Filter').'', + __('Filter'), + 'filter', + true, + false, + '', + 'white-box-content no_border', + 'filter-datatable-main box-flat white_table_graph fixed_filter_bar' +); $is_management_allowed = true; if (is_metaconsole() === false && is_management_allowed() === false) { @@ -520,20 +547,6 @@ if (is_metaconsole() === false && is_management_allowed() === false) { ); } - -if (is_metaconsole() === true) { - $filterTable->width = '96%'; - $form_filter = "
"; - $form_filter .= html_print_table($filterTable, true); - $form_filter .= '
'; - ui_toggle($form_filter, __('Show Options')); -} else { - $form_filter = "
"; - $form_filter .= html_print_table($filterTable, true); - $form_filter .= '
'; - echo $form_filter; -} - // Urls to sort the table. $url_up_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=up&pure='.$pure; $url_down_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=down&pure='.$pure; diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index cff87aef6f..9bd2d6a858 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -325,53 +325,55 @@ if ($new_user === false) { $userManagementTable->data['passwordManage_table'] = html_print_table($passwordManageTable, true); +if (users_is_admin() === true) { + $userManagementTable->rowclass['captions_loginErrorUser'] = 'field_half_width w50p'; + $userManagementTable->cellclass['captions_loginErrorUser'][0] = 'wrap'; + $userManagementTable->cellclass['captions_loginErrorUser'][1] = 'wrap'; + $notLoginCheckContent = []; + $notLoginCheckContent[] = ''.__('Not Login').''; + $notLoginCheckContent[] = html_print_checkbox_switch( + 'not_login', + 1, + $user_info['not_login'], + true + ); -$userManagementTable->rowclass['captions_loginErrorUser'] = 'field_half_width w50p'; -$userManagementTable->cellclass['captions_loginErrorUser'][0] = 'wrap'; -$userManagementTable->cellclass['captions_loginErrorUser'][1] = 'wrap'; -$notLoginCheckContent = []; -$notLoginCheckContent[] = ''.__('Not Login').''; -$notLoginCheckContent[] = html_print_checkbox_switch( - 'not_login', - 1, - $user_info['not_login'], - true -); + $userManagementTable->data['captions_loginErrorUser'][0] = html_print_div( + [ + 'class' => 'margin-top-10', + 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;', + 'content' => implode('', $notLoginCheckContent), + ], + true + ); + $userManagementTable->data['captions_loginErrorUser'][0] .= ui_print_input_placeholder( + __('The user with not login set only can access to API.'), + true + ); -$userManagementTable->data['captions_loginErrorUser'][0] = html_print_div( - [ - 'class' => 'margin-top-10', - 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;', - 'content' => implode('', $notLoginCheckContent), - ], - true -); -$userManagementTable->data['captions_loginErrorUser'][0] .= ui_print_input_placeholder( - __('The user with not login set only can access to API.'), - true -); + $localUserCheckContent = []; + $localUserCheckContent[] = ''.__('Local User').''; + $localUserCheckContent[] = html_print_checkbox_switch( + 'local_user', + 1, + $user_info['local_user'], + true + ); -$localUserCheckContent = []; -$localUserCheckContent[] = ''.__('Local User').''; -$localUserCheckContent[] = html_print_checkbox_switch( - 'local_user', - 1, - $user_info['local_user'], - true -); + $userManagementTable->data['captions_loginErrorUser'][1] = html_print_div( + [ + 'class' => 'margin-top-10', + 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;', + 'content' => implode('', $localUserCheckContent), + ], + true + ); + $userManagementTable->data['captions_loginErrorUser'][1] .= ui_print_input_placeholder( + __('The user with local authentication enabled will always use local authentication.'), + true + ); +} -$userManagementTable->data['captions_loginErrorUser'][1] = html_print_div( - [ - 'class' => 'margin-top-10', - 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;', - 'content' => implode('', $localUserCheckContent), - ], - true -); -$userManagementTable->data['captions_loginErrorUser'][1] .= ui_print_input_placeholder( - __('The user with local authentication enabled will always use local authentication.'), - true -); $userManagementTable->data['show_tips_startup'][0] = html_print_checkbox_switch('show_tips_startup', 1, ($user_info['show_tips_startup'] === null) ? true : $user_info['show_tips_startup'], true); $userManagementTable->data['show_tips_startup'][1] = ''.__('Show usage tips at startup').''; @@ -551,10 +553,10 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh // Title for Language and Appearance. $userManagementTable->data['title_lookAndFeel'] = html_print_subtitle_table(__('Language and Appearance')); // Language and color scheme. -$userManagementTable->rowclass['captions_lang_colorscheme'] = 'field_half_width'; -$userManagementTable->rowclass['fields_lang_colorscheme'] = 'field_half_width'; -$userManagementTable->data['captions_lang_colorscheme'][0] = __('Language'); -$userManagementTable->data['fields_lang_colorscheme'][0] = html_print_select_from_sql( +$userManagementTable->rowclass['line1_looknfeel'] = 'field_half_width'; +$userManagementTable->rowclass['line2_looknfeel'] = 'field_half_width'; +$userManagementTable->data['line1_looknfeel'][0] = __('Language'); +$userManagementTable->data['line2_looknfeel'][0] = html_print_select_from_sql( 'SELECT id_language, name FROM tlanguage', 'language', $user_info['language'], @@ -564,8 +566,15 @@ $userManagementTable->data['fields_lang_colorscheme'][0] = html_print_select_fro true ); -$userManagementTable->data['captions_lang_colorscheme'][1] = __('User color scheme'); -$userManagementTable->data['fields_lang_colorscheme'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true); +if (is_metaconsole() === true) { + if (users_is_admin() === true) { + $userManagementTable->data['line1_looknfeel'][1] = $outputMetaAccess[0]; + $userManagementTable->data['line2_looknfeel'][1] = $outputMetaAccess[1]; + } +} else { + $userManagementTable->data['line1_looknfeel'][1] = __('User color scheme'); + $userManagementTable->data['line2_looknfeel'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true); +} $userManagementTable->rowclass['captions_blocksize_eventfilter'] = 'field_half_width'; $userManagementTable->rowclass['fields_blocksize_eventfilter'] = 'field_half_width'; @@ -591,41 +600,55 @@ $userManagementTable->data['fields_blocksize_eventfilter'][1] = html_print_selec false, false ); +if (is_metaconsole() === false) { + // Home screen table. + $homeScreenTable = new stdClass(); + $homeScreenTable->class = 'w100p table_section full_section'; + $homeScreenTable->id = 'home_screen_table'; + $homeScreenTable->style = []; + $homeScreenTable->rowclass = []; + $homeScreenTable->data = []; + // Home screen. + $homeScreenTable->data['captions_homescreen'][0] = __('Home screen'); + $homeScreenTable->colspan['captions_homescreen'][0] = 2; + $homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width'; + $homeScreenTable->rowclass['fields_homescreen'] = 'field_half_width flex'; + $homeScreenTable->data['fields_homescreen'][0] = html_print_select( + $homeScreenValues, + 'section', + io_safe_output($user_info['section']), + 'show_data_section();', + '', + -1, + true, + false, + false + ); + $homeScreenTable->data['fields_homescreen'][1] = html_print_div( + [ + 'class' => 'w100p', + 'content' => $customHomeScreenDataField, + ], + true + ); -// Home screen table. -$homeScreenTable = new stdClass(); -$homeScreenTable->class = 'w100p table_section full_section'; -$homeScreenTable->id = 'home_screen_table'; -$homeScreenTable->style = []; -$homeScreenTable->rowclass = []; -$homeScreenTable->data = []; + $userManagementTable->rowclass['homescreen_table'] = 'w100p'; + $userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true); +} -// Home screen. -$homeScreenTable->data['captions_homescreen'][0] = __('Home screen'); -$homeScreenTable->colspan['captions_homescreen'][0] = 2; -$homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width'; -$homeScreenTable->rowclass['fields_homescreen'] = 'field_half_width flex'; -$homeScreenTable->data['fields_homescreen'][0] = html_print_select( - $homeScreenValues, - 'section', - io_safe_output($user_info['section']), - 'show_data_section();', - '', - -1, - true, - false, - false -); -$homeScreenTable->data['fields_homescreen'][1] = html_print_div( - [ - 'class' => 'w100p', - 'content' => $customHomeScreenDataField, - ], - true -); +if (is_metaconsole() === true && users_is_admin() === true) { + $userManagementTable->rowclass['search_custom1_looknfeel'] = 'field_half_width'; + $userManagementTable->rowclass['search_custom2_looknfeel'] = 'field_half_width flex-column'; + $userManagementTable->data['search_custom1_looknfeel'][0] = $searchCustomFieldView[0]; + $userManagementTable->data['search_custom2_looknfeel'][0] = $searchCustomFieldView[1]; -$userManagementTable->rowclass['homescreen_table'] = 'w100p'; -$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true); + $userManagementTable->rowclass['agent_manager1_looknfeel'] = 'field_half_width'; + $userManagementTable->rowclass['agent_manager2_looknfeel'] = 'field_half_width flex-column'; + $userManagementTable->data['agent_manager1_looknfeel'][0] = $metaconsoleAgentManager[0]; + $userManagementTable->data['agent_manager1_looknfeel'][1] = $metaconsoleAgentManager[2]; + $userManagementTable->data['agent_manager2_looknfeel'][0] = $metaconsoleAgentManager[1]; + $userManagementTable->data['agent_manager2_looknfeel'][1] = $metaconsoleAgentManager[3]; +} // Timezone. $userManagementTable->rowclass['captions_timezone'] = 'field_half_width'; @@ -639,14 +662,15 @@ $userManagementTable->data['fields_timezone'][0] .= ui_print_input_placeholder( __('The timezone must be that of the associated server.'), true ); - -$userManagementTable->data['fields_timezone'][1] = html_print_div( - [ - 'id' => 'timezone-picker', - 'content' => implode('', $timezoneContent), - ], - true -); +if (is_metaconsole() === false) { + $userManagementTable->data['fields_timezone'][1] = html_print_div( + [ + 'id' => 'timezone-picker', + 'content' => implode('', $timezoneContent), + ], + true + ); +} // Title for Language and Appearance. $userManagementTable->data['title_additionalSettings'] = html_print_subtitle_table(__('Additional settings')); @@ -743,3 +767,19 @@ html_print_table($userManagementTable); if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) { profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true)); } + +?> + \ No newline at end of file diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index f610f48e4d..1c3642b075 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -731,7 +731,7 @@ class DiscoveryTaskList extends HTML case DISCOVERY_CLOUD_AZURE_COMPUTE: // Discovery Applications MySQL. $data[6] = html_print_image( - 'images/plugin@svg.svg', + 'images/plugins@svg.svg', true, [ 'title' => __('Discovery Cloud Azure Compute'), @@ -744,7 +744,7 @@ class DiscoveryTaskList extends HTML case DISCOVERY_CLOUD_AWS_EC2: // Discovery Applications MySQL. $data[6] = html_print_image( - 'images/plugin@svg.svg', + 'images/plugins@svg.svg', true, [ 'title' => __('Discovery Cloud AWS EC2'), @@ -856,7 +856,7 @@ class DiscoveryTaskList extends HTML } else { // APP or external script recon task. $data[6] = html_print_image( - 'images/plugin@svg.svg', + 'images/plugins@svg.svg', true, ['class' => 'main_menu_icon invert_filter'] ).'  '; diff --git a/pandora_console/include/chart_generator.php b/pandora_console/include/chart_generator.php index 7bc4785011..2e9ec50479 100644 --- a/pandora_console/include/chart_generator.php +++ b/pandora_console/include/chart_generator.php @@ -27,8 +27,6 @@ */ // Begin. -require_once 'config.php'; - require_once __DIR__.'/config.php'; require_once __DIR__.'/functions.php'; require_once __DIR__.'/functions_db.php'; @@ -87,7 +85,7 @@ if (check_login(false) === false) {

Access is not granted

-