pandorafms/pandora_console/godmode/setup/setup.php

545 lines
18 KiB
PHP
Raw Normal View History

<?php
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
2023-06-08 12:42:10 +02:00
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
2023-06-08 11:53:13 +02:00
* Copyright (c) 2005-2023 Pandora FMS
2023-06-08 13:19:01 +02:00
* Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
global $config;
check_login();
if (is_ajax()) {
$get_os_icon = (bool) get_parameter('get_os_icon');
$select_timezone = get_parameter('select_timezone', 0);
if ($get_os_icon) {
$id_os = (int) get_parameter('id_os');
ui_print_os_icon($id_os, false);
return;
}
if ($select_timezone) {
$zone = get_parameter('zone');
$timezones = timezone_identifiers_list();
foreach ($timezones as $timezone_key => $timezone) {
if (strpos($timezone, $zone) === false) {
unset($timezones[$timezone_key]);
}
}
echo json_encode($timezones);
}
return;
2009-04-13 Esteban Sanchez <estebans@artica.es> * general/footer.php: Removed Firefox icon. Style correction. * godmode/agentes/agent_manager.php: Replaced &gt; with &raquo;. Style correction when setting bold attributes. * godmode/agentes/manage_config_remote.php, godmode/agentes/modificar_agente.php, godmode/agentes/module_manager.php, godmode/alerts/alert_list.php, godmode/db/db_audit.php, godmode/db/db_event.php, godmode/db/db_info.php, godmode/db/db_main.php, godmode/db/db_purge.php, godmode/db/db_refine.php, godmode/groups/configure_group.php, godmode/groups/group_list.php, godmode/modules/manage_nc_groups.php, godmode/modules/manage_network_components.php, godmode/modules/manage_network_templates.php, godmode/modules/manage_network_templates_form.php, godmode/modules/module_list.php, godmode/profiles/profile_list.php, godmode/reporting/graph_builder.php, godmode/reporting/map_builder.php, godmode/reporting/reporting_builder.php, godmode/servers/manage_export.php, godmode/servers/manage_export_form.php, godmode/servers/manage_recontask.php, godmode/servers/manage_recontask_form.php, godmode/servers/modificar_server.php, godmode/setup/setup_visuals.php, godmode/setup/links.php, godmode/setup/news.php, godmode/snmpconsole/snmp_alert.php, godmode/users/configure_user.php, godmode/users/user_list.php, operation/agentes/alerts_status.php, operation/agentes/estado_generalagente.php, operation/agentes/estado_agente.php, operation/agentes/estado_grupo.php, operation/agentes/estado_ultimopaquete.php, operation/agentes/exportdata.php, operation/agentes/networkmap.php, operation/agentes/status_monitor.php, operation/agentes/tactical.php, operation/events/events.php, operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/incidents/incident_statistics.php, operation/messages/message.php, operation/reporting/custom_reporting.php, operation/reporting/graph_viewer.php, operation/reporting/reporting_viewer.php, operation/servers/view_server.php, operation/users/user.php, operation/users/user_edit.php, operation/users/user_statistics.php, operation/visual_console/index.php, godmode/agentes/agent_template.php: Replaced &gt; with &raquo; * operation/agentes/datos_agente.php: Return instead of exit * include/javascript/jquery.pandora.controls.js: Added pandoraSelectOS control to preview the OS icon on a select. * include/functions_reports.php: Fixed a bug on delete_report() that returns error when the report has no content. * include/functions_ui.php: Removed border attribute on print_os_icon(). Some fixes to meta refresh element on process_page_head(). Fixed format_filesize() when length is zero. * godmode/menu.php: Replaced link to file manager. Added enterprise hook. * godmode/setup/file_manager.php: Renamed from obfuscated name filemgr.php * include/styles/pandora.css: Textarea width reduced to 99% * godmode/setup/setup.php: Added get_os_icon AJAX operation. * images/mimetypes/, images/mimetypes/zip.png, images/mimetypes/image.png, images/mimetypes/unknown.png, images/mimetypes/directory.png: Added to repository. Mime type icons. * extras/pandoradb_migrate_v2.x_to_v3.0.sql: Removed date comments. * include/functions_filemanager.php: Added to repository. Minimal API for file manager system. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-13 11:50:56 +02:00
}
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
2022-02-01 13:39:18 +01:00
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Setup Management'
);
include 'general/noaccess.php';
return;
2008-06-26 Esteban Sanchez <estebans@artica.es> * ajax.php: Sed id_user in config array. * godmode/menu.php, general/header.php, operation/menu.php: Replaced lang_label with lang_string(). * general/logon_ok.php: Reduced one indentation level. * godmode/agentes/agent_manager.php: Replaced lang_label with lang_string(). Use pandora functions. * include/functions_html.php, godmode/agentes/configurar_agente.php: Tab and blankspaces style correction. * godmode/reporting/map_builder.php: Complete rewritten to provide an intuitive way of build the maps. It's cool, useful and very simple. * godmode/reporting/reporting_builder.php: Deleted an output debug. * godmode/setup/setup.php: Rewritten to use pandora functions. Added a colorpicker for color settings. * include/config.php: Reset pandora password. We must solve things with this file... * include/functions.php: Check if input is an array on safe_input(). Use filename as id in array returned by list_files(). * include/functions_db.php: Renamed return_coordinate_* functions. Style correction. * include/javascript/jquery.js: Updated to 1.2.6. * include/javascript/jquery.ui.datepicker.js: Code minimized. * include/javascript/pandora.js: Style correction. * include/javascript/wz_jsgraphics.js: Added a class to the elements of a line, so it can be modified using javascript. * /include/styles/pandora.css: Added style to some tables dropdowns. Added new styles relative to visual map editor. * operation/reporting/reporting_viewer.php: Style correction. Added jQuery UI. * operation/visual_console/index.php: Use Pandora functions. * operation/visual_console/render_view.php: Drawing the map is now on functions_visual_map.php. Added a countdown if a refresh time is set. Use pandora functions. Style correction. * reporting/fgraph.php: Style correction. Use graphic_error() if there's no data on grafico_modulo_sparse(). * images/trash.png: Added to repository. Image used on trash area on visual map editor. * images/console/background/africa.jpg, images/console/background/asia.jpg, images/console/background/europe.jpg, images/console/background/north_america.jpg, images/console/background/oceania.jpg, images/console/background/shouth_america.jpg, images/console/background/world.jpg: Added to repository. Useful and cool map backgrounds. * include/functions_visual_map.php: Added to repository. Implements visual map functions like drawing the map. * include/javascript/jquery.colorpicker.js: Added to repository. Implements a color picker widget. * /include/javascript/jquery.countdown.js: Added to repository. Implements a countdown widget. * include/javascript/jquery.ui.core.js: Added to repository. jQuery UI core. * include/javascript/jquery.ui.draggable.js: Added to repository. jQuery draggable plugin. * include/javascript/jquery.ui.droppable.js: Added to repository. jQuery droppable plugin. * include/javascript/pandora_visual_console.js: Added to repository. Function useful to visual map interface. * include/languages/countdown_*.js: Added to repository. Countdown localization. * include/languages/date_es_la.js, include/languages/date_gl.js, include/languages/time_es_la.js, include/languages/time_gl.js: Added to repository. Missing localizations. * include/styles/color-picker.css: Added to repository. Colorpicker style sheet. * include/styles/countdown.css: Added to repository. Countdown style sheet. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
}
// Load enterprise extensions.
enterprise_include_once('include/functions_setup.php');
enterprise_include_once('include/functions_io.php');
enterprise_include_once('godmode/setup/setup.php');
/*
NOTICE FOR DEVELOPERS:
2015-06-08 13:13:09 +02:00
Update operation is done in config_process.php
This is done in that way so the user can see the changes inmediatly.
If you added a new token, please check config_update_config() in functions_config.php
to add it there.
*/
2008-06-26 Esteban Sanchez <estebans@artica.es> * ajax.php: Sed id_user in config array. * godmode/menu.php, general/header.php, operation/menu.php: Replaced lang_label with lang_string(). * general/logon_ok.php: Reduced one indentation level. * godmode/agentes/agent_manager.php: Replaced lang_label with lang_string(). Use pandora functions. * include/functions_html.php, godmode/agentes/configurar_agente.php: Tab and blankspaces style correction. * godmode/reporting/map_builder.php: Complete rewritten to provide an intuitive way of build the maps. It's cool, useful and very simple. * godmode/reporting/reporting_builder.php: Deleted an output debug. * godmode/setup/setup.php: Rewritten to use pandora functions. Added a colorpicker for color settings. * include/config.php: Reset pandora password. We must solve things with this file... * include/functions.php: Check if input is an array on safe_input(). Use filename as id in array returned by list_files(). * include/functions_db.php: Renamed return_coordinate_* functions. Style correction. * include/javascript/jquery.js: Updated to 1.2.6. * include/javascript/jquery.ui.datepicker.js: Code minimized. * include/javascript/pandora.js: Style correction. * include/javascript/wz_jsgraphics.js: Added a class to the elements of a line, so it can be modified using javascript. * /include/styles/pandora.css: Added style to some tables dropdowns. Added new styles relative to visual map editor. * operation/reporting/reporting_viewer.php: Style correction. Added jQuery UI. * operation/visual_console/index.php: Use Pandora functions. * operation/visual_console/render_view.php: Drawing the map is now on functions_visual_map.php. Added a countdown if a refresh time is set. Use pandora functions. Style correction. * reporting/fgraph.php: Style correction. Use graphic_error() if there's no data on grafico_modulo_sparse(). * images/trash.png: Added to repository. Image used on trash area on visual map editor. * images/console/background/africa.jpg, images/console/background/asia.jpg, images/console/background/europe.jpg, images/console/background/north_america.jpg, images/console/background/oceania.jpg, images/console/background/shouth_america.jpg, images/console/background/world.jpg: Added to repository. Useful and cool map backgrounds. * include/functions_visual_map.php: Added to repository. Implements visual map functions like drawing the map. * include/javascript/jquery.colorpicker.js: Added to repository. Implements a color picker widget. * /include/javascript/jquery.countdown.js: Added to repository. Implements a countdown widget. * include/javascript/jquery.ui.core.js: Added to repository. jQuery UI core. * include/javascript/jquery.ui.draggable.js: Added to repository. jQuery draggable plugin. * include/javascript/jquery.ui.droppable.js: Added to repository. jQuery droppable plugin. * include/javascript/pandora_visual_console.js: Added to repository. Function useful to visual map interface. * include/languages/countdown_*.js: Added to repository. Countdown localization. * include/languages/date_es_la.js, include/languages/date_gl.js, include/languages/time_es_la.js, include/languages/time_gl.js: Added to repository. Missing localizations. * include/styles/color-picker.css: Added to repository. Colorpicker style sheet. * include/styles/countdown.css: Added to repository. Countdown style sheet. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
// Gets section to jump to another section.
$section = (string) get_parameter('section', 'general');
$buttons = [];
2024-03-12 13:16:16 +01:00
$menu_tabs = [];
// Draws header.
$buttons['general'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general').'">'.html_print_image(
'images/setup.png',
true,
[
2023-09-11 16:53:52 +02:00
'title' => __('General setup'),
'class' => 'invert_filter',
]
).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=general').'">'.__('General setup').'</a>';
array_push($menu_tabs, $menu_tab_url);
if (enterprise_installed()) {
$buttons = setup_enterprise_add_Tabs($buttons);
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=enterprise').'">'.__('Enterprise').'</a>';
array_push($menu_tabs, $menu_tab_url);
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=pass').'">'.__('Password').'</a>';
array_push($menu_tabs, $menu_tab_url);
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=hist_db').'">'.__('History database').'</a>';
array_push($menu_tabs, $menu_tab_url);
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=log').'">'.__('Log collector').'</a>';
array_push($menu_tabs, $menu_tab_url);
}
$buttons['auth'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=auth').'">'.html_print_image(
'images/key.png',
true,
[
'title' => __('Authentication'),
'class' => 'invert_filter',
]
).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=auth').'">'.__('Authentication').'</a>';
array_push($menu_tabs, $menu_tab_url);
$buttons['perf'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=perf').'">'.html_print_image(
'images/performance.png',
true,
[
'title' => __('Performance'),
'class' => 'invert_filter',
]
).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=perf').'">'.__('Performance').'</a>';
array_push($menu_tabs, $menu_tab_url);
$buttons['vis'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=vis').'">'.html_print_image(
'images/chart.png',
true,
[
'title' => __('Visual styles'),
'class' => 'invert_filter',
]
).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=vis').'">'.__('Visual styles').'</a>';
array_push($menu_tabs, $menu_tab_url);
if (check_acl($config['id_user'], 0, 'AW')) {
if ($config['activate_netflow']) {
$buttons['net'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=net').'">'.html_print_image(
'images/op_netflow.png',
true,
[
'title' => __('Netflow'),
'class' => 'invert_filter',
]
).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=net').'">'.__('Netflow').'</a>';
array_push($menu_tabs, $menu_tab_url);
}
2023-03-10 17:12:38 +01:00
if ($config['activate_sflow']) {
$buttons['sflow'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=sflow').'">'.html_print_image(
2023-03-14 10:46:50 +01:00
'images/op_recon.png',
2023-03-10 17:12:38 +01:00
true,
[
'title' => __('Sflow'),
'class' => 'invert_filter',
]
).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=sflow').'">'.__('Sflow').'</a>';
array_push($menu_tabs, $menu_tab_url);
2023-03-10 17:12:38 +01:00
}
}
2023-07-21 14:23:42 +02:00
$buttons['ITSM'] = [
2019-09-02 17:01:41 +02:00
'active' => false,
2023-07-21 14:23:42 +02:00
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=ITSM').'">'.html_print_image(
2023-09-04 16:36:58 +02:00
'images/itsm.png',
true,
[
2023-07-19 11:36:03 +02:00
'title' => __('ITSM'),
'class' => 'invert_filter',
]
).'</a>',
2019-09-02 17:01:41 +02:00
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=ITSM').'">'.__('ITSM').'</a>';
array_push($menu_tabs, $menu_tab_url);
2019-09-02 17:01:41 +02:00
$buttons['ehorus'] = [
'active' => false,
2023-11-10 13:13:57 +01:00
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=pandorarc').'">'.html_print_image(
2023-09-04 16:36:58 +02:00
'images/RC.png',
true,
[
2023-10-10 09:57:09 +02:00
'title' => __('Pandora RC'),
'class' => 'invert_filter',
]
).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=pandorarc').'">'.__('Pandora RC').'</a>';
array_push($menu_tabs, $menu_tab_url);
2016-05-04 19:19:07 +02:00
if (check_acl($config['id_user'], 0, 'PM') && enterprise_installed()) {
$buttons['module_library'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=module_library').'">'.html_print_image(
'images/library.png',
true,
[
'title' => __('Module Library'),
'class' => 'invert_filter',
]
).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=module_library').'">'.__('Module Library').'</a>';
array_push($menu_tabs, $menu_tab_url);
}
// FIXME: Not definitive icon
$buttons['notifications'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=notifications').'">'.html_print_image(
'images/alerts_template.png',
true,
[
'title' => __('Notifications'),
'class' => 'invert_filter',
]
).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=notifications').'">'.__('Notifications').'</a>';
array_push($menu_tabs, $menu_tab_url);
2023-09-27 18:28:12 +02:00
$buttons['quickshell'] = [
2019-12-13 13:11:38 +01:00
'active' => false,
2023-09-27 18:28:12 +02:00
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=quickshell').'">'.html_print_image(
'images/websocket_small.png',
true,
[
2023-09-25 19:08:24 +02:00
'title' => __('QuickShell'),
'class' => 'invert_filter',
]
).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=quickshell').'">'.__('QuickShell').'</a>';
array_push($menu_tabs, $menu_tab_url);
2020-12-18 12:34:39 +01:00
$buttons['external_tools'] = [
2020-12-16 14:09:54 +01:00
'active' => false,
2021-03-16 11:24:05 +01:00
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=external_tools').'">'.html_print_image('images/nettool.png', true, ['title' => __('External Tools'), 'class' => 'invert_filter']).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=external_tools').'">'.__('External Tools').'</a>';
array_push($menu_tabs, $menu_tab_url);
$buttons['welcome_tips'] = [
'active' => false,
2023-03-06 12:20:08 +01:00
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips').'">'.html_print_image('images/inventory.png', true, ['title' => __('Welcome tips'), 'class' => 'invert_filter']).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips').'">'.__('Welcome tips').'</a>';
array_push($menu_tabs, $menu_tab_url);
2023-11-24 12:56:21 +01:00
$buttons['demo_data'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=demo_data').'">'.html_print_image('images/demo_data.png', true, ['title' => __('Demo data'), 'class' => 'invert_filter']).'</a>',
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=demo_data').'">'.__('Demo data').'</a>';
array_push($menu_tabs, $menu_tab_url);
2023-11-24 12:56:21 +01:00
2020-01-08 15:57:18 +01:00
if ($config['activate_gis']) {
$buttons['gis'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup&section=gis').'">'.html_print_image(
'images/gis_tab.png',
true,
[
'title' => __('GIS Map connection'),
'class' => 'invert_filter',
]
).'</a>',
2020-01-08 15:57:18 +01:00
];
2024-03-12 13:16:16 +01:00
$menu_tab_url = '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=gis').'">'.__('GIS Map connection').'</a>';
array_push($menu_tabs, $menu_tab_url);
2020-01-08 15:57:18 +01:00
}
2020-01-08 15:44:59 +01:00
$help_header = '';
if (enterprise_installed()) {
$subpage = setup_enterprise_add_subsection_main($section, $buttons, $help_header);
}
2020-01-08 15:44:59 +01:00
switch ($section) {
case 'general':
$buttons['general']['active'] = true;
2023-09-11 16:53:52 +02:00
$subpage = __('General setup');
2020-01-08 15:44:59 +01:00
$help_header = 'setup_general_tab';
break;
case 'auth':
$buttons['auth']['active'] = true;
2023-03-13 15:44:55 +01:00
$subpage = __('Authentication');
2020-01-08 15:44:59 +01:00
break;
case 'perf':
$buttons['perf']['active'] = true;
2023-03-13 15:44:55 +01:00
$subpage = __('Performance');
2020-01-08 15:44:59 +01:00
$help_header = '';
break;
case 'vis':
$buttons['vis']['active'] = true;
2023-03-13 15:44:55 +01:00
$subpage = __('Visual styles');
2020-01-08 15:44:59 +01:00
break;
case 'net':
$buttons['net']['active'] = true;
2023-03-13 15:44:55 +01:00
$subpage = __('Netflow');
$help_header = 'setup_netflow_tab';
2020-01-08 15:44:59 +01:00
break;
2023-03-10 17:12:38 +01:00
case 'sflow':
$buttons['sflow']['active'] = true;
2023-03-21 10:30:35 +01:00
$subpage = __('Sflow');
2023-03-10 17:12:38 +01:00
$help_header = 'setup_flow_tab';
break;
2023-11-10 13:13:57 +01:00
case 'pandorarc':
2020-01-08 15:44:59 +01:00
$buttons['ehorus']['active'] = true;
2023-10-10 09:57:09 +02:00
$subpage = __('Pandora RC');
2020-01-08 15:44:59 +01:00
$help_header = 'setup_ehorus_tab';
break;
2023-07-21 14:23:42 +02:00
case 'ITSM':
$buttons['ITSM']['active'] = true;
$subpage = __('Pandora ITSM');
$help_header = 'setup_ITSM_tab';
2020-01-08 15:44:59 +01:00
break;
case 'module_library':
$buttons['module_library']['active'] = true;
2023-03-13 15:44:55 +01:00
$subpage = __('Module Library');
$help_header = 'setup_module_library_tab';
break;
2020-01-08 15:48:07 +01:00
case 'gis':
$buttons['gis']['active'] = true;
2023-03-13 15:44:55 +01:00
$subpage = __('Map conections GIS');
2020-01-08 15:48:07 +01:00
break;
2020-01-08 15:44:59 +01:00
case 'notifications':
$buttons['notifications']['active'] = true;
2023-03-13 15:44:55 +01:00
$subpage = __('Notifications');
2020-01-08 15:44:59 +01:00
break;
2023-09-27 18:28:12 +02:00
case 'quickshell':
$buttons['quickshell']['active'] = true;
2023-09-25 19:08:24 +02:00
$subpage = __('QuickShell');
2020-01-08 15:44:59 +01:00
$help_header = 'quickshell_settings';
break;
2020-12-18 12:34:39 +01:00
case 'external_tools':
$buttons['external_tools']['active'] = true;
2023-03-13 15:44:55 +01:00
$subpage = __('External Tools');
2021-06-24 14:31:15 +02:00
$help_header = '';
2020-12-16 14:09:54 +01:00
break;
case 'welcome_tips':
$view = get_parameter('view', '');
$title = __('Welcome tips');
if ($view === 'create') {
$title = __('Create tip');
} else if ($view === 'edit') {
$title = __('Edit tip');
}
$buttons['welcome_tips']['active'] = true;
2023-03-13 15:44:55 +01:00
$subpage = $title;
2021-06-24 14:31:15 +02:00
$help_header = '';
2020-12-16 14:09:54 +01:00
break;
2023-11-24 12:56:21 +01:00
case 'demo_data':
$buttons['demo_data']['active'] = true;
$subpage = __('Demo data');
$help_header = '';
break;
2020-01-08 15:44:59 +01:00
case 'enterprise':
$buttons['enterprise']['active'] = true;
2023-03-13 15:44:55 +01:00
$subpage = __('Enterprise');
2020-01-08 15:44:59 +01:00
$help_header = 'setup_enterprise_tab';
break;
2023-03-13 15:44:55 +01:00
case 'hist_db':
$buttons['hist_db']['active'] = true;
$subpage = __('Historical database');
$help_header = '';
break;
case 'pass':
$buttons['pass']['active'] = true;
$subpage = __('Password policies');
$help_header = '';
break;
case 'log':
$buttons['log']['active'] = true;
$subpage = __('Log Collector');
$help_header = 'opensearch_installation';
break;
2020-01-08 15:44:59 +01:00
default:
$subpage = '';
2020-01-08 15:44:59 +01:00
// Default.
break;
}
2024-02-20 12:54:35 +01:00
$dots = dot_tab($menu_tabs);
2020-01-08 15:44:59 +01:00
// Header.
2023-03-13 15:44:55 +01:00
ui_print_standard_header(
$subpage,
2020-01-08 15:44:59 +01:00
'',
false,
$help_header,
true,
2022-03-09 17:20:24 +01:00
$buttons,
2023-03-13 15:44:55 +01:00
[
[
'link' => '',
'label' => __('Setup'),
],
2023-09-11 16:53:52 +02:00
[
'link' => '',
'label' => $subpage,
],
2024-02-20 12:54:35 +01:00
],
[],
$dots
2020-01-08 15:44:59 +01:00
);
if (isset($config['error_config_update_config'])) {
if ($config['error_config_update_config']['correct'] == false) {
ui_print_error_message($config['error_config_update_config']['message']);
} else {
ui_print_success_message(__('Correct update the setup options'));
}
2024-02-08 12:31:55 +01:00
if (isset($config['error_config_update_config']['errors']) === true) {
if (is_array($config['error_config_update_config']['errors']) === true) {
foreach ($config['error_config_update_config']['errors'] as $msg) {
ui_print_error_message($msg);
}
}
}
2024-02-08 12:31:55 +01:00
if (isset($config['error_config_update_config']['warnings']) === true) {
if (is_array($config['error_config_update_config']['warnings']) === true) {
foreach ($config['error_config_update_config']['warnings'] as $msg) {
ui_print_warning_message($msg);
}
}
}
2020-01-08 15:44:59 +01:00
unset($config['error_config_update_config']);
}
2020-01-08 15:44:59 +01:00
switch ($section) {
case 'general':
include_once $config['homedir'].'/godmode/setup/setup_general.php';
break;
2020-01-08 15:44:59 +01:00
case 'auth':
include_once $config['homedir'].'/godmode/setup/setup_auth.php';
break;
2020-01-08 15:44:59 +01:00
case 'perf':
include_once $config['homedir'].'/godmode/setup/performance.php';
break;
2020-01-08 15:44:59 +01:00
case 'net':
include_once $config['homedir'].'/godmode/setup/setup_netflow.php';
break;
2023-03-10 17:12:38 +01:00
case 'sflow':
include_once $config['homedir'].'/godmode/setup/setup_sflow.php';
break;
2020-01-08 15:44:59 +01:00
case 'vis':
include_once $config['homedir'].'/godmode/setup/setup_visuals.php';
break;
2023-11-10 13:13:57 +01:00
case 'pandorarc':
2020-01-08 15:44:59 +01:00
include_once $config['homedir'].'/godmode/setup/setup_ehorus.php';
break;
2023-07-21 14:23:42 +02:00
case 'ITSM':
include_once $config['homedir'].'/godmode/setup/setup_ITSM.php';
2020-01-08 15:44:59 +01:00
break;
2019-08-05 13:42:01 +02:00
2020-01-08 15:48:07 +01:00
case 'gis':
include_once $config['homedir'].'/godmode/setup/gis.php';
break;
2020-01-08 15:44:59 +01:00
case 'notifications':
include_once $config['homedir'].'/godmode/setup/setup_notifications.php';
break;
2023-09-27 18:28:12 +02:00
case 'quickshell':
include_once $config['homedir'].'/godmode/setup/setup_quickshell.php';
2020-01-08 15:44:59 +01:00
break;
2020-12-18 12:34:39 +01:00
case 'external_tools':
include_once $config['homedir'].'/godmode/setup/setup_external_tools.php';
2020-12-16 14:09:54 +01:00
break;
case 'welcome_tips':
include_once $config['homedir'].'/godmode/setup/welcome_tips.php';
break;
2023-11-24 12:56:21 +01:00
case 'demo_data':
include_once $config['homedir'].'/godmode/setup/demo.php';
break;
2020-01-08 15:44:59 +01:00
default:
enterprise_hook('setup_enterprise_select_tab', [$section]);
break;
}