2019-01-30 16:18:44 +01:00
|
|
|
<?php
|
2021-05-18 10:57:21 +02:00
|
|
|
/**
|
|
|
|
* Os.
|
|
|
|
*
|
|
|
|
* @category Os
|
|
|
|
* @package Pandora FMS
|
|
|
|
* @subpackage Community
|
|
|
|
* @version 1.0.0
|
|
|
|
* @license See below
|
|
|
|
*
|
|
|
|
* ______ ___ _______ _______ ________
|
|
|
|
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
|
|
|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
|
|
|
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
|
|
|
*
|
|
|
|
* ============================================================================
|
|
|
|
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
|
|
|
* Please see http://pandorafms.org 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.
|
|
|
|
* ============================================================================
|
|
|
|
*/
|
2010-09-09 16:07:21 +02:00
|
|
|
|
2021-05-18 10:57:21 +02:00
|
|
|
// Load global vars.
|
2010-09-09 16:07:21 +02:00
|
|
|
global $config;
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
check_login();
|
2010-09-09 16:07:21 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
|
|
|
db_pandora_audit('ACL Violation', 'Trying to access Setup Management');
|
|
|
|
include 'general/noaccess.php';
|
|
|
|
return;
|
2010-09-09 16:07:21 +02:00
|
|
|
}
|
|
|
|
|
2021-05-18 10:57:21 +02:00
|
|
|
$is_management_allowed = true;
|
|
|
|
if (is_management_allowed() === false) {
|
|
|
|
$is_management_allowed = false;
|
|
|
|
ui_print_warning_message(
|
2021-06-24 19:48:07 +02:00
|
|
|
__(
|
|
|
|
'This node is configured with centralized mode. All OS definitions are read only. Go to %s to manage them.',
|
|
|
|
'<a target="_blank" href="'.ui_get_meta_url(
|
|
|
|
'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=list&pure=0'
|
|
|
|
).'">'.__('metaconsole').'</a>'
|
|
|
|
)
|
2021-05-18 10:57:21 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-06-25 10:07:53 +02:00
|
|
|
$table = new stdClass();
|
2010-09-09 16:07:21 +02:00
|
|
|
|
2015-06-16 16:09:50 +02:00
|
|
|
$table->width = '100%';
|
2019-03-29 11:05:52 +01:00
|
|
|
$table->class = 'info_table';
|
2015-06-16 16:09:50 +02:00
|
|
|
|
2010-09-09 16:07:21 +02:00
|
|
|
$table->head[0] = '';
|
2011-06-22 19:21:50 +02:00
|
|
|
$table->head[1] = __('ID');
|
|
|
|
$table->head[2] = __('Name');
|
|
|
|
$table->head[3] = __('Description');
|
2021-05-18 10:57:21 +02:00
|
|
|
if ($is_management_allowed === true) {
|
|
|
|
$table->head[4] = '';
|
|
|
|
}
|
|
|
|
|
2010-09-09 16:07:21 +02:00
|
|
|
$table->align[0] = 'center';
|
2021-05-18 10:57:21 +02:00
|
|
|
if ($is_management_allowed === true) {
|
|
|
|
$table->align[4] = 'center';
|
|
|
|
}
|
|
|
|
|
2010-09-09 16:07:21 +02:00
|
|
|
$table->size[0] = '20px';
|
2021-05-18 10:57:21 +02:00
|
|
|
if ($is_management_allowed === true) {
|
|
|
|
$table->size[4] = '20px';
|
|
|
|
}
|
2010-09-09 16:07:21 +02:00
|
|
|
|
2019-03-29 11:05:52 +01:00
|
|
|
// Prepare pagination.
|
|
|
|
$offset = (int) get_parameter('offset');
|
|
|
|
$limit = $config['block_size'];
|
|
|
|
$count_osList = db_get_value('count(*)', 'tconfig_os');
|
|
|
|
|
|
|
|
$osList = db_get_all_rows_filter(
|
|
|
|
'tconfig_os',
|
|
|
|
[
|
|
|
|
'offset' => $offset,
|
|
|
|
'limit' => $limit,
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
2012-06-14 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php, include/functions_reporting.php,
include/functions_groups.php, include/functions_visual_map.php,
include/ajax/reporting.ajax.php, include/functions_ui.php,
extensions/agents_modules.php, extensions/module_groups.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_agente.php,
operation/agentes/ver_agente.php,
operation/snmpconsole/snmp_view.php.
operation/integria_incidents/incident.incident.php,
mobile/operation/agents/monitor_status.php,
mobile/operation/agents/view_agents.php,
mobile/operation/agents/view_alerts.php,
mobile/operation/events/events.php,
godmode/groups/modu_group_list.php, godmode/groups/group_list.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/alerts/alert_list.list.php, godmode/setup/os.list.php,
godmode/users/configure_user.php,
godmode/modules/manage_network_templates.php,
godmode/reporting/reporting_builder.list_items.php,
godmode/tag/tag.php: changed the calls of "ui_print_truncate_text"
now we are trying that more easy and standar, now the string name of
agent have the equal number of characters in all code...but there
are two styles, small and medium size for agents text name, modules
text name, but description is only size. You can set this sizes in
the visual setup page into your Pandora.
MERGED from 4.0.2
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-06-14 18:23:23 +02:00
|
|
|
if ($osList === false) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$osList = [];
|
2011-07-21 11:24:41 +02:00
|
|
|
}
|
2010-09-09 16:07:21 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data = [];
|
2010-09-09 16:07:21 +02:00
|
|
|
foreach ($osList as $os) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$data = [];
|
|
|
|
$data[] = ui_print_os_icon($os['id_os'], false, true);
|
|
|
|
$data[] = $os['id_os'];
|
2021-05-18 10:57:21 +02:00
|
|
|
if ($is_management_allowed === true) {
|
|
|
|
if (is_metaconsole() === true) {
|
|
|
|
$data[] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=edit&tab2=builder&id_os='.$os['id_os'].'">'.io_safe_output($os['name']).'</a>';
|
|
|
|
} else {
|
|
|
|
$data[] = '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&action=edit&tab=builder&id_os='.$os['id_os'].'">'.io_safe_output($os['name']).'</a>';
|
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
2021-05-18 10:57:21 +02:00
|
|
|
$data[] = io_safe_output($os['name']);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$data[] = ui_print_truncate_text(io_safe_output($os['description']), 'description', true, true);
|
2019-04-02 13:42:30 +02:00
|
|
|
|
2021-05-18 10:57:21 +02:00
|
|
|
if ($is_management_allowed === true) {
|
|
|
|
$table->cellclass[][4] = 'action_buttons';
|
|
|
|
if ($os['id_os'] > 16) {
|
|
|
|
if (is_metaconsole()) {
|
|
|
|
$data[] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=delete&tab2=list&id_os='.$os['id_os'].'">'.html_print_image('images/cross.png', true).'</a>';
|
|
|
|
} else {
|
|
|
|
$data[] = '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&action=delete&tab=list&id_os='.$os['id_os'].'">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
|
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
2021-05-18 10:57:21 +02:00
|
|
|
// The original icons of pandora don't delete.
|
|
|
|
$data[] = '';
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->data[] = $data;
|
2010-09-09 16:07:21 +02:00
|
|
|
}
|
|
|
|
|
2021-05-18 10:57:21 +02:00
|
|
|
if (isset($data) === true) {
|
2020-06-23 14:45:04 +02:00
|
|
|
ui_pagination($count_osList, ui_get_url_refresh(['message' => false]), $offset);
|
2019-01-30 16:18:44 +01:00
|
|
|
html_print_table($table);
|
2020-06-23 14:45:04 +02:00
|
|
|
ui_pagination($count_osList, ui_get_url_refresh(['message' => false]), $offset, 0, false, 'offset', true, 'pagination-bottom');
|
2019-01-30 16:18:44 +01:00
|
|
|
} else {
|
|
|
|
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]);
|
2011-07-21 14:37:24 +02:00
|
|
|
}
|
2016-06-06 13:05:25 +02:00
|
|
|
|
2021-05-18 10:57:21 +02:00
|
|
|
if (is_metaconsole() === true) {
|
2019-01-30 16:18:44 +01:00
|
|
|
echo '<form method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=builder">';
|
|
|
|
echo "<div style='text-align:right;width:".$table->width."'>";
|
|
|
|
html_print_submit_button(__('Create OS'), '', false, 'class="sub next"');
|
|
|
|
echo '</div>';
|
|
|
|
echo '</form>';
|
2016-06-06 13:05:25 +02:00
|
|
|
}
|