2010-08-25 14:04:42 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
2010-09-20 19:35:59 +02:00
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
2010-08-25 14:04:42 +02:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Load global vars
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
require_once ("include/functions_agents.php");
|
|
|
|
|
|
|
|
check_login ();
|
|
|
|
|
|
|
|
$id_agente = get_parameter_get ("id_agente", -1);
|
|
|
|
|
|
|
|
if ($id_agente === -1) {
|
2013-05-23 17:42:32 +02:00
|
|
|
ui_print_error_message(__('There was a problem loading agent'));
|
2010-08-25 14:04:42 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-03-27 16:38:17 +02:00
|
|
|
// All groups is calculated in ver_agente.php. Avoid to calculate it again
|
|
|
|
if (!isset($all_groups)) {
|
|
|
|
$all_groups = agents_get_all_groups_agent ($idAgent, $id_group);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! check_acl_one_of_groups ($config["id_user"], $all_groups, "AR") && ! check_acl ($config['id_user'], 0, "AW")) {
|
|
|
|
db_pandora_audit("ACL Violation",
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
"Trying to access Agent General Information");
|
2010-08-25 14:04:42 +02:00
|
|
|
require_once ("general/noaccess.php");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-03-27 16:38:17 +02:00
|
|
|
$all_customs_fields = (bool)check_acl_one_of_groups($config["id_user"],
|
|
|
|
$all_groups, "AW");
|
2010-08-25 14:04:42 +02:00
|
|
|
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if ($all_customs_fields) {
|
|
|
|
$fields = db_get_all_rows_filter('tagent_custom_fields');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$fields = db_get_all_rows_filter('tagent_custom_fields',
|
|
|
|
array('display_on_front' => 1));
|
|
|
|
}
|
2010-08-25 14:04:42 +02:00
|
|
|
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
if ($fields === false) {
|
2010-09-20 19:35:59 +02:00
|
|
|
$fields = array();
|
2015-04-15 09:45:13 +02:00
|
|
|
ui_print_empty_data ( __("No fields defined") );
|
2012-02-28 13:17:57 +01:00
|
|
|
}
|
|
|
|
else {
|
2015-06-25 10:07:53 +02:00
|
|
|
$table = new stdClass();
|
2015-04-01 13:24:53 +02:00
|
|
|
$table->width = '100%';
|
|
|
|
$table->class = 'databox data';
|
2010-09-20 19:35:59 +02:00
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('Field');
|
2015-04-15 09:45:13 +02:00
|
|
|
$table->size[0] = "20%";
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
$table->head[1] = __('Display on front') .
|
|
|
|
ui_print_help_tip (__('The fields with display on front enabled will be displayed into the agent details'), true);
|
2015-06-12 15:50:46 +02:00
|
|
|
$table->size[1] = "20%";
|
2010-09-20 19:35:59 +02:00
|
|
|
$table->head[2] = __('Description');
|
|
|
|
$table->align = array ();
|
2015-06-12 15:50:46 +02:00
|
|
|
$table->align[1] = 'left';
|
2015-04-01 13:24:53 +02:00
|
|
|
$table->align[2] = 'left';
|
2010-09-20 19:35:59 +02:00
|
|
|
$table->data = array ();
|
2010-08-25 14:04:42 +02:00
|
|
|
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
foreach ($fields as $field) {
|
|
|
|
|
2010-09-20 19:35:59 +02:00
|
|
|
$data[0] = '<b>'.$field['name'].'</b>';
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
|
|
|
if ($field['display_on_front']) {
|
2011-04-27 15:43:31 +02:00
|
|
|
$data[1] = html_print_image('images/tick.png', true);
|
2012-02-28 13:17:57 +01:00
|
|
|
}
|
|
|
|
else {
|
2011-04-27 15:43:31 +02:00
|
|
|
$data[1] = html_print_image('images/delete.png', true);
|
2010-09-20 19:35:59 +02:00
|
|
|
}
|
2010-08-25 14:04:42 +02:00
|
|
|
|
2018-03-13 12:46:27 +01:00
|
|
|
$custom_value = db_get_all_rows_sql("select tagent_custom_data.description,tagent_custom_fields.is_password_type from tagent_custom_fields
|
|
|
|
INNER JOIN tagent_custom_data ON tagent_custom_fields.id_field = tagent_custom_data.id_field where tagent_custom_fields.id_field = ".$field['id_field']." and tagent_custom_data.id_agent = ".$id_agente);
|
|
|
|
|
|
|
|
if ($custom_value[0]['description'] === false || $custom_value[0]['description'] == '') {
|
|
|
|
$custom_value[0]['description'] = '<i>-'.__('empty').'-</i>';
|
2010-09-20 19:35:59 +02:00
|
|
|
}
|
2014-12-02 16:38:07 +01:00
|
|
|
else {
|
2018-03-13 12:46:27 +01:00
|
|
|
$custom_value[0]['description'] = ui_bbcode_to_html($custom_value[0]['description']);
|
2014-12-02 16:38:07 +01:00
|
|
|
}
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2018-03-13 12:46:27 +01:00
|
|
|
if($custom_value[0]['is_password_type']){
|
|
|
|
$data[2] = '••••••••';
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$data[2] = $custom_value[0]['description'];
|
|
|
|
}
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2010-09-20 19:35:59 +02:00
|
|
|
array_push ($table->data, $data);
|
|
|
|
}
|
2013-02-20 Miguel de Dios <miguel.dedios@artica.es>
* godmode/servers/recon_script.php, godmode/servers/plugin.php,
godmode/snmpconsole/snmp_filters.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_delete_action_alerts.php: improved the code
style.
* include/ajax/events.php, include/functions_events.php,
operation/agentes/custom_fields.php: fixed the show admin custom
fields for user without permisitions.
Fixes: #3605278
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7683 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-02-20 13:07:00 +01:00
|
|
|
|
2011-04-27 15:43:31 +02:00
|
|
|
html_print_table ($table);
|
2010-09-20 19:35:59 +02:00
|
|
|
}
|
2010-08-25 14:04:42 +02:00
|
|
|
?>
|