mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
merge conflict
This commit is contained in:
commit
430d25a551
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.754-210603
|
||||
Version: 7.0NG.754-210604
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.754-210603"
|
||||
pandora_version="7.0NG.754-210604"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -1015,7 +1015,7 @@ my $Sem = undef;
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.754';
|
||||
use constant AGENT_BUILD => '210603';
|
||||
use constant AGENT_BUILD => '210604';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.754
|
||||
%define release 210603
|
||||
%define release 210604
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.754
|
||||
%define release 210603
|
||||
%define release 210604
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -10,7 +10,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.754"
|
||||
PI_BUILD="210603"
|
||||
PI_BUILD="210604"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{210603}
|
||||
{210604}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.754 Build 210603")
|
||||
#define PANDORA_VERSION ("7.0NG.754 Build 210604")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -11,7 +11,7 @@ BEGIN
|
||||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.754(Build 210603))"
|
||||
VALUE "ProductVersion", "(7.0NG.754(Build 210604))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.754-210603
|
||||
Version: 7.0NG.754-210604
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.754-210603"
|
||||
pandora_version="7.0NG.754-210604"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
@ -383,7 +383,7 @@ function mainAgentsModules()
|
||||
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
|
||||
} else {
|
||||
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&pure=1&
|
||||
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
|
||||
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ echo '</table>';
|
||||
if (!$config['disable_help']) {
|
||||
echo '<div class="disable_help">';
|
||||
echo '<strong>';
|
||||
echo "<a class='color-black-grey' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>';
|
||||
echo "<a class='color-black-grey invert_filter' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>';
|
||||
echo '</strong>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
@ -810,7 +810,8 @@ foreach ($simple_alerts as $alert) {
|
||||
'images/lightbulb_off.png',
|
||||
1,
|
||||
'padding:0px',
|
||||
true
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('enable_alert', 1, true);
|
||||
} else {
|
||||
@ -879,7 +880,10 @@ foreach ($simple_alerts as $alert) {
|
||||
$data[4] .= html_print_image(
|
||||
'images/add.disabled.png',
|
||||
true,
|
||||
['title' => __('Add action')]
|
||||
[
|
||||
'title' => __('Add action'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
if ((int) $alert['id_policy_alerts'] === 0) {
|
||||
|
@ -224,31 +224,31 @@ $table_days->data[0] = array_fill(0, 7, html_print_image('images/blade.png', tru
|
||||
|
||||
$days = [];
|
||||
if ($template['monday']) {
|
||||
$table_days->data[0][0] = html_print_image('images/tick.png', true);
|
||||
$table_days->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
if ($template['tuesday']) {
|
||||
$table_days->data[0][1] = html_print_image('images/tick.png', true);
|
||||
$table_days->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
if ($template['wednesday']) {
|
||||
$table_days->data[0][2] = html_print_image('images/tick.png', true);
|
||||
$table_days->data[0][2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
if ($template['thursday']) {
|
||||
$table_days->data[0][3] = html_print_image('images/tick.png', true);
|
||||
$table_days->data[0][3] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
if ($template['friday']) {
|
||||
$table_days->data[0][4] = html_print_image('images/tick.png', true);
|
||||
$table_days->data[0][4] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
if ($template['saturday']) {
|
||||
$table_days->data[0][5] = html_print_image('images/tick.png', true);
|
||||
$table_days->data[0][5] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
if ($template['sunday']) {
|
||||
$table_days->data[0][6] = html_print_image('images/tick.png', true);
|
||||
$table_days->data[0][6] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
$data[0] = html_print_table($table_days, true);
|
||||
@ -265,7 +265,7 @@ $table_time->styleTable = 'padding: 1px; margin: 0px; text-align: center; height
|
||||
// $data[0] = __('Time from') . ' / ' . __('Time to');
|
||||
if ($template['time_from'] == $template['time_to']) {
|
||||
$table_time->head[0] = '00:00:00<br>-<br>23:59:59';
|
||||
$table_time->data[0][0] = html_print_image('images/tick.png', true);
|
||||
$table_time->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
} else {
|
||||
$from_array = explode(':', $template['time_from']);
|
||||
$from = ($from_array[0] * SECONDS_1HOUR + $from_array[1] * SECONDS_1MINUTE + $from_array[2]);
|
||||
@ -278,7 +278,7 @@ if ($template['time_from'] == $template['time_to']) {
|
||||
}
|
||||
|
||||
$table_time->head[1] = $template['time_from'].'<br>-<br>'.$template['time_to'];
|
||||
$table_time->data[0][1] = html_print_image('images/tick.png', true);
|
||||
$table_time->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
|
||||
if ($template['time_to'] != '23:59:59') {
|
||||
$table_time->head[2] = $template['time_to'].'<br>-<br>23:59:59';
|
||||
@ -287,15 +287,15 @@ if ($template['time_from'] == $template['time_to']) {
|
||||
} else {
|
||||
if ($template['time_to'] != '00:00:00') {
|
||||
$table_time->head[0] = '00:00:00<br>-<br>'.$template['time_to'];
|
||||
$table_time->data[0][0] = html_print_image('images/tick.png', true);
|
||||
$table_time->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
$table_time->head[1] = $template['time_to'].'<br>-<br>'.$template['time_from'];
|
||||
$table_time->data[0][1] = html_print_image('images/blade.png', true);
|
||||
$table_time->data[0][1] = html_print_image('images/blade.png', true, ['class' => 'invert_filter']);
|
||||
|
||||
if ($template['time_from'] != '23:59:59') {
|
||||
$table_time->head[2] = $template['time_from'].'<br>-<br>23:59:59';
|
||||
$table_time->data[0][2] = html_print_image('images/tick.png', true);
|
||||
$table_time->data[0][2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -354,7 +354,7 @@ $table->style[0] = 'font-weight: bold; text-align: left;';
|
||||
if (count($actions) == 1 && isset($actions[0])) {
|
||||
$table->head[1] = __('Every time that the alert is fired');
|
||||
$table->data[0][0] = $actions[0]['name'];
|
||||
$table->data[0][1] = html_print_image('images/tick.png', true);
|
||||
$table->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
} else {
|
||||
foreach ($actions as $kaction => $action) {
|
||||
$table->data[$kaction][0] = $action['name'];
|
||||
@ -364,7 +364,7 @@ if (count($actions) == 1 && isset($actions[0])) {
|
||||
|
||||
foreach ($action['escalation'] as $k => $v) {
|
||||
if ($v > 0) {
|
||||
$table->data[$kaction][$k] = html_print_image('images/tick.png', true);
|
||||
$table->data[$kaction][$k] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
} else {
|
||||
$table->data[$kaction][$k] = html_print_image('images/blade.png', true);
|
||||
}
|
||||
|
@ -261,7 +261,10 @@ $table->data[1][2] .= html_print_select(
|
||||
);
|
||||
$table->data[1][3] = html_print_select([], 'module[]', '', false, '', '', true, true, false, '', false, 'width:180px;');
|
||||
|
||||
$templates = alerts_get_alert_templates(false, ['id', 'name']);
|
||||
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
|
||||
$filter_groups = '';
|
||||
$filter_groups = implode(',', array_keys($usr_groups));
|
||||
$templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
|
||||
$table->data[2][0] = __('Alert template');
|
||||
$table->data[2][1] = html_print_select(
|
||||
index_array($templates, 'id', 'name'),
|
||||
|
@ -252,7 +252,10 @@ $table->size[3] = '40%';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$templates = alerts_get_alert_templates(false, ['id', 'name']);
|
||||
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
|
||||
$filter_groups = '';
|
||||
$filter_groups = implode(',', array_keys($usr_groups));
|
||||
$templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
|
||||
$table->data[0][0] = __('Alert template');
|
||||
$table->data[0][1] = html_print_select(
|
||||
index_array($templates, 'id', 'name'),
|
||||
|
@ -73,7 +73,7 @@ if (! check_acl($config['id_user'], 0, 'RW')
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($edit_graph) {
|
||||
if ($edit_graph === true) {
|
||||
$graphInTgraph = db_get_row_sql(
|
||||
'SELECT * FROM tgraph WHERE id_graph = '.$id_graph
|
||||
);
|
||||
@ -113,18 +113,18 @@ if ($edit_graph) {
|
||||
// -----------------------
|
||||
// CREATE/EDIT GRAPH FORM
|
||||
// -----------------------
|
||||
$url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder';
|
||||
if ($edit_graph) {
|
||||
$output = "<form method='post' action='".$url.'&edit_graph=1&update_graph=1&id='.$id_graph."'>";
|
||||
$url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1';
|
||||
if ($edit_graph === true) {
|
||||
$output = "<form method='post' action='".$url.'&update_graph=1&id='.$id_graph."'>";
|
||||
} else {
|
||||
$output = "<form method='post' action='".$url."&edit_graph=1&add_graph=1'>";
|
||||
$output = "<form method='post' action='".$url."&add_graph=1'>";
|
||||
}
|
||||
|
||||
$output .= "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>";
|
||||
$output .= '<tr>';
|
||||
$output .= "<td class='datos'><b>".__('Name').'</b></td>';
|
||||
$output .= "<td class='datos'><input type='text' name='name' size='25' ";
|
||||
if ($edit_graph) {
|
||||
if ($edit_graph === true) {
|
||||
$output .= "value='".$graphInTgraph['name']."' ";
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ $output .= '</td></tr>';
|
||||
$output .= '<tr>';
|
||||
$output .= "<td class='datos2'><b>".__('Description').'</b></td>';
|
||||
$output .= "<td class='datos2' colspan=3><textarea name='description' class='height_45px' cols=55 rows=2>";
|
||||
if ($edit_graph) {
|
||||
if ($edit_graph === true) {
|
||||
$output .= $graphInTgraph['description'];
|
||||
}
|
||||
|
||||
@ -291,15 +291,30 @@ $output .= '</tr>';
|
||||
|
||||
$output .= '</table>';
|
||||
|
||||
if ($edit_graph) {
|
||||
$output .= "<div class='w100p'>";
|
||||
$output .= "<input type=submit name='store' class='sub upd right' value='".__('Update')."'>";
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
$output .= "<div class='w100p'>";
|
||||
$output .= "<input type=submit name='store' class='sub next right' value='".__('Create')."'>";
|
||||
$output .= '</div>';
|
||||
}
|
||||
$stringButton = ($edit_graph === true) ? __('Update') : __('Create');
|
||||
|
||||
$output .= html_print_div(
|
||||
[
|
||||
'class' => 'w100p',
|
||||
'content' => "<input type=submit name='store' class='sub next right databox' value='".$stringButton."'>",
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$output .= html_print_div(
|
||||
[
|
||||
'class' => 'w100p',
|
||||
'content' => html_print_button(
|
||||
__('Go back'),
|
||||
'go_back',
|
||||
false,
|
||||
'window.location.href = \'index.php?sec=reporting&sec2=godmode/reporting/graphs\'',
|
||||
'class="sub cancel right"',
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$output .= '</form>';
|
||||
|
||||
|
@ -109,7 +109,7 @@ if ($id_graph !== 0) {
|
||||
}
|
||||
|
||||
|
||||
if ($add_graph) {
|
||||
if ($add_graph === true) {
|
||||
$name = get_parameter_post('name');
|
||||
$description = get_parameter_post('description');
|
||||
$module_number = get_parameter_post('module_number');
|
||||
@ -178,7 +178,7 @@ if ($update_graph) {
|
||||
$stacked = $threshold;
|
||||
}
|
||||
|
||||
if (trim($name) != '') {
|
||||
if (empty(trim($name)) === false) {
|
||||
$success = db_process_sql_update(
|
||||
'tgraph',
|
||||
[
|
||||
@ -220,7 +220,7 @@ function add_quotes($item)
|
||||
}
|
||||
|
||||
|
||||
if ($add_module) {
|
||||
if ($add_module === true) {
|
||||
$id_graph = get_parameter('id');
|
||||
$id_modules = get_parameter('module');
|
||||
$id_agents = get_parameter('id_agents');
|
||||
@ -251,7 +251,7 @@ if ($add_module) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($delete_module) {
|
||||
if ($delete_module === true) {
|
||||
$id_graph = get_parameter('id');
|
||||
|
||||
$deleteGraph = get_parameter('delete');
|
||||
@ -260,7 +260,7 @@ if ($delete_module) {
|
||||
db_process_sql('UPDATE tgraph_source SET field_order=field_order-1 WHERE id_graph='.$id_graph.' AND field_order>'.$order_val);
|
||||
}
|
||||
|
||||
if ($change_weight) {
|
||||
if ($change_weight === true) {
|
||||
$weight = get_parameter('weight');
|
||||
$id_gs = get_parameter('graph');
|
||||
db_process_sql_update(
|
||||
@ -280,7 +280,7 @@ if ($change_label) {
|
||||
);
|
||||
}
|
||||
|
||||
if ($edit_graph) {
|
||||
if ($edit_graph === true) {
|
||||
$buttons = [
|
||||
'graph_list' => [
|
||||
'active' => false,
|
||||
@ -334,7 +334,7 @@ if ($edit_graph) {
|
||||
$graphInTgraph = db_get_row_sql('SELECT name FROM tgraph WHERE id_graph = '.$id_graph);
|
||||
$name = $graphInTgraph['name'];
|
||||
} else {
|
||||
$buttons = '';
|
||||
$buttons = [];
|
||||
}
|
||||
|
||||
$head = __('Graph builder');
|
||||
@ -410,12 +410,12 @@ if ($delete_module) {
|
||||
|
||||
// Parse CHUNK information into showable information.
|
||||
// Split id to get all parameters.
|
||||
if (!$delete_module) {
|
||||
if (isset($_POST['period'])) {
|
||||
if ($delete_module === false) {
|
||||
if (isset($_POST['period']) === true) {
|
||||
$period = $_POST['period'];
|
||||
}
|
||||
|
||||
if ((isset($chunkdata) ) && ($chunkdata != '')) {
|
||||
if ((isset($chunkdata) === true) && (empty($chunkdata) === false)) {
|
||||
$module_array = [];
|
||||
$weight_array = [];
|
||||
$agent_array = [];
|
||||
|
@ -62,6 +62,20 @@ $show_sort_options = [];
|
||||
$show_sort_options[1] = __('Ascending');
|
||||
$show_sort_options[2] = __('Descending');
|
||||
|
||||
// Agents inventory display options.
|
||||
$agents_inventory_display_options = [];
|
||||
$agents_inventory_display_options['alias'] = __('Alias');
|
||||
$agents_inventory_display_options['direccion'] = __('IP');
|
||||
$agents_inventory_display_options['id_os'] = __('OS');
|
||||
$agents_inventory_display_options['id_grupo'] = __('Group');
|
||||
$agents_inventory_display_options['secondary_groups'] = __('Secondary groups');
|
||||
$agents_inventory_display_options['comentarios'] = __('Description');
|
||||
$agents_inventory_display_options['url_address'] = __('URL');
|
||||
$agents_inventory_display_options['custom_fields'] = __('Custom fields');
|
||||
$agents_inventory_display_options['estado'] = __('Status');
|
||||
$agents_inventory_display_options['agent_version'] = __('Version');
|
||||
$agents_inventory_display_options['remote'] = __('Remote configuration');
|
||||
|
||||
enterprise_include('/godmode/reporting/reporting_builder.item_editor.php');
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
if (enterprise_include_once('include/functions_metaconsole.php')) {
|
||||
@ -725,6 +739,25 @@ switch ($action) {
|
||||
$idAgentModule = $module;
|
||||
break;
|
||||
|
||||
case 'agents_inventory':
|
||||
$description = $item['description'];
|
||||
$es = json_decode($item['external_source'], true);
|
||||
|
||||
$date = $es['date'];
|
||||
$selected_agent_server_filter = $es['agent_server_filter'];
|
||||
$selected_agent_group_filter = $es['agent_group_filter'];
|
||||
$selected_agents_inventory_display_options = $es['agents_inventory_display_options'];
|
||||
$selected_agent_os_filter = $es['agent_os_filter'];
|
||||
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
|
||||
$selected_agent_status_filter = $es['agent_status_filter'];
|
||||
$selected_agent_module_search_filter = $es['agent_module_search_filter'];
|
||||
$selected_agent_version_filter = $es['agent_version_filter'];
|
||||
$selected_agent_remote = $es['agent_remote_conf'];
|
||||
|
||||
$idAgent = $es['id_agents'];
|
||||
$idAgentModule = $inventory_modules;
|
||||
break;
|
||||
|
||||
case 'inventory':
|
||||
$description = $item['description'];
|
||||
$es = json_decode($item['external_source'], true);
|
||||
@ -3020,6 +3053,232 @@ $class = 'databox filters';
|
||||
<td><?php html_print_checkbox_switch('pagebreak', 1, $pagebreak); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_agents_inventory_display_options" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Display options');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
$agents_inventory_display_options,
|
||||
'agents_inventory_display_options[]',
|
||||
$selected_agents_inventory_display_options,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:200px'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$server_fields = [];
|
||||
$server_fields[0] = __('All');
|
||||
|
||||
$servers = metaconsole_get_servers();
|
||||
|
||||
foreach ($servers as $key => $server) {
|
||||
$server_fields[$key] = $server['server_name'];
|
||||
}
|
||||
|
||||
$server_filter_markup = '
|
||||
<tr id="row_agent_server_filter" class="datos">
|
||||
<td class="bolder">'.__('Server').'</td><td>'.html_print_select(
|
||||
$server_fields,
|
||||
'agent_server_filter',
|
||||
$selected_agent_server_filter,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'min-width: 180px'
|
||||
).'</td></tr>';
|
||||
|
||||
if (is_metaconsole()) {
|
||||
echo $server_filter_markup;
|
||||
}
|
||||
?>
|
||||
|
||||
<tr id="row_agent_group_filter" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Agent group filter');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select_groups(
|
||||
$config['id_user'],
|
||||
'RW',
|
||||
true,
|
||||
'agent_group_filter',
|
||||
$selected_agent_group_filter,
|
||||
''
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_os" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Agent OS filter');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($selected_agent_os_filter === null) {
|
||||
$selected_agent_os_filter = 0;
|
||||
}
|
||||
|
||||
html_print_select_from_sql(
|
||||
'SELECT id_os, name FROM tconfig_os',
|
||||
'agent_os_filter[]',
|
||||
$selected_agent_os_filter,
|
||||
'',
|
||||
__('All'),
|
||||
'0',
|
||||
false,
|
||||
true
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_custom_field" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Agent custom field filter');
|
||||
?>
|
||||
</td>
|
||||
<td >
|
||||
<?php
|
||||
echo html_print_input_text(
|
||||
'agent_custom_field_filter',
|
||||
$selected_agent_custom_field_filter,
|
||||
'',
|
||||
50,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'fullwidth'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_agent_status" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Agent status filter');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$fields = [];
|
||||
$fields[AGENT_STATUS_NORMAL] = __('Normal');
|
||||
$fields[AGENT_STATUS_WARNING] = __('Warning');
|
||||
$fields[AGENT_STATUS_CRITICAL] = __('Critical');
|
||||
$fields[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
||||
$fields[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$fields[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||
|
||||
if ($selected_agent_status_filter === null) {
|
||||
$selected_agent_status_filter = -1;
|
||||
}
|
||||
|
||||
html_print_select(
|
||||
$fields,
|
||||
'agent_status_filter[]',
|
||||
$selected_agent_status_filter,
|
||||
'',
|
||||
__('All'),
|
||||
'-1',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'min-width: 180px'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_agent_version" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Agent version filter');
|
||||
?>
|
||||
</td>
|
||||
<td >
|
||||
<?php
|
||||
echo html_print_input_text(
|
||||
'agent_version_filter',
|
||||
$selected_agent_version_filter,
|
||||
'',
|
||||
50,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'fullwidth'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_agent_remote_conf" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Agent has remote configuration').ui_print_help_tip(
|
||||
__('Filter agents by remote configuration enabled.'),
|
||||
true
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td><?php html_print_checkbox_switch('agent_remote_conf', 1, $selected_agent_remote); ?></td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_module_free_search" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Agent module filter');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo html_print_input_text(
|
||||
'agent_module_search_filter',
|
||||
$selected_agent_module_search_filter,
|
||||
'',
|
||||
50,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'fullwidth'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -5223,6 +5482,15 @@ function chooseType() {
|
||||
$("#row_users").hide();
|
||||
$("#row_profiles_group").hide();
|
||||
$("#row_select_by_group").hide();
|
||||
$("#row_agents_inventory_display_options").hide();
|
||||
$("#row_agent_server_filter").hide();
|
||||
$("#row_agent_group_filter").hide();
|
||||
$("#row_os").hide();
|
||||
$("#row_custom_field").hide();
|
||||
$("#row_agent_status").hide();
|
||||
$("#row_agent_version").hide();
|
||||
$("#row_agent_remote_conf").hide();
|
||||
$("#row_module_free_search").hide();
|
||||
|
||||
|
||||
// SLA list default state.
|
||||
@ -5764,6 +6032,20 @@ function chooseType() {
|
||||
|
||||
break;
|
||||
|
||||
case 'agents_inventory':
|
||||
$("#row_agents_inventory_display_options").show();
|
||||
$("#row_agent_server_filter").show();
|
||||
$("#row_agent_group_filter").show();
|
||||
$("#row_group").show();
|
||||
$("#row_os").show();
|
||||
$("#row_custom_field").show();
|
||||
$("#row_agent_status").show();
|
||||
$("#row_agent_version").show();
|
||||
$("#row_agent_remote_conf").show();
|
||||
$("#row_module_free_search").show();
|
||||
|
||||
break;
|
||||
|
||||
case 'inventory':
|
||||
$("#row_description").show();
|
||||
$("#row_group").show();
|
||||
|
@ -2107,6 +2107,20 @@ switch ($action) {
|
||||
$values['external_source'] = json_encode($es);
|
||||
break;
|
||||
|
||||
case 'agents_inventory':
|
||||
$es['agent_server_filter'] = get_parameter('agent_server_filter');
|
||||
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
|
||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||
$es['agent_os_filter'] = get_parameter('agent_os_filter');
|
||||
$es['agent_status_filter'] = get_parameter('agent_status_filter');
|
||||
$es['agent_version_filter'] = get_parameter('agent_version_filter');
|
||||
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
|
||||
$es['agent_group_filter'] = get_parameter('agent_group_filter');
|
||||
$es['agent_remote_conf'] = get_parameter('agent_remote_conf');
|
||||
|
||||
$values['external_source'] = json_encode($es);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
@ -2732,6 +2746,20 @@ switch ($action) {
|
||||
$values['external_source'] = json_encode($es);
|
||||
break;
|
||||
|
||||
case 'agents_inventory':
|
||||
$es['agent_server_filter'] = get_parameter('agent_server_filter');
|
||||
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
|
||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||
$es['agent_os_filter'] = get_parameter('agent_os_filter');
|
||||
$es['agent_status_filter'] = get_parameter('agent_status_filter');
|
||||
$es['agent_version_filter'] = get_parameter('agent_version_filter');
|
||||
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
|
||||
$es['agent_group_filter'] = get_parameter('agent_group_filter');
|
||||
$es['agent_remote_conf'] = get_parameter('agent_remote_conf');
|
||||
|
||||
$values['external_source'] = json_encode($es);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
|
@ -1,17 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Images File Manager
|
||||
*
|
||||
* @category File manager
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// 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.
|
||||
// Load global vars
|
||||
// Get global data.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
@ -24,33 +39,25 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
|
||||
require_once 'include/functions_filemanager.php';
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
ui_print_page_header(__('File manager'), '', false, '', true);
|
||||
|
||||
if (isset($config['filemanager']['message'])) {
|
||||
if (isset($config['filemanager']['message']) === true) {
|
||||
echo $config['filemanager']['message'];
|
||||
$config['filemanager']['message'] = null;
|
||||
}
|
||||
|
||||
$directory = (string) get_parameter('directory', '/');
|
||||
$directory = str_replace('\\', '/', $directory);
|
||||
|
||||
// A miminal security check to avoid directory traversal
|
||||
if (preg_match('/\.\./', $directory)) {
|
||||
$directory = (string) get_parameter('directory');
|
||||
if (empty($directory) === true) {
|
||||
$directory = 'images';
|
||||
} else {
|
||||
$directory = str_replace('\\', '/', $directory);
|
||||
$directory = filemanager_safe_directory($directory, 'images');
|
||||
}
|
||||
|
||||
if (preg_match('/^\//', $directory)) {
|
||||
$directory = 'images';
|
||||
}
|
||||
|
||||
if (preg_match('/^manager/', $directory)) {
|
||||
$directory = 'images';
|
||||
}
|
||||
|
||||
// Add custom directories here
|
||||
// Add custom directories here.
|
||||
$fallback_directory = 'images';
|
||||
|
||||
// Banned directories.
|
||||
$banned_directories['include'] = true;
|
||||
$banned_directories['godmode'] = true;
|
||||
$banned_directories['operation'] = true;
|
||||
@ -58,7 +65,7 @@ $banned_directories['reporting'] = true;
|
||||
$banned_directories['general'] = true;
|
||||
$banned_directories[ENTERPRISE_DIR] = true;
|
||||
|
||||
if (isset($banned_directories[$directory])) {
|
||||
if (isset($banned_directories[$directory]) === true) {
|
||||
$directory = $fallback_directory;
|
||||
}
|
||||
|
||||
@ -71,11 +78,11 @@ $create_text_file = (bool) get_parameter('create_text_file');
|
||||
|
||||
$default_real_directory = realpath($config['homedir'].'/'.$fallback_directory);
|
||||
|
||||
if ($upload_file_or_zip) {
|
||||
if ($upload_file_or_zip === true) {
|
||||
upload_file($upload_file_or_zip, $default_real_directory);
|
||||
}
|
||||
|
||||
if ($create_text_file) {
|
||||
if ($create_text_file === true) {
|
||||
create_text_file($default_real_directory);
|
||||
}
|
||||
|
||||
|
@ -1075,7 +1075,7 @@ class CredentialStore extends Wizard
|
||||
|
||||
item.options = '<a href="javascript:" onclick="show_form(\'';
|
||||
item.options += id;
|
||||
item.options += '\')" ><?php echo html_print_image('images/operation.png', true, ['title' => __('Show')]); ?></a>';
|
||||
item.options += '\')" ><?php echo html_print_image('images/operation.png', true, ['title' => __('Show'), 'class' => 'invert_filter']); ?></a>';
|
||||
|
||||
item.options += '<a href="javascript:" onclick="delete_key(\'';
|
||||
item.options += id;
|
||||
|
@ -221,6 +221,8 @@ class ExternalTools extends HTML
|
||||
'style' => 'vertical-align: middle;',
|
||||
'width' => '16',
|
||||
'title' => __('Play sound'),
|
||||
'class' => 'invert_filter',
|
||||
|
||||
]
|
||||
),
|
||||
],
|
||||
@ -249,6 +251,8 @@ class ExternalTools extends HTML
|
||||
'style' => 'vertical-align: middle;',
|
||||
'width' => '16',
|
||||
'title' => __('Play sound'),
|
||||
'class' => 'invert_filter',
|
||||
|
||||
]
|
||||
),
|
||||
],
|
||||
@ -277,6 +281,8 @@ class ExternalTools extends HTML
|
||||
'style' => 'vertical-align: middle;',
|
||||
'width' => '16',
|
||||
'title' => __('Play sound'),
|
||||
'class' => 'invert_filter',
|
||||
|
||||
]
|
||||
),
|
||||
],
|
||||
@ -326,6 +332,8 @@ class ExternalTools extends HTML
|
||||
'title' => __('Add new custom command'),
|
||||
'onclick' => 'manageCommandLines(event)',
|
||||
'id' => 'img_add_button_custom_command',
|
||||
'class' => 'invert_filter',
|
||||
|
||||
]
|
||||
),
|
||||
],
|
||||
@ -420,6 +428,7 @@ class ExternalTools extends HTML
|
||||
'title' => __('Delete this custom command'),
|
||||
'onclick' => 'manageCommandLines(event)',
|
||||
'id' => 'img_delete_button_custom_'.$index,
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
),
|
||||
],
|
||||
|
@ -743,7 +743,8 @@ class ManageNetScanScripts extends Wizard
|
||||
$datam[2] .= '<a href="javascript:delete_macro_form(\'table-form-recon_\');update_preview();">';
|
||||
$datam[2] .= html_print_image(
|
||||
'images/delete.png',
|
||||
true
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
);
|
||||
$datam[2] .= '</a></div>';
|
||||
|
||||
|
@ -2984,7 +2984,7 @@ class NetworkMap
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'class="sub"',
|
||||
'class="sub next"',
|
||||
true
|
||||
);
|
||||
|
||||
@ -3013,7 +3013,7 @@ class NetworkMap
|
||||
'',
|
||||
false,
|
||||
'add_fictional_node();',
|
||||
'class="sub"',
|
||||
'class="sub next"',
|
||||
true
|
||||
);
|
||||
|
||||
@ -3065,9 +3065,9 @@ class NetworkMap
|
||||
$table->data['template_row']['node_target'] = '';
|
||||
$table->data['template_row']['edit'] = '';
|
||||
|
||||
$table->data['template_row']['edit'] .= '<span class="edit_icon_correct" style="display: none">'.html_print_image('images/dot_green.png', true).'</span><span class="edit_icon_fail" style="display: none" >'.html_print_image('images/dot_red.png', true).'</span><span class="edit_icon_progress" style="display: none">'.html_print_image('images/spinner.gif', true).'</span><span class="edit_icon"><a class="edit_icon_link" title="'.__('Update').'" href="#">'.html_print_image('images/config.png', true).'</a></span>';
|
||||
$table->data['template_row']['edit'] .= '<span class="edit_icon_correct" style="display: none">'.html_print_image('images/dot_green.png', true).'</span><span class="edit_icon_fail" style="display: none" >'.html_print_image('images/dot_red.png', true).'</span><span class="edit_icon_progress" style="display: none">'.html_print_image('images/spinner.gif', true).'</span><span class="edit_icon"><a class="edit_icon_link" title="'.__('Update').'" href="#">'.html_print_image('images/config.png', true, ['class' => 'invert_filter']).'</a></span>';
|
||||
|
||||
$table->data['template_row']['edit'] .= '<a class="delete_icon" href="#">'.html_print_image('images/delete.png', true).'</a>';
|
||||
$table->data['template_row']['edit'] .= '<a class="delete_icon" href="#">'.html_print_image('images/delete.png', true, ['class' => 'invert_filter']).'</a>';
|
||||
|
||||
$table->colspan['no_relations']['0'] = 5;
|
||||
$table->cellstyle['no_relations']['0'] = 'text-align: center;';
|
||||
|
@ -397,7 +397,7 @@ class OrderInterpreter extends Wizard
|
||||
if ($iterator <= 9 && $this->canShowItem($enterprise, $this->pages_menu[$key]['url'])) {
|
||||
echo '<li class="list_found" name="'.$iterator.'" id="'.$iterator.'">';
|
||||
echo '
|
||||
Go to
|
||||
<span class="invert_filter"> Go to </span>
|
||||
<img src="'.$this->pages_menu[$key]['icon'].'">';
|
||||
echo '
|
||||
<a href="'.$this->pages_menu[$key]['url'].'">
|
||||
@ -419,12 +419,12 @@ class OrderInterpreter extends Wizard
|
||||
echo $this->loadJS();
|
||||
echo '</ul>';
|
||||
if ($iterator > 10) {
|
||||
echo '<div class="more_results">
|
||||
+ '.$more_results.' '.__('results found').'</div>';
|
||||
echo '<div class="more_results"><span class="invert_filter">
|
||||
+ '.$more_results.' '.__('results found').'</span></div>';
|
||||
}
|
||||
|
||||
if ($iterator === 0) {
|
||||
echo __('Press enter to search');
|
||||
echo '<span class="invert_filter">'.__('Press enter to search').'</span>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC210603';
|
||||
$build_version = 'PC210604';
|
||||
$pandora_version = 'v7.0NG.754';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -1,36 +1,40 @@
|
||||
<?php
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// 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 Lesser General Public License
|
||||
// as published by the Free Software Foundation; 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.
|
||||
|
||||
/**
|
||||
* @package Include
|
||||
* @subpackage Filemanager
|
||||
* Images File Manager functions.
|
||||
*
|
||||
* @category Functions
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* #@+
|
||||
* Constants
|
||||
*/
|
||||
// Get global data.
|
||||
// Constants.
|
||||
define('MIME_UNKNOWN', 0);
|
||||
define('MIME_DIR', 1);
|
||||
define('MIME_IMAGE', 2);
|
||||
define('MIME_ZIP', 3);
|
||||
define('MIME_TEXT', 4);
|
||||
/*
|
||||
#@-
|
||||
*/
|
||||
|
||||
if (!function_exists('mime_content_type')) {
|
||||
if (function_exists('mime_content_type') === false) {
|
||||
|
||||
|
||||
/**
|
||||
@ -38,11 +42,11 @@ if (!function_exists('mime_content_type')) {
|
||||
*
|
||||
* Help function in case mime_magic is not loaded on PHP.
|
||||
*
|
||||
* @param string Filename to get MIME type.
|
||||
* @param string $filename Filename to get MIME type.
|
||||
*
|
||||
* @return The MIME type of the file.
|
||||
*/
|
||||
function mime_content_type($filename)
|
||||
function mime_content_type(string $filename)
|
||||
{
|
||||
$mime_types = [
|
||||
'txt' => 'text/plain',
|
||||
@ -55,7 +59,7 @@ if (!function_exists('mime_content_type')) {
|
||||
'xml' => 'application/xml',
|
||||
'swf' => 'application/x-shockwave-flash',
|
||||
'flv' => 'video/x-flv',
|
||||
// images
|
||||
// Images.
|
||||
'png' => 'image/png',
|
||||
'jpe' => 'image/jpeg',
|
||||
'jpeg' => 'image/jpeg',
|
||||
@ -67,7 +71,7 @@ if (!function_exists('mime_content_type')) {
|
||||
'tif' => 'image/tiff',
|
||||
'svg' => 'image/svg+xml',
|
||||
'svgz' => 'image/svg+xml',
|
||||
// archives
|
||||
// Archives.
|
||||
'zip' => 'application/zip',
|
||||
'rar' => 'application/x-rar-compressed',
|
||||
'exe' => 'application/x-msdownload',
|
||||
@ -75,22 +79,22 @@ if (!function_exists('mime_content_type')) {
|
||||
'cab' => 'application/vnd.ms-cab-compressed',
|
||||
'gz' => 'application/x-gzip',
|
||||
'gz' => 'application/x-bzip2',
|
||||
// audio/video
|
||||
// Audio/Video.
|
||||
'mp3' => 'audio/mpeg',
|
||||
'qt' => 'video/quicktime',
|
||||
'mov' => 'video/quicktime',
|
||||
// adobe
|
||||
// Adobe.
|
||||
'pdf' => 'application/pdf',
|
||||
'psd' => 'image/vnd.adobe.photoshop',
|
||||
'ai' => 'application/postscript',
|
||||
'eps' => 'application/postscript',
|
||||
'ps' => 'application/postscript',
|
||||
// ms office
|
||||
// MS Office.
|
||||
'doc' => 'application/msword',
|
||||
'rtf' => 'application/rtf',
|
||||
'xls' => 'application/vnd.ms-excel',
|
||||
'ppt' => 'application/vnd.ms-powerpoint',
|
||||
// open office
|
||||
// Open Source Office files.
|
||||
'odt' => 'application/vnd.oasis.opendocument.text',
|
||||
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
|
||||
];
|
||||
@ -98,9 +102,9 @@ if (!function_exists('mime_content_type')) {
|
||||
$ext_fields = explode('.', $filename);
|
||||
$ext = array_pop($ext_fields);
|
||||
$ext = strtolower($ext);
|
||||
if (array_key_exists($ext, $mime_types)) {
|
||||
if (array_key_exists($ext, $mime_types) === true) {
|
||||
return $mime_types[$ext];
|
||||
} else if (function_exists('finfo_open')) {
|
||||
} else if (function_exists('finfo_open') === true) {
|
||||
$finfo = finfo_open(FILEINFO_MIME);
|
||||
$mimetype = finfo_file($finfo, $filename);
|
||||
finfo_close($finfo);
|
||||
@ -117,6 +121,14 @@ if (!function_exists('mime_content_type')) {
|
||||
global $config;
|
||||
|
||||
|
||||
/**
|
||||
* Upload file.
|
||||
*
|
||||
* @param boolean $upload_file_or_zip Upload file or zip.
|
||||
* @param string $default_real_directory String with default directory.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function upload_file($upload_file_or_zip, $default_real_directory)
|
||||
{
|
||||
global $config;
|
||||
@ -124,7 +136,7 @@ function upload_file($upload_file_or_zip, $default_real_directory)
|
||||
$homedir_filemanager = trim($config['homedir']);
|
||||
$sec2 = get_parameter('sec2');
|
||||
|
||||
if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') {
|
||||
if ($sec2 === 'enterprise/godmode/agentes/collections' || $sec2 === 'advanced/collections') {
|
||||
$homedir_filemanager .= '/attachment/collection/';
|
||||
}
|
||||
|
||||
@ -140,9 +152,9 @@ function upload_file($upload_file_or_zip, $default_real_directory)
|
||||
return;
|
||||
}
|
||||
|
||||
if ($upload_file_or_zip) {
|
||||
$decompress = get_parameter('decompress');
|
||||
if (!$decompress) {
|
||||
if ($upload_file_or_zip === true) {
|
||||
$decompress = (bool) get_parameter('decompress', false);
|
||||
if ($decompress === false) {
|
||||
$upload_file = true;
|
||||
$upload_zip = false;
|
||||
} else {
|
||||
@ -154,21 +166,21 @@ function upload_file($upload_file_or_zip, $default_real_directory)
|
||||
$upload_zip = (bool) get_parameter('upload_zip');
|
||||
}
|
||||
|
||||
// Upload file
|
||||
if ($upload_file) {
|
||||
if (isset($_FILES['file']) && $_FILES['file']['name'] != '') {
|
||||
// Upload file.
|
||||
if ($upload_file === true) {
|
||||
if (isset($_FILES['file']) === true && empty($_FILES['file']['name']) === false) {
|
||||
$filename = $_FILES['file']['name'];
|
||||
$filesize = $_FILES['file']['size'];
|
||||
$real_directory = io_safe_output((string) get_parameter('real_directory'));
|
||||
$directory = io_safe_output((string) get_parameter('directory'));
|
||||
$umask = io_safe_output((string) get_parameter('umask', ''));
|
||||
$real_directory = filemanager_safe_directory((string) get_parameter('real_directory'));
|
||||
$directory = filemanager_safe_directory((string) get_parameter('directory'));
|
||||
$umask = io_safe_output((string) get_parameter('umask'));
|
||||
|
||||
if (strpos($real_directory, $default_real_directory) !== 0) {
|
||||
// Perform security check to determine whether received upload directory is part of the default path for caller uploader and user is not trying to access an external path (avoid execution of PHP files in directories that are not explicitly controlled by corresponding .htaccess).
|
||||
ui_print_error_message(__('Security error'));
|
||||
} else {
|
||||
// Copy file to directory and change name
|
||||
if ($directory == '') {
|
||||
// Copy file to directory and change name.
|
||||
if (empty($directory) === true) {
|
||||
$nombre_archivo = $real_directory.'/'.$filename;
|
||||
} else {
|
||||
$nombre_archivo = $homedir_filemanager.'/'.$directory.'/'.$filename;
|
||||
@ -177,36 +189,34 @@ function upload_file($upload_file_or_zip, $default_real_directory)
|
||||
if (! @copy($_FILES['file']['tmp_name'], $nombre_archivo)) {
|
||||
$config['filemanager']['message'] = ui_print_error_message(__('Upload error'));
|
||||
} else {
|
||||
if ($umask !== '') {
|
||||
if (empty($umask) === false) {
|
||||
chmod($nombre_archivo, $umask);
|
||||
}
|
||||
|
||||
$config['filemanager']['correct_upload_file'] = 1;
|
||||
ui_print_success_message(__('Upload correct'));
|
||||
|
||||
// Delete temporal file
|
||||
// Delete temporal file.
|
||||
unlink($_FILES['file']['tmp_name']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Upload zip
|
||||
if ($upload_zip) {
|
||||
if (isset($_FILES['file']) && $_FILES['file']['name'] != '') {
|
||||
// Upload zip.
|
||||
if ($upload_zip === true) {
|
||||
if (isset($_FILES['file']) === true && empty($_FILES['file']['name']) === false) {
|
||||
$filename = $_FILES['file']['name'];
|
||||
$filesize = $_FILES['file']['size'];
|
||||
$real_directory = (string) get_parameter('real_directory');
|
||||
$real_directory = io_safe_output($real_directory);
|
||||
$directory = (string) get_parameter('directory');
|
||||
$directory = io_safe_output($directory);
|
||||
$real_directory = filemanager_safe_directory((string) get_parameter('real_directory'));
|
||||
$directory = filemanager_safe_directory((string) get_parameter('directory'));
|
||||
|
||||
if (strpos($real_directory, $default_real_directory) !== 0) {
|
||||
// Perform security check to determine whether received upload directory is part of the default path for caller uploader and user is not trying to access an external path (avoid execution of PHP files in directories that are not explicitly controlled by corresponding .htaccess).
|
||||
ui_print_error_message(__('Security error'));
|
||||
} else {
|
||||
// Copy file to directory and change name
|
||||
if ($directory == '') {
|
||||
// Copy file to directory and change name.
|
||||
if (empty($directory) === true) {
|
||||
$nombre_archivo = $real_directory.'/'.$filename;
|
||||
} else {
|
||||
$nombre_archivo = $homedir_filemanager.'/'.$directory.'/'.$filename;
|
||||
@ -215,10 +225,10 @@ function upload_file($upload_file_or_zip, $default_real_directory)
|
||||
if (! @copy($_FILES['file']['tmp_name'], $nombre_archivo)) {
|
||||
ui_print_error_message(__('Attach error'));
|
||||
} else {
|
||||
// Delete temporal file
|
||||
// Delete temporal file.
|
||||
unlink($_FILES['file']['tmp_name']);
|
||||
|
||||
// Extract the zip file
|
||||
// Extract the zip file.
|
||||
$zip = new ZipArchive;
|
||||
$pathname = $homedir_filemanager.'/'.$directory.'/';
|
||||
|
||||
@ -236,9 +246,9 @@ function upload_file($upload_file_or_zip, $default_real_directory)
|
||||
}
|
||||
|
||||
|
||||
if (isset($_SERVER['CONTENT_LENGTH'])) {
|
||||
// Control the max_post_size exceed
|
||||
if (intval($_SERVER['CONTENT_LENGTH']) > 0 && empty($_POST) and empty($_FILES)) {
|
||||
if (isset($_SERVER['CONTENT_LENGTH']) === true) {
|
||||
// Control the max_post_size exceed.
|
||||
if (intval($_SERVER['CONTENT_LENGTH']) > 0 && empty($_POST) === true && empty($_FILES) === true) {
|
||||
$config['filemanager']['correct_upload_file'] = 0;
|
||||
$config['filemanager']['message'] = ui_print_error_message(__('File size seems to be too large. Please check your php.ini configuration or contact with the administrator'), '', true);
|
||||
}
|
||||
@ -270,18 +280,16 @@ function create_text_file($default_real_directory)
|
||||
|
||||
$filename = io_safe_output(get_parameter('name_file'));
|
||||
|
||||
if ($filename != '') {
|
||||
$real_directory = (string) get_parameter('real_directory');
|
||||
$real_directory = io_safe_output($real_directory);
|
||||
$directory = (string) get_parameter('directory');
|
||||
$directory = io_safe_output($directory);
|
||||
$umask = (string) get_parameter('umask', '');
|
||||
if (empty($filename) === false) {
|
||||
$real_directory = filemanager_safe_directory((string) get_parameter('real_directory'));
|
||||
$directory = filemanager_safe_directory((string) get_parameter('directory'));
|
||||
$umask = (string) get_parameter('umask');
|
||||
|
||||
if (strpos($real_directory, $default_real_directory) !== 0) {
|
||||
// Perform security check to determine whether received upload directory is part of the default path for caller uploader and user is not trying to access an external path (avoid execution of PHP files in directories that are not explicitly controlled by corresponding .htaccess).
|
||||
ui_print_error_message(__('Security error'));
|
||||
} else {
|
||||
if ($directory == '') {
|
||||
if (empty($directory) === true) {
|
||||
$nombre_archivo = $real_directory.'/'.$filename;
|
||||
} else {
|
||||
$nombre_archivo = $homedir_filemanager.'/'.$directory.'/'.$filename;
|
||||
@ -307,31 +315,30 @@ function create_text_file($default_real_directory)
|
||||
|
||||
$homedir_filemanager = trim($config['homedir']);
|
||||
$sec2 = get_parameter('sec2');
|
||||
if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') {
|
||||
if ($sec2 === 'enterprise/godmode/agentes/collections' || $sec2 === 'advanced/collections') {
|
||||
$homedir_filemanager .= '/attachment/collection/';
|
||||
}
|
||||
|
||||
// CREATE DIR
|
||||
// CREATE DIR.
|
||||
$create_dir = (bool) get_parameter('create_dir');
|
||||
if ($create_dir) {
|
||||
if ($create_dir === true) {
|
||||
global $config;
|
||||
|
||||
$config['filemanager'] = [];
|
||||
$config['filemanager']['correct_create_dir'] = 0;
|
||||
$config['filemanager']['message'] = null;
|
||||
|
||||
$directory = (string) get_parameter('directory', '/');
|
||||
$directory = io_safe_output($directory);
|
||||
$hash = get_parameter('hash', '');
|
||||
$directory = filemanager_safe_directory((string) get_parameter('directory', '/'));
|
||||
$hash = (string) get_parameter('hash');
|
||||
$testHash = md5($directory.$config['dbpass']);
|
||||
|
||||
if ($hash != $testHash) {
|
||||
if ($hash !== $testHash) {
|
||||
ui_print_error_message(__('Security error.'));
|
||||
} else {
|
||||
$dirname = (string) get_parameter('dirname');
|
||||
$dirname = io_safe_output($dirname);
|
||||
$dirname = filemanager_safe_directory((string) get_parameter('dirname'));
|
||||
|
||||
if ($dirname != '') {
|
||||
if (empty($dirname) === false) {
|
||||
// Create directory.
|
||||
@mkdir(
|
||||
$homedir_filemanager.'/'.$directory.'/'.$dirname
|
||||
);
|
||||
@ -344,9 +351,9 @@ if ($create_dir) {
|
||||
}
|
||||
}
|
||||
|
||||
// DELETE FILE OR DIR
|
||||
// DELETE FILE OR DIR.
|
||||
$delete_file = (bool) get_parameter('delete_file');
|
||||
if ($delete_file) {
|
||||
if ($delete_file === true) {
|
||||
global $config;
|
||||
|
||||
$config['filemanager'] = [];
|
||||
@ -358,19 +365,19 @@ if ($delete_file) {
|
||||
$hash = get_parameter('hash', '');
|
||||
$testHash = md5($filename.$config['dbpass']);
|
||||
|
||||
if ($hash != $testHash) {
|
||||
if ($hash !== $testHash) {
|
||||
$config['filemanager']['message'] = ui_print_error_message(__('Security error'), '', true);
|
||||
} else {
|
||||
$config['filemanager']['message'] = ui_print_success_message(__('Deleted'), '', true);
|
||||
|
||||
if (is_dir($filename)) {
|
||||
if (rmdir($filename)) {
|
||||
if (is_dir($filename) === true) {
|
||||
if (rmdir($filename) === true) {
|
||||
$config['filemanager']['delete'] = 1;
|
||||
} else {
|
||||
$config['filemanager']['delete'] = 0;
|
||||
}
|
||||
} else {
|
||||
if (unlink($filename)) {
|
||||
if (unlink($filename) === true) {
|
||||
$config['filemanager']['delete'] = 1;
|
||||
} else {
|
||||
$config['filemanager']['delete'] = 0;
|
||||
@ -637,7 +644,7 @@ function filemanager_file_explorer(
|
||||
}
|
||||
|
||||
if (($prev_dir_str != '') && ($father != $relative_directory)) {
|
||||
$table->data[0][0] = html_print_image('images/go_previous.png', true);
|
||||
$table->data[0][0] = html_print_image('images/go_previous.png', true, ['class' => 'invert_filter']);
|
||||
$table->data[0][1] = '<a href="'.$url.'&directory='.$prev_dir_str.'&hash2='.md5($prev_dir_str.$config['dbpass']).'">';
|
||||
$table->data[0][1] .= __('Parent directory');
|
||||
$table->data[0][1] .= '</a>';
|
||||
@ -653,26 +660,26 @@ function filemanager_file_explorer(
|
||||
|
||||
switch ($fileinfo['mime']) {
|
||||
case MIME_DIR:
|
||||
$data[0] = html_print_image('images/mimetypes/directory.png', true, ['title' => __('Directory')]);
|
||||
$data[0] = html_print_image('images/mimetypes/directory.png', true, ['title' => __('Directory'), 'class' => 'invert_filter']);
|
||||
break;
|
||||
|
||||
case MIME_IMAGE:
|
||||
$data[0] = html_print_image('images/mimetypes/image.png', true, ['title' => __('Image')]);
|
||||
$data[0] = html_print_image('images/mimetypes/image.png', true, ['title' => __('Image'), 'class' => 'invert_filter']);
|
||||
break;
|
||||
|
||||
case MIME_ZIP:
|
||||
$data[0] = html_print_image('images/mimetypes/zip.png', true, ['title' => __('Compressed file')]);
|
||||
$data[0] = html_print_image('images/mimetypes/zip.png', true, ['title' => __('Compressed file'), 'class' => 'invert_filter']);
|
||||
break;
|
||||
|
||||
case MIME_TEXT:
|
||||
$data[0] = html_print_image('images/mimetypes/text.png', true, ['title' => __('Text file')]);
|
||||
$data[0] = html_print_image('images/mimetypes/text.png', true, ['title' => __('Text file'), 'class' => 'invert_filter']);
|
||||
break;
|
||||
|
||||
case MIME_UNKNOWN:
|
||||
if ($fileinfo['size'] == 0) {
|
||||
if ((strstr($fileinfo['name'], '.txt') !== false) || (strstr($fileinfo['name'], '.conf') !== false) || (strstr($fileinfo['name'], '.sql') !== false) || (strstr($fileinfo['name'], '.pl') !== false)) {
|
||||
$fileinfo['mime'] = MIME_TEXT;
|
||||
$data[0] = html_print_image('images/mimetypes/text.png', true, ['title' => __('Text file')]);
|
||||
$data[0] = html_print_image('images/mimetypes/text.png', true, ['title' => __('Text file'), 'class' => 'invert_filter']);
|
||||
} else {
|
||||
// unknow
|
||||
$data[0] = '';
|
||||
@ -684,7 +691,7 @@ function filemanager_file_explorer(
|
||||
break;
|
||||
|
||||
default:
|
||||
$data[0] = html_print_image('images/mimetypes/unknown.png', true, ['title' => __('Unknown')]);
|
||||
$data[0] = html_print_image('images/mimetypes/unknown.png', true, ['title' => __('Unknown'), 'class' => 'invert_filter']);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -752,7 +759,7 @@ function filemanager_file_explorer(
|
||||
&& ($typefile != 'iso') && ($typefile != 'docx') && ($typefile != 'doc') && ($fileinfo['mime'] != MIME_DIR)
|
||||
) {
|
||||
$hash = md5($fileinfo['realpath'].$config['dbpass']);
|
||||
$data[4] .= "<a style='vertical-align: top;' href='$url&edit_file=1&hash=".$hash.'&location_file='.$fileinfo['realpath']."' style='float: left;'>".html_print_image('images/edit.png', true, ['style' => 'margin-top: 2px;', 'title' => __('Edit file')]).'</a>';
|
||||
$data[4] .= "<a style='vertical-align: top;' href='$url&edit_file=1&hash=".$hash.'&location_file='.$fileinfo['realpath']."' style='float: left;'>".html_print_image('images/edit.png', true, ['style' => 'margin-top: 2px;', 'title' => __('Edit file'), 'class' => 'invert_filter']).'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -761,7 +768,7 @@ function filemanager_file_explorer(
|
||||
$filename = base64_encode($fileinfo['name']);
|
||||
$hash = md5($filename.$config['dbpass']);
|
||||
$data[4] .= '<a href="include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'" style="vertical-align: 25%;">';
|
||||
$data[4] .= html_print_image('images/file.png', true);
|
||||
$data[4] .= html_print_image('images/file.png', true, ['class' => 'invert_filter']);
|
||||
$data[4] .= '</a>';
|
||||
}
|
||||
|
||||
@ -863,7 +870,7 @@ function filemanager_file_explorer(
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo "<div style='text-align: right; width: ".$table->width."; color:#AC4444; margin-bottom:10px;'>";
|
||||
echo "<image src='images/info.png' />".__('The directory is read-only');
|
||||
echo "<image class='invert_filter' src='images/info.png' />".__('The directory is read-only');
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
@ -956,3 +963,37 @@ function filemanager_list_dir($dirpath)
|
||||
|
||||
return array_merge($dirs, $files);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A miminal security check to avoid directory traversal.
|
||||
*
|
||||
* @param string $directory String with the complete directory.
|
||||
* @param string $safedDirectory String with a safe name directory.
|
||||
*
|
||||
* @return string Safe directory
|
||||
*/
|
||||
function filemanager_safe_directory(
|
||||
string $directory,
|
||||
string $safedDirectory=''
|
||||
) {
|
||||
// Safe output.
|
||||
$directory = io_safe_output($directory);
|
||||
$forbiddenAttempting = false;
|
||||
|
||||
if ((bool) preg_match('/(\.){1,2}/', $directory) !== false) {
|
||||
$directory = preg_replace('/(\.){1,2}/', '', (empty($safedDirectory) === true) ? $directory : $safedDirectory);
|
||||
$forbiddenAttempting = true;
|
||||
}
|
||||
|
||||
if ((bool) preg_match('/(/\/\)+/', $directory) !== false) {
|
||||
$directory = preg_replace('/(/\/\)+/', '/', (empty($safedDirectory) === true) ? $directory : $safedDirectory);
|
||||
$forbiddenAttempting = true;
|
||||
}
|
||||
|
||||
if ($forbiddenAttempting === true) {
|
||||
db_pandora_audit('File manager', 'Attempting to use a forbidden file or directory name');
|
||||
}
|
||||
|
||||
return $directory;
|
||||
}
|
@ -2406,12 +2406,14 @@ function modules_get_agentmodule_data(
|
||||
$module_name = modules_get_agentmodule_name($id_agent_module);
|
||||
$agent_id = modules_get_agentmodule_agent($id_agent_module);
|
||||
$agent_name = modules_get_agentmodule_agent_name($id_agent_module);
|
||||
$agent_alias = modules_get_agentmodule_agent_alias($id_agent_module);
|
||||
$module_type = modules_get_agentmodule_type($id_agent_module);
|
||||
|
||||
foreach ($values as $key => $data) {
|
||||
$values[$key]['module_name'] = $module_name;
|
||||
$values[$key]['agent_id'] = $agent_id;
|
||||
$values[$key]['agent_name'] = $agent_name;
|
||||
$values[$key]['agent_alias'] = $agent_alias;
|
||||
$values[$key]['module_type'] = $module_type;
|
||||
}
|
||||
|
||||
@ -2429,6 +2431,7 @@ function modules_get_agentmodule_data(
|
||||
'module_name' => $values[$key]['module_name'],
|
||||
'agent_id' => $values[$key]['agent_id'],
|
||||
'agent_name' => $values[$key]['agent_name'],
|
||||
'agent_alias' => $values[$key]['agent_alias'],
|
||||
'module_type' => $values[$key]['module_type'],
|
||||
];
|
||||
}
|
||||
|
@ -734,6 +734,13 @@ function reporting_make_reporting_data(
|
||||
);
|
||||
break;
|
||||
|
||||
case 'agents_inventory':
|
||||
$report['contents'][] = reporting_agents_inventory(
|
||||
$report,
|
||||
$content
|
||||
);
|
||||
break;
|
||||
|
||||
case 'inventory':
|
||||
$report['contents'][] = reporting_inventory(
|
||||
$report,
|
||||
@ -2253,6 +2260,184 @@ function reporting_event_report_module(
|
||||
}
|
||||
|
||||
|
||||
function reporting_agents_inventory($report, $content)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$return['name'] = $content['name'];
|
||||
$return['type'] = 'agents_inventory';
|
||||
$return['title'] = $content['name'];
|
||||
$return['landscape'] = $content['landscape'];
|
||||
$return['pagebreak'] = $content['pagebreak'];
|
||||
$return['description'] = $content['description'];
|
||||
$return['date'] = reporting_get_date_text($report, $content);
|
||||
|
||||
$external_source = io_safe_input(json_decode($content['external_source'], true));
|
||||
$es_agents_inventory_display_options = $external_source['agents_inventory_display_options'];
|
||||
$es_custom_fields = $external_source['agent_custom_field_filter'];
|
||||
$es_os_filter = $external_source['agent_os_filter'];
|
||||
$es_agent_status_filter = $external_source['agent_status_filter'];
|
||||
$es_agent_version_filter = $external_source['agent_version_filter'];
|
||||
$es_agent_module_search_filter = $external_source['agent_module_search_filter'];
|
||||
$es_agent_group_filter = $external_source['agent_group_filter'];
|
||||
$es_agent_server_filter = $external_source['agent_server_filter'];
|
||||
$es_users_groups = $external_source['users_groups'];
|
||||
$es_agent_remote_conf = $external_source['agent_remote_conf'];
|
||||
|
||||
if ($es_agents_inventory_display_options === '') {
|
||||
$es_agents_inventory_display_options = [];
|
||||
}
|
||||
|
||||
$search_sql = '';
|
||||
|
||||
if ($es_custom_fields != '') {
|
||||
$search_sql .= ' AND id_os = '.$es_custom_fields;
|
||||
}
|
||||
|
||||
if (in_array('0', $es_os_filter) === false) {
|
||||
$search_sql .= ' AND id_os IN ('.implode(',', $es_os_filter).')';
|
||||
}
|
||||
|
||||
if ($es_agent_version_filter != '') {
|
||||
$search_sql .= ' AND tagente.agent_version LIKE "%'.$es_agent_version_filter.'%"';
|
||||
}
|
||||
|
||||
if ($es_agent_module_search_filter != '') {
|
||||
$search_sql .= ' AND tam.nombre LIKE "%'.$es_agent_module_search_filter.'%"';
|
||||
}
|
||||
|
||||
if ($es_agent_group_filter != 0) {
|
||||
$search_sql .= ' AND (tagente.id_grupo = '.$es_agent_group_filter.' OR tasg.id_group = '.$es_agent_group_filter.')';
|
||||
}
|
||||
|
||||
if ($es_agent_remote_conf != 0) {
|
||||
$search_sql .= ' AND tagente.remote = '.$es_agent_remote_conf;
|
||||
}
|
||||
|
||||
$user_groups_to_sql = implode(',', array_keys(users_get_groups()));
|
||||
|
||||
$sql = sprintf(
|
||||
'SELECT DISTINCT(tagente.id_agente) AS id_agente,
|
||||
tagente.id_os,
|
||||
tagente.direccion,
|
||||
tagente.agent_version,
|
||||
tagente.alias,
|
||||
tagente.id_grupo,
|
||||
tagente.comentarios,
|
||||
tagente.url_address,
|
||||
tagente.remote
|
||||
FROM tagente LEFT JOIN tagent_secondary_group tasg
|
||||
ON tagente.id_agente = tasg.id_agent
|
||||
LEFT JOIN tagente_modulo tam
|
||||
ON tam.id_agente = tagente.id_agente
|
||||
WHERE (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s))
|
||||
%s',
|
||||
$user_groups_to_sql,
|
||||
$user_groups_to_sql,
|
||||
$search_sql
|
||||
);
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$servers_ids = array_column(metaconsole_get_servers(), 'id');
|
||||
} else {
|
||||
$servers_ids = [0];
|
||||
}
|
||||
|
||||
$return_data = [];
|
||||
|
||||
foreach ($servers_ids as $server_id) {
|
||||
if (is_metaconsole()) {
|
||||
$server = metaconsole_get_connection_by_id($server_id);
|
||||
|
||||
if ((int) $es_agent_server_filter !== 0
|
||||
&& (int) $es_agent_server_filter !== (int) $server_id
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
metaconsole_connect($server);
|
||||
}
|
||||
|
||||
$agents = db_get_all_rows_sql($sql);
|
||||
|
||||
foreach ($agents as $key => $value) {
|
||||
if (array_search('secondary_groups', $es_agents_inventory_display_options) !== false) {
|
||||
$sql_agent_sec_group = sprintf(
|
||||
'SELECT id_group
|
||||
FROM tagent_secondary_group
|
||||
WHERE id_agent = %d',
|
||||
$value['id_agente']
|
||||
);
|
||||
|
||||
$agent_secondary_groups = [];
|
||||
$agent_secondary_groups = db_get_all_rows_sql($sql_agent_sec_group);
|
||||
|
||||
$agents[$key]['secondary_groups'] = $agent_secondary_groups;
|
||||
}
|
||||
|
||||
if (array_search('custom_fields', $es_agents_inventory_display_options) !== false) {
|
||||
$sql_agent_custom_fields = sprintf(
|
||||
'SELECT tacd.description, tacf.name
|
||||
FROM tagent_custom_data tacd INNER JOIN tagent_custom_fields tacf
|
||||
ON tacd.id_field = tacf.id_field
|
||||
WHERE tacd.description != "" AND tacd.id_agent = %d',
|
||||
$value['id_agente']
|
||||
);
|
||||
|
||||
$agent_custom_fields = [];
|
||||
$agent_custom_fields = db_get_all_rows_sql($sql_agent_custom_fields);
|
||||
|
||||
$agents[$key]['custom_fields'] = $agent_custom_fields;
|
||||
}
|
||||
|
||||
if (array_search('estado', $es_agents_inventory_display_options) !== false) {
|
||||
if (in_array(6, $es_agent_status_filter)) {
|
||||
if (agents_get_status($value['id_agente']) === 0) {
|
||||
unset($agents[$key]);
|
||||
} else {
|
||||
$agents[$key]['estado'] = agents_get_status($value['id_agente']);
|
||||
}
|
||||
} else {
|
||||
if (in_array('-1', $es_agent_status_filter) === true || in_array(agents_get_status($value['id_agente']), $es_agent_status_filter)) {
|
||||
$agents[$key]['estado'] = agents_get_status($value['id_agente']);
|
||||
} else {
|
||||
// Agent does not match status filter.
|
||||
unset($agents[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($agents as $key => $value) {
|
||||
foreach ($value as $agent_val_key => $agent_val) {
|
||||
// Exclude from data to be displayed in report those fields that were not selected to be displayed by user.
|
||||
if (array_search($agent_val_key, $es_agents_inventory_display_options) === false) {
|
||||
unset($agents[$key][$agent_val_key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$return_data[$server_id] = $agents;
|
||||
|
||||
if (is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
}
|
||||
|
||||
$all_data = [];
|
||||
|
||||
foreach ($return_data as $server_agents) {
|
||||
foreach ($server_agents as $agent) {
|
||||
$all_data[] = $agent;
|
||||
}
|
||||
}
|
||||
|
||||
$return['data'] = $all_data;
|
||||
|
||||
return reporting_check_structure_content($return);
|
||||
}
|
||||
|
||||
|
||||
function reporting_inventory_changes($report, $content, $type)
|
||||
{
|
||||
global $config;
|
||||
@ -9060,8 +9245,8 @@ function reporting_custom_graph(
|
||||
case 'data':
|
||||
$data = [];
|
||||
foreach ($modules as $key => $value) {
|
||||
$data[$value] = modules_get_agentmodule_data(
|
||||
$value,
|
||||
$data[$value['module']] = modules_get_agentmodule_data(
|
||||
$value['module'],
|
||||
$content['period'],
|
||||
$report['datetime']
|
||||
);
|
||||
@ -10557,7 +10742,14 @@ function reporting_get_stats_users($data)
|
||||
|
||||
$tdata = [];
|
||||
$tdata[0] = html_print_image('images/user.png', true, ['title' => __('Defined users'), 'class' => 'invert_filter']);
|
||||
$tdata[1] = count(get_users());
|
||||
$user_groups = users_get_strict_mode_groups($config['id_user'], false);
|
||||
if (array_key_exists(0, $user_groups)) {
|
||||
$users = users_get_user_users($config['id_user'], 'AR', true);
|
||||
} else {
|
||||
$users = users_get_user_users($config['id_user'], 'AR', false);
|
||||
}
|
||||
|
||||
$tdata[1] = count($users);
|
||||
$tdata[1] = '<a class="big_data" href="'.$urls['defined_users'].'">'.$tdata[1].'</a>';
|
||||
|
||||
$tdata[2] = $tdata[3] = ' ';
|
||||
|
@ -377,6 +377,10 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
||||
reporting_html_agent_module($table, $item);
|
||||
break;
|
||||
|
||||
case 'agents_inventory':
|
||||
reporting_html_agents_inventory($table, $item);
|
||||
break;
|
||||
|
||||
case 'inventory':
|
||||
reporting_html_inventory($table, $item);
|
||||
break;
|
||||
@ -1425,6 +1429,173 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print in html agents inventory
|
||||
*
|
||||
* @param object $table Head table or false if it comes from pdf.
|
||||
* @param array $item Items data.
|
||||
* @param boolean $pdf Print pdf true or false.
|
||||
*
|
||||
* @return html
|
||||
*/
|
||||
function reporting_html_agents_inventory($table, $item, $pdf=0)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$table1 = new stdClass();
|
||||
$table1->width = '100%';
|
||||
|
||||
$table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;';
|
||||
$table1->class = 'databox data';
|
||||
$table1->cellpadding = 1;
|
||||
$table1->cellspacing = 1;
|
||||
$table1->styleTable = 'overflow: wrap; table-layout: fixed;';
|
||||
|
||||
$table1->style[0] = 'text-align: left;vertical-align: top;min-width: 100px;';
|
||||
$table1->style[1] = 'text-align: left;vertical-align: top;min-width: 100px;';
|
||||
$table1->style[2] = 'text-align: left;vertical-align: top; min-width: 100px';
|
||||
$table1->style[3] = 'text-align: left;vertical-align: top;min-width: 100px;';
|
||||
$table1->style[4] = 'text-align: left;vertical-align: top;min-width: 100px;';
|
||||
$table1->style[5] = 'text-align: left;vertical-align: top; min-width: 100px';
|
||||
$table1->style[6] = 'text-align: left;vertical-align: top;min-width: 100px;';
|
||||
$table1->style[7] = 'text-align: left;vertical-align: top;min-width: 100px;';
|
||||
$table1->style[8] = 'text-align: left;vertical-align: top; min-width: 100px';
|
||||
$table1->style[9] = 'text-align: left;vertical-align: top;min-width: 100px;';
|
||||
$table1->style[10] = 'text-align: left;vertical-align: top;min-width: 100px;';
|
||||
$table1->style[11] = 'text-align: left;vertical-align: top; min-width: 100px';
|
||||
|
||||
$table1->head = [];
|
||||
|
||||
foreach ($item['data'][0] as $field_key => $field_value) {
|
||||
switch ($field_key) {
|
||||
case 'alias':
|
||||
$table1->head[] = __('Alias');
|
||||
break;
|
||||
|
||||
case 'direccion':
|
||||
$table1->head[] = __('IP Address');
|
||||
break;
|
||||
|
||||
case 'id_os':
|
||||
$table1->head[] = __('OS');
|
||||
break;
|
||||
|
||||
case 'id_grupo':
|
||||
$table1->head[] = __('Group');
|
||||
break;
|
||||
|
||||
case 'comentarios':
|
||||
$table1->head[] = __('Description');
|
||||
break;
|
||||
|
||||
case 'secondary_groups':
|
||||
$table1->head[] = __('Sec. groups');
|
||||
break;
|
||||
|
||||
case 'url_address':
|
||||
$table1->head[] = __('URL');
|
||||
break;
|
||||
|
||||
case 'custom_fields':
|
||||
$table1->head[] = __('Custom fields');
|
||||
break;
|
||||
|
||||
case 'estado':
|
||||
$table1->head[] = __('Status');
|
||||
break;
|
||||
|
||||
case 'agent_version':
|
||||
$table1->head[] = __('Version');
|
||||
break;
|
||||
|
||||
case 'remote':
|
||||
$table1->head[] = __('Remote conf.');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$table1->headstyle[0] = 'text-align: left';
|
||||
$table1->headstyle[1] = 'text-align: left';
|
||||
$table1->headstyle[2] = 'text-align: left';
|
||||
$table1->headstyle[3] = 'text-align: left';
|
||||
$table1->headstyle[4] = 'text-align: left';
|
||||
$table1->headstyle[5] = 'text-align: left';
|
||||
$table1->headstyle[6] = 'text-align: left';
|
||||
$table1->headstyle[7] = 'text-align: left';
|
||||
$table1->headstyle[8] = 'text-align: left';
|
||||
$table1->headstyle[9] = 'text-align: left';
|
||||
$table1->headstyle[10] = 'text-align: left';
|
||||
$table1->headstyle[11] = 'text-align: left';
|
||||
|
||||
$table1->data = [];
|
||||
|
||||
foreach ($item['data'] as $data) {
|
||||
$row = [];
|
||||
|
||||
foreach ($data as $data_field_key => $data_field_value) {
|
||||
$column_value = $data_field_value;
|
||||
|
||||
$show_link = $pdf === 0 ? true : false;
|
||||
|
||||
// Necessary transformations of data prior to represent it.
|
||||
if ($data_field_key === 'id_os') {
|
||||
$column_value = get_os_name((int) $data_field_value);
|
||||
} else if ($data_field_key === 'remote' && $pdf === 0) {
|
||||
$column_value = ((int) $data_field_value === 1) ? __('Yes') : __('No');
|
||||
} else if ($data_field_key === 'url_address' && $pdf === 0) {
|
||||
$column_value = ui_print_truncate_text($data_field_value, 10);
|
||||
} else if ($data_field_key === 'estado') {
|
||||
$column_value = ($pdf === 0) ? ui_print_module_status((int) $data_field_value, true) : modules_get_modules_status((int) $data_field_value);
|
||||
} else if ($data_field_key === 'id_grupo') {
|
||||
$column_value = ui_print_group_icon((int) $data_field_value, true, 'groups_small', '', $show_link);
|
||||
} else if ($data_field_key === 'custom_fields') {
|
||||
$custom_fields_value = [];
|
||||
|
||||
if (is_array($data_field_value)) {
|
||||
foreach ($data_field_value as $value) {
|
||||
$custom_fields_value[] = $value['name'].': '.$value['description'];
|
||||
}
|
||||
}
|
||||
|
||||
$column_value = implode(' / ', $custom_fields_value);
|
||||
} else if ($data_field_key === 'secondary_groups') {
|
||||
$custom_fields_value = [];
|
||||
|
||||
if (is_array($data_field_value)) {
|
||||
foreach ($data_field_value as $value) {
|
||||
$custom_fields_value[] = ui_print_group_icon((int) $value['id_group'], true, 'groups_small', '', $show_link);
|
||||
}
|
||||
}
|
||||
|
||||
$column_value = implode(' / ', $custom_fields_value);
|
||||
}
|
||||
|
||||
$row[] = $column_value;
|
||||
}
|
||||
|
||||
$table1->data[] = $row;
|
||||
|
||||
if ($pdf !== 0) {
|
||||
$table1->data[] = '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
if ($pdf === 0) {
|
||||
$table->colspan['permissions']['cell'] = 3;
|
||||
$table->cellstyle['permissions']['cell'] = 'text-align: center;';
|
||||
$table->data['permissions']['cell'] = html_print_table(
|
||||
$table1,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
return html_print_table(
|
||||
$table1,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print in html inventory changes reports
|
||||
*
|
||||
|
@ -848,6 +848,13 @@ function reports_get_report_types($template=false, $not_editor=false)
|
||||
'name' => __('Group event report'),
|
||||
];
|
||||
|
||||
if (!$template) {
|
||||
$types['agents_inventory'] = [
|
||||
'optgroup' => __('Inventory'),
|
||||
'name' => __('Agents inventory'),
|
||||
];
|
||||
}
|
||||
|
||||
if ($config['enterprise_installed']) {
|
||||
$types['inventory'] = [
|
||||
'optgroup' => __('Inventory'),
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<div class="pdd_l_30px w150px float-left line_17px">
|
||||
<h3>Validate</h3>
|
||||
<?php html_print_image('images/tick.png', false, ['title' => 'Validated event', 'alt' => 'Validated event', 'width' => '10', 'height' => '10']); ?> - Validated event<br>
|
||||
<?php html_print_image('images/tick.png', false, ['class' => 'invert_filter', 'title' => 'Validated event', 'alt' => 'Validated event', 'width' => '10', 'height' => '10']); ?> - Validated event<br>
|
||||
<div class="w10px height_10px inline"></div> - Event not validated
|
||||
</div>
|
||||
|
||||
|
@ -644,7 +644,7 @@ var TreeController = {
|
||||
$content.append($statusImage);
|
||||
}
|
||||
var image_tooltip =
|
||||
'<span><img src="' +
|
||||
'<span><img class="invert_filter" src="' +
|
||||
(controller.baseURL.length > 0 ? controller.baseURL : "") +
|
||||
'images/help.png" class="img_help" title="' +
|
||||
element.name +
|
||||
@ -653,7 +653,7 @@ var TreeController = {
|
||||
'"/></span> ';
|
||||
|
||||
var $serviceDetailImage = $(
|
||||
'<img src="' +
|
||||
'<img class="invert_filter" src="' +
|
||||
(controller.baseURL.length > 0 ? controller.baseURL : "") +
|
||||
'images/tree_service_map.png" /> '
|
||||
);
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -56,7 +56,8 @@ input.sub,
|
||||
.introjs-tooltip,
|
||||
button.sub,
|
||||
.bg_general,
|
||||
table.agent_info_table thead > tr:first-child th,
|
||||
.show_result_interpreter,
|
||||
div#rules::after table.agent_info_table thead > tr:first-child th,
|
||||
table.agent_info_table tr {
|
||||
background-color: #222 !important;
|
||||
color: #fff !important;
|
||||
@ -234,7 +235,8 @@ div#foot {
|
||||
}
|
||||
|
||||
/* Overwrite inline styles */
|
||||
.textodialogo td .white_important {
|
||||
.textodialogo td .white_important,
|
||||
.multi-select-container {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
@ -894,6 +896,8 @@ div#dashboard-controls {
|
||||
text-align: center;
|
||||
text-anchor: middle;
|
||||
fill: #fff;
|
||||
font-family: Verdana;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tickLabel {
|
||||
@ -1121,3 +1125,18 @@ a.pandora_pagination,
|
||||
.databox.data > tbody > tr > td:last-child {
|
||||
border-right: 1px solid #707070 !important;
|
||||
}
|
||||
|
||||
.results-found {
|
||||
background-color: #111;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#graph_container {
|
||||
background-color: #111 !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#elasticsearch_editor,
|
||||
#elasticsearch_view {
|
||||
filter: invert(100%);
|
||||
}
|
||||
|
@ -129,7 +129,7 @@
|
||||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.754';
|
||||
$build = '210603';
|
||||
$build = '210604';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
@ -1,17 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Graph viewer.
|
||||
*
|
||||
* @category Reporting
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// 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.
|
||||
// Login check
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
@ -231,14 +246,24 @@ if ($view_graph) {
|
||||
];
|
||||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header(
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$graph['name'],
|
||||
'images/chart.png',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
$options
|
||||
$options,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Reporting'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Custom graphs'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$width = null;
|
||||
|
@ -221,7 +221,23 @@ if ($searchUsers) {
|
||||
// Check ACLs
|
||||
$users_id = [];
|
||||
foreach ($users as $key => $user) {
|
||||
if (!check_acl($config['id_user'], users_get_groups($user['id_user']), 'UM') && $config['id_user'] != $user['id_user']) {
|
||||
$user_can_manage_all = users_can_manage_group_all('UM');
|
||||
|
||||
$user_groups = users_get_groups(
|
||||
$user['id_user'],
|
||||
'AR',
|
||||
$user_can_manage_all
|
||||
);
|
||||
|
||||
// Get group IDs.
|
||||
$user_groups = array_keys($user_groups);
|
||||
|
||||
if (check_acl_one_of_groups($config['id_user'], $user_groups, 'UM') === false
|
||||
&& $config['id_user'] != $user['id_user']
|
||||
|| (users_is_admin($config['id_user']) === false
|
||||
&& users_is_admin($user['id_user']) === true)
|
||||
|| $config['id_user'] === $user['id_user']
|
||||
) {
|
||||
unset($users[$key]);
|
||||
} else {
|
||||
$users_id[] = $user['id_user'];
|
||||
@ -229,33 +245,9 @@ if ($searchUsers) {
|
||||
}
|
||||
|
||||
if ($only_count) {
|
||||
$totalUsers = count($users);
|
||||
unset($users);
|
||||
}
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
case 'postgresql':
|
||||
$sql = "SELECT COUNT(id_user) AS count FROM tusuario
|
||||
WHERE id_user LIKE '%".$stringSearchSQL."%' OR
|
||||
fullname LIKE '%".$stringSearchSQL."%' OR
|
||||
firstname LIKE '%".$stringSearchSQL."%' OR
|
||||
lastname LIKE '%".$stringSearchSQL."%' OR
|
||||
middlename LIKE '%".$stringSearchSQL."%' OR
|
||||
email LIKE '%".$stringSearchSQL."%'";
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$sql = "SELECT COUNT(id_user) AS count FROM tusuario
|
||||
WHERE upper(id_user) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
||||
upper(fullname) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
||||
upper(firstname) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
||||
upper(lastname) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
||||
upper(middlename) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
||||
upper(email LIKE) '%".strtolower($stringSearchSQL)."%'";
|
||||
break;
|
||||
}
|
||||
|
||||
$totalUsers = db_get_value_sql($sql);
|
||||
} else {
|
||||
$totalUsers = 0;
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
* Actual View script for Visual Consoles.
|
||||
*
|
||||
* @category Extensions
|
||||
* @category Operation
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
@ -27,6 +26,7 @@
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
// Login check.
|
||||
@ -93,14 +93,14 @@ try {
|
||||
|
||||
$visualConsoleData = $visualConsole->toArray();
|
||||
$groupId = $visualConsoleData['groupId'];
|
||||
$visualConsoleName = $visualConsoleData['name'];
|
||||
$visualConsoleName = io_safe_input(strip_tags(io_safe_output($visualConsoleData['name'])));
|
||||
|
||||
// ACL.
|
||||
$aclRead = check_acl_restricted_all($config['id_user'], $groupId, 'VR');
|
||||
$aclWrite = check_acl_restricted_all($config['id_user'], $groupId, 'VW');
|
||||
$aclManage = check_acl_restricted_all($config['id_user'], $groupId, 'VM');
|
||||
$aclRead = (bool) check_acl_restricted_all($config['id_user'], $groupId, 'VR');
|
||||
$aclWrite = (bool) check_acl_restricted_all($config['id_user'], $groupId, 'VW');
|
||||
$aclManage = (bool) check_acl_restricted_all($config['id_user'], $groupId, 'VM');
|
||||
|
||||
if (!$aclRead && !$aclWrite && !$aclManage) {
|
||||
if ($aclRead === false && $aclWrite === false && $aclManage === false) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access visual console without group access'
|
||||
@ -121,9 +121,9 @@ $options['consoles_list']['text'] = '<a href="index.php?sec=network&sec2=godmode
|
||||
]
|
||||
).'</a>';
|
||||
|
||||
if ($aclWrite || $aclManage) {
|
||||
if ($aclWrite === true || $aclManage === true) {
|
||||
$action = get_parameterBetweenListValues(
|
||||
is_metaconsole() ? 'action2' : 'action',
|
||||
(is_metaconsole() === true) ? 'action2' : 'action',
|
||||
[
|
||||
'new',
|
||||
'save',
|
||||
@ -167,7 +167,7 @@ if ($aclWrite || $aclManage) {
|
||||
]
|
||||
).'</a>';
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if (enterprise_installed() === true) {
|
||||
$options['wizard_services']['text'] = '<a href="'.$baseUrl.'&tab=wizard_services&id_visual_console='.$visualConsoleId.'">'.html_print_image(
|
||||
'images/wand_services.png',
|
||||
true,
|
||||
@ -380,7 +380,7 @@ if ($pure === false) {
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
if ($aclWrite || $aclManage) {
|
||||
if ($aclWrite === true || $aclManage === true) {
|
||||
echo html_print_checkbox_switch('edit-mode', 1, false, true);
|
||||
}
|
||||
|
||||
@ -406,7 +406,7 @@ if ($pure === true) {
|
||||
|
||||
// Quit fullscreen.
|
||||
echo '<li class="nomn">';
|
||||
if (is_metaconsole()) {
|
||||
if (is_metaconsole() === true) {
|
||||
$urlNoFull = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='.$visualConsoleId.'&refr='.$refr;
|
||||
} else {
|
||||
$urlNoFull = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$visualConsoleId.'&refr='.$refr;
|
||||
@ -419,7 +419,7 @@ if ($pure === true) {
|
||||
|
||||
// Countdown.
|
||||
echo '<li class="nomn">';
|
||||
if (is_metaconsole()) {
|
||||
if (is_metaconsole() === true) {
|
||||
echo '<div class="vc-refr-meta">';
|
||||
} else {
|
||||
echo '<div class="vc-refr">';
|
||||
@ -444,11 +444,13 @@ if ($pure === true) {
|
||||
|
||||
// Console name.
|
||||
echo '<li class="nomn">';
|
||||
if (is_metaconsole()) {
|
||||
echo '<div class="vc-title-meta">'.$visualConsoleName.'</div>';
|
||||
} else {
|
||||
echo '<div class="vc-title">'.$visualConsoleName.'</div>';
|
||||
}
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'class' => (is_metaconsole() === true) ? 'vc-title-meta' : 'vc-title',
|
||||
'content' => $visualConsoleName,
|
||||
]
|
||||
);
|
||||
|
||||
echo '</li>';
|
||||
|
||||
@ -501,7 +503,7 @@ ui_require_css_file('form');
|
||||
<script type="text/javascript">
|
||||
var container = document.getElementById("visual-console-container");
|
||||
var props = <?php echo (string) $visualConsole; ?>;
|
||||
var items = <?php echo '['.implode($visualConsoleItems, ',').']'; ?>;
|
||||
var items = <?php echo '['.implode(',', $visualConsoleItems).']'; ?>;
|
||||
var baseUrl = "<?php echo ui_get_full_url('/', false, false, false); ?>";
|
||||
var controls = document.getElementById('vc-controls');
|
||||
autoHideElement(controls, 1000);
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.754
|
||||
%define release 210603
|
||||
%define release 210604
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.754
|
||||
%define release 210603
|
||||
%define release 210604
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.754
|
||||
%define release 210603
|
||||
%define release 210604
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-server
|
||||
Version: 7.0NG.754-210603
|
||||
Version: 7.0NG.754-210604
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.754-210603"
|
||||
pandora_version="7.0NG.754-210604"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.754";
|
||||
my $pandora_build = "210603";
|
||||
my $pandora_build = "210604";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.754";
|
||||
my $pandora_build = "210603";
|
||||
my $pandora_build = "210604";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.754
|
||||
%define release 210603
|
||||
%define release 210604
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.754
|
||||
%define release 210603
|
||||
%define release 210604
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -9,7 +9,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.754"
|
||||
PI_BUILD="210603"
|
||||
PI_BUILD="210604"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
||||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.754 Build 210603";
|
||||
my $version = "7.0NG.754 Build 210604";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
||||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.754 Build 210603";
|
||||
my $version = "7.0NG.754 Build 210604";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user