Merge remote-tracking branch 'origin/develop' into new-vc-line-element

This commit is contained in:
Daniel Barbero 2020-01-14 09:34:31 +01:00
commit ed53399c3c
46 changed files with 304 additions and 163 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.742-200113
Version: 7.0NG.742-200114
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.742-200113"
pandora_version="7.0NG.742-200114"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -55,7 +55,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.742';
use constant AGENT_BUILD => '200113';
use constant AGENT_BUILD => '200114';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.742
%define release 200113
%define release 200114
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.742
%define release 200113
%define release 200114
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.742"
PI_BUILD="200113"
PI_BUILD="200114"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{200113}
{200114}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.742(Build 200113)")
#define PANDORA_VERSION ("7.0NG.742(Build 200114)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.742(Build 200113))"
VALUE "ProductVersion", "(7.0NG.742(Build 200114))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.742-200113
Version: 7.0NG.742-200114
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.742-200113"
pandora_version="7.0NG.742-200114"
package_pear=0
package_pandora=1

View File

@ -64,9 +64,11 @@ if (!empty($files)) {
$document_root = str_replace('\\', '/', io_safe_output($_SERVER['DOCUMENT_ROOT']));
$file['location'] = str_replace('\\', '/', io_safe_output($file['location']));
$relative_path = str_replace($document_root, '', $file['location']);
$file_path = base64_encode($relative_path);
$hash = md5($relative_path.$config['dbpass']);
$url = ui_get_full_url("include/get_file.php?file=$file_path&hash=$hash");
$file_name = explode('/', $file['location']);
$file_decoded = $file_name[(count($file_name) - 1)];
$file_path = base64_encode($file_decoded);
$hash = md5($file_path.$config['dbpass']);
$url = ui_get_full_url('include/get_file.php?file='.urlencode($file_path).'&hash='.$hash);
$date_format = ($config['date_format']) ? io_safe_output($config['date_format']) : 'F j, Y - H:m';
$data[0] = "<a href=\"$url\" target=\"_blank\">".$file['name'].'</a>';

View File

@ -0,0 +1,5 @@
START TRANSACTION;
ALTER TABLE `tevent_filter` MODIFY `severity` TEXT NOT NULL;
COMMIT;

View File

@ -1401,6 +1401,7 @@ ALTER TABLE tevent_filter ADD COLUMN `source` tinytext NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `id_extra` tinytext NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `id_source_event` int(10);
ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL;
ALTER TABLE `tevent_filter` MODIFY COLUMN `severity` text NOT NULL;
-- ---------------------------------------------------------------------
-- Table `tusuario`

View File

@ -55,7 +55,7 @@ if ($id) {
$id_group = $filter['id_group'];
$id_name = $filter['id_name'];
$event_type = $filter['event_type'];
$severity = $filter['severity'];
$severity = explode(',', $filter['severity']);
$status = $filter['status'];
$search = $filter['search'];
$text_agent = $filter['text_agent'];
@ -123,7 +123,7 @@ if ($update || $create) {
$id_group_filter = get_parameter('id_group_filter');
$id_name = (string) get_parameter('id_name');
$event_type = get_parameter('event_type', '');
$severity = get_parameter('severity', '');
$severity = implode(',', get_parameter('severity', -1));
$status = get_parameter('status', '');
$search = get_parameter('search', '');
$text_agent = get_parameter('text_agent', '');
@ -172,6 +172,8 @@ if ($update || $create) {
'user_comment' => $user_comment,
'filter_only_alert' => $filter_only_alert,
];
$severity = explode(',', $severity);
}
if ($update) {
@ -289,15 +291,24 @@ $table->data[3][1] = html_print_select(
true
);
if (empty($severity) && $severity !== '0') {
$severity = -1;
}
$table->data[4][0] = '<b>'.__('Severity').'</b>';
$table->data[4][1] = html_print_select(
get_priorities(),
'severity',
'severity[]',
$severity,
'',
__('All'),
'-1',
true
-1,
true,
true,
true,
'',
false,
'width: 175px'
);
$fields = events_get_all_status();

View File

@ -290,7 +290,7 @@ $table_aux = new stdClass();
foreach ($result_graphs as $graph) {
$data = [];
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text(io_safe_output($graph['name']), 70).'</a>';
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text($graph['name'], 70).'</a>';
$data[1] = ui_print_truncate_text($graph['description'], 70);

View File

@ -1207,8 +1207,7 @@ switch ($action) {
$report_id_user = get_parameter('report_id_user');
$non_interactive = get_parameter('non_interactive', 0);
// Pretty font by default for pdf.
$custom_font = 'FreeSans.ttf';
$custom_font = $config['custom_report_front_font'];
switch ($type_access_selected) {
case 'group_view':
@ -1284,7 +1283,6 @@ switch ($action) {
$metaconsole_report = (int) is_metaconsole();
if ($config['custom_report_front']) {
$custom_font = $config['custom_report_front_font'];
$logo = $config['custom_report_front_logo'];
$header = $config['custom_report_front_header'];
$first_page = $config['custom_report_front_firstpage'];

View File

@ -1048,6 +1048,20 @@ $row++;
$row++;
$table_report->data[$row][0] = __('PDF font family');
$table_report->data[$row][1] = html_print_select(
$fonts,
'custom_report_front_font',
$config['custom_report_front_font'],
false,
__('Default'),
'',
true
);
$row++;
$table_report->data[$row][0] = __('Graph image height for HTML reports');
$table_report->data[$row][0] .= ui_print_help_tip(
__('This is the height in pixels of the module graph or custom graph in the reports (only: HTML)'),
@ -1078,18 +1092,6 @@ $row++;
}
}
// Font
$table_report->data['custom_report_front-font'][0] = __('Custom report front').' - '.__('Font family');
$table_report->data['custom_report_front-font'][1] = html_print_select(
$fonts,
'custom_report_front_font',
$config['custom_report_front_font'],
false,
__('Default'),
'',
true
);
// Logo
$table_report->data['custom_report_front-logo'][0] = __('Custom report front').' - '.__('Custom logo').ui_print_help_tip(
__("The dir of custom logos is in your www Console in 'images/custom_logo'. You can upload more files (ONLY JPEG AND PNG) in upload tool in console."),
@ -1397,7 +1399,6 @@ function edit_csv_divider () {
function display_custom_report_front (show,table) {
if (show == true) {
$('tr#'+table+'-custom_report_front-font').show();
$('tr#'+table+'-custom_report_front-logo').show();
$('tr#'+table+'-custom_report_front-preview').show();
$('tr#'+table+'-custom_report_front-header').show();
@ -1405,7 +1406,6 @@ function display_custom_report_front (show,table) {
$('tr#'+table+'-custom_report_front-footer').show();
}
else {
$('tr#'+table+'-custom_report_front-font').hide();
$('tr#'+table+'-custom_report_front-logo').hide();
$('tr#'+table+'-custom_report_front-preview').hide();
$('tr#'+table+'-custom_report_front-header').hide();

View File

@ -231,7 +231,7 @@ if ($save_event_filter) {
$values['id_name'] = get_parameter('id_name');
$values['id_group'] = get_parameter('id_group');
$values['event_type'] = get_parameter('event_type');
$values['severity'] = get_parameter('severity');
$values['severity'] = implode(',', get_parameter('severity', -1));
$values['status'] = get_parameter('status');
$values['search'] = get_parameter('search');
$values['text_agent'] = get_parameter('text_agent');
@ -278,7 +278,7 @@ if ($update_event_filter) {
$id = get_parameter('id');
$values['id_group'] = get_parameter('id_group');
$values['event_type'] = get_parameter('event_type');
$values['severity'] = get_parameter('severity');
$values['severity'] = implode(',', get_parameter('severity', -1));
$values['status'] = get_parameter('status');
$values['search'] = get_parameter('search');
$values['text_agent'] = get_parameter('text_agent');
@ -439,8 +439,10 @@ function load_form_filter() {
$("#id_group").val(val);
if (i == 'event_type')
$("#event_type").val(val);
if (i == 'severity')
$("#severity").val(val);
if (i == 'severity') {
const multiple = val.split(",");
$("#severity").val(multiple);
}
if (i == 'status')
$("#status").val(val);
if (i == 'search')
@ -1579,7 +1581,7 @@ if ($get_list_events_agents) {
$id_agent = get_parameter('id_agent');
$server_id = get_parameter('server_id');
$event_type = get_parameter('event_type');
$severity = get_parameter('severity');
$severity = implode(',', get_parameter('severity', -1));
$status = get_parameter('status');
$search = get_parameter('search');
$id_agent_module = get_parameter('id_agent_module');

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC200113';
$build_version = 'PC200114';
$pandora_version = 'v7.0NG.742';
// Do not overwrite default timezone set if defined.

View File

@ -3512,13 +3512,18 @@ function agents_get_status_animation($up=true)
function agents_get_agent_id_by_alias_regex($alias_regex, $flag='i', $limit=0)
{
$agents_id = [];
$all_agents = agents_get_agents(false, ['id_agente', 'alias']);
if (is_metaconsole()) {
$all_agents = agents_meta_get_agents('AR', '|');
} else {
$all_agents = agents_get_group_agents(0, true, 'lower', false, false, true, '|');
}
$agent_match = '/'.$alias_regex.'/'.$flag;
foreach ($all_agents as $agent) {
$result_agent_match = preg_match($agent_match, $agent['alias']);
foreach ($all_agents as $agent_id => $agent_alias) {
$result_agent_match = preg_match($agent_match, $agent_alias);
if ($result_agent_match) {
$agents_id[] = $agent['id_agente'];
$agents_id[] = $agent_id;
$i++;
if ($i === $limit) {
break;

View File

@ -624,7 +624,37 @@ function events_update_status($id_evento, $status, $filter=null, $history=false)
break;
}
return db_process_sql($update_sql);
$result = db_process_sql($update_sql);
if ($result) {
switch ($status) {
case EVENT_STATUS_NEW:
$status_string = 'New';
break;
case EVENT_STATUS_VALIDATED:
$status_string = 'Validated';
break;
case EVENT_STATUS_INPROCESS:
$status_string = 'In process';
break;
default:
$status_string = '';
break;
}
events_comment(
$id_evento,
'',
'Change status to '.$status_string,
is_metaconsole() ? true : false,
$history
);
}
return $result;
}
@ -751,43 +781,78 @@ function events_get_all(
}
if (isset($filter['severity']) && $filter['severity'] > 0) {
switch ($filter['severity']) {
case EVENT_CRIT_MAINTENANCE:
case EVENT_CRIT_INFORMATIONAL:
case EVENT_CRIT_NORMAL:
case EVENT_CRIT_MINOR:
case EVENT_CRIT_WARNING:
case EVENT_CRIT_MAJOR:
case EVENT_CRIT_CRITICAL:
default:
$sql_filters[] = sprintf(
' AND criticity = %d ',
$filter['severity']
);
break;
if (is_array($filter['severity'])) {
if (!in_array(-1, $filter['severity'])) {
$not_normal = array_search(EVENT_CRIT_NOT_NORMAL, $filter['severity']);
if ($not_normal !== false) {
unset($filter['severity'][$not_normal]);
$sql_filters[] = sprintf(
' AND criticity != %d',
EVENT_CRIT_NORMAL
);
} else {
$critical_warning = array_search(EVENT_CRIT_WARNING_OR_CRITICAL, $filter['severity']);
if ($critical_warning !== false) {
unset($filter['severity'][$critical_warning]);
$filter['severity'][] = EVENT_CRIT_WARNING;
$filter['severity'][] = EVENT_CRIT_CRITICAL;
}
case EVENT_CRIT_WARNING_OR_CRITICAL:
$sql_filters[] = sprintf(
' AND (criticity = %d OR criticity = %d)',
EVENT_CRIT_WARNING,
EVENT_CRIT_CRITICAL
);
break;
$critical_normal = array_search(EVENT_CRIT_OR_NORMAL, $filter['severity']);
if ($critical_normal !== false) {
unset($filter['severity'][$critical_normal]);
$filter['severity'][] = EVENT_CRIT_NORMAL;
$filter['severity'][] = EVENT_CRIT_CRITICAL;
}
case EVENT_CRIT_NOT_NORMAL:
$sql_filters[] = sprintf(
' AND criticity != %d',
EVENT_CRIT_NORMAL
);
break;
if (!empty($filter['severity'])) {
$filter['severity'] = implode(',', $filter['severity']);
$sql_filters[] = sprintf(
' AND criticity IN (%s)',
$filter['severity']
);
}
}
}
} else {
switch ($filter['severity']) {
case EVENT_CRIT_MAINTENANCE:
case EVENT_CRIT_INFORMATIONAL:
case EVENT_CRIT_NORMAL:
case EVENT_CRIT_MINOR:
case EVENT_CRIT_WARNING:
case EVENT_CRIT_MAJOR:
case EVENT_CRIT_CRITICAL:
default:
$sql_filters[] = sprintf(
' AND criticity = %d ',
$filter['severity']
);
break;
case EVENT_CRIT_OR_NORMAL:
$sql_filters[] = sprintf(
' AND (criticity = %d OR criticity = %d)',
EVENT_CRIT_NORMAL,
EVENT_CRIT_CRITICAL
);
break;
case EVENT_CRIT_WARNING_OR_CRITICAL:
$sql_filters[] = sprintf(
' AND (criticity = %d OR criticity = %d)',
EVENT_CRIT_WARNING,
EVENT_CRIT_CRITICAL
);
break;
case EVENT_CRIT_NOT_NORMAL:
$sql_filters[] = sprintf(
' AND criticity != %d',
EVENT_CRIT_NORMAL
);
break;
case EVENT_CRIT_OR_NORMAL:
$sql_filters[] = sprintf(
' AND (criticity = %d OR criticity = %d)',
EVENT_CRIT_NORMAL,
EVENT_CRIT_CRITICAL
);
break;
}
}
}

View File

@ -106,12 +106,8 @@ if (!function_exists('mime_content_type')) {
finfo_close($finfo);
return $mimetype;
} else {
$temp = exec('file '.$filename);
if (isset($temp) && $temp != '') {
return $temp;
} else {
return 'application/octet-stream';
}
error_log('Warning: Cannot find finfo_open function. Fileinfo extension is not enabled. Please add "extension=fileinfo.so" or "extension=fileinfo.dll" in your php.ini');
return 'unknown';
}
}
@ -694,8 +690,9 @@ function filemanager_file_explorer(
$data[1] = '<a href="'.$url_file_clean.'">'.$fileinfo['name'].'</a>';
} else {
$hash = md5($relative_path.$config['dbpass']);
$data[1] = '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode(base64_encode($relative_path)).'&hash='.$hash.'">'.$fileinfo['name'].'</a>';
$filename = base64_encode($relative_directory.'/'.$fileinfo['name']);
$hash = md5($filename.$config['dbpass']);
$data[1] = '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'">'.$fileinfo['name'].'</a>';
}
// Notice that uploaded php files could be dangerous
@ -755,8 +752,9 @@ function filemanager_file_explorer(
}
if ((!$fileinfo['is_dir']) && ($download_button)) {
$hash = md5($fileinfo['realpath'].$config['dbpass']);
$data[4] .= '<a href="include/get_file.php?file='.urlencode(base64_encode($fileinfo['realpath'])).'&hash='.$hash.'" style="vertical-align: 25%;">';
$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] .= '</a>';
}

View File

@ -1178,8 +1178,13 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*',
}
// Minutes
for ($i = 0; $i < 60; $i += 5) {
for ($i = 0; $i < 60; $i++) {
$minutes[$i] = $i;
// If minute is not a multiple of 5, then add style to option in order to hide it from minute select but still is a valid value that input can adopt. We want this in case a value that is not a multiple of 5 is entered in module's data configuration.
if (($i % 5) != 0) {
$minutes_hidden_options[$i] = 'display: none;';
}
}
// Month days
@ -1216,13 +1221,13 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*',
if ($to) {
$table->data[0][0] = html_print_select($hours, 'hour_to', $hour, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][1] = html_print_select($minutes, 'minute_to', $minute, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][1] = html_print_select($minutes, 'minute_to', $minute, '', __('Any'), '*', true, false, false, '', $disabled, false, $minutes_hidden_options);
$table->data[0][2] = html_print_select($mdays, 'mday_to', $mday, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][3] = html_print_select($months, 'month_to', $month, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][4] = html_print_select($wdays, 'wday_to', $wday, '', __('Any'), '*', true, false, false, '', $disabled);
} else {
$table->data[0][0] = html_print_select($hours, 'hour_from', $hour, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][1] = html_print_select($minutes, 'minute_from', $minute, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][1] = html_print_select($minutes, 'minute_from', $minute, '', __('Any'), '*', true, false, false, '', $disabled, false, $minutes_hidden_options);
$table->data[0][2] = html_print_select($mdays, 'mday_from', $mday, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][3] = html_print_select($months, 'month_from', $month, '', __('Any'), '*', true, false, false, '', $disabled);
$table->data[0][4] = html_print_select($wdays, 'wday_from', $wday, '', __('Any'), '*', true, false, false, '', $disabled);

View File

@ -190,6 +190,8 @@ function reporting_make_reporting_data(
$metaconsole_on = is_metaconsole();
$index_content = 0;
foreach ($contents as $content) {
$content['name'] = io_safe_input($content['name']);
$content['description'] = io_safe_input($content['description']);
if (!empty($content['id_agent_module']) && !empty($content['id_agent'])
&& tags_has_user_acl_tags($config['id_user'])
) {
@ -4286,14 +4288,7 @@ function reporting_sql_graph(
case 'data':
$data = [];
foreach ($modules as $key => $value) {
$data[$value] = modules_get_agentmodule_data(
$value,
$content['period'],
$report['datetime']
);
}
$data = db_get_all_rows_sql($content['external_source']);
$return['chart'] = $data;
break;
}
@ -7640,7 +7635,7 @@ function reporting_custom_graph(
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = io_safe_output($graph['name']);
$return['subtitle'] = $graph['name'];
$return['agent_name'] = $agent_alias;
$return['module_name'] = $module_name;
$return['description'] = $content['description'];

View File

@ -130,7 +130,7 @@ function html_do_report_info($report)
$html .= '</tr>
<tr>
<td valign="top"><b>'.__('Description').': </b></td><td>'.io_safe_output($report['description']).'</td>
<td valign="top"><b>'.__('Description').': </b></td><td>'.htmlspecialchars($report['description']).'</td>
</tr>
</table>'.'</div>';

View File

@ -1593,6 +1593,7 @@ function visual_map_print_item(
case CLOCK:
if ((get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap')) {
$image_prefix = (is_metaconsole()) ? '../../' : '';
if ($width == 0) {
if ($layoutData['id_metaconsole'] != 0) {
if ($layoutData['clock_animation'] == 'analogic_1') {
@ -1606,17 +1607,16 @@ function visual_map_print_item(
}
} else {
if ($layoutData['clock_animation'] == 'analogic_1') {
$img = '<img src="images/console/signes/clock.png" style="width:200px;height:240px;">';
$img = '<img src="'.$image_prefix.'images/console/signes/clock.png" style="width:200px;height:240px;">';
} else {
if ($layoutData['time_format'] == 'time') {
$img = '<img src="images/console/signes/digital-clock.png" style="width:200px;height:71px">';
$img = '<img src="'.$image_prefix.'images/console/signes/digital-clock.png" style="width:200px;height:71px">';
} else {
$img = '<img src="images/console/signes/digital-clock.png" style="width:200px;height:91px">';
$img = '<img src="'.$image_prefix.'images/console/signes/digital-clock.png" style="width:200px;height:91px">';
}
}
}
} else {
$image_prefix = ($layoutData['id_metaconsole'] != 0) ? '../../' : '';
if ($layoutData['clock_animation'] == 'analogic_1') {
$img = '<img src="'.$image_prefix.'images/console/signes/clock.png" style="width:'.$width.'px;height:'.($width + 40).'px;">';
} else {

View File

@ -29,29 +29,42 @@ if ($auth_method != 'ad' && $auth_method != 'ldap') {
$styleError = 'background:url("../images/err.png") no-repeat scroll 0 0 transparent; padding:4px 1px 6px 30px; color:#CC0000;';
$file = get_parameter('file', null);
$file_raw = get_parameter('file', null);
$file = base64_decode($file);
$file = base64_decode(urldecode($file_raw));
$hash = get_parameter('hash', null);
$testHash = md5($file.$config['dbpass']);
if ($hash != $testHash) {
if ($file === '' || $hash === '' || $hash !== md5($file_raw.$config['dbpass']) || !isset($_SERVER['HTTP_REFERER'])) {
echo "<h3 style='".$styleError."'>".__('Security error. Please contact the administrator.').'</h3>';
} else if (!empty($file) && !empty($hash)) {
// echo $file;
if (!file_exists($file)) {
$file = $_SERVER['DOCUMENT_ROOT'].$file;
} else {
$downloadable_file = '';
$parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY));
$parse_sec2_query = explode('=', $parse_all_queries[1]);
if ($parse_sec2_query[0] === 'sec2') {
switch ($parse_sec2_query[1]) {
case 'godmode/setup/file_manager':
$downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/'.$file;
break;
case 'extensions/files_repo':
$downloadable_file = $_SERVER['DOCUMENT_ROOT'].'/pandora_console/attachment/files_repo/'.$file;
break;
default:
$downloadable_file = '';
// Do nothing
break;
}
}
if (!file_exists($file)) {
if ($downloadable_file === '' || !file_exists($downloadable_file)) {
echo "<h3 style='".$styleError."'>".__('File is missing in disk storage. Please contact the administrator.').'</h3>';
} else {
header('Content-type: aplication/octet-stream;');
header('Content-type: '.mime_content_type($file).';');
header('Content-Length: '.filesize($file));
header('Content-Disposition: attachment; filename="'.basename($file).'"');
readfile($file);
header('Content-type: '.mime_content_type($downloadable_file).';');
header('Content-Length: '.filesize($downloadable_file));
header('Content-Disposition: attachment; filename="'.basename($downloadable_file).'"');
readfile($downloadable_file);
}
}

View File

@ -214,8 +214,8 @@ function show_massive_response_dialog(
$("#button-submit_event_response").show();
},
close: function() {
$("#checkbox-all_validate_box").prop("checked", false);
$(".chk_val").prop("checked", false);
$("#event_response_command_window").dialog("close");
},
width: response["modal_width"],
height: response["modal_height"]

View File

@ -30,7 +30,6 @@ div.mini-criticity.h100p {
form.flex-row div.filter_input,
form.flex-row ul {
width: 30%;
min-width: 300px;
display: flex;
flex-direction: row;
align-items: baseline;
@ -47,12 +46,13 @@ div.filter_input_little {
flex-direction: row;
align-items: baseline;
flex-wrap: nowrap;
margin: 0.5em 0 0.5em 1em;
margin: 0.5em 0 0.5em 0em;
}
form.flex-row div.filter_input.large {
flex: 1;
min-width: 470px;
min-width: 700px;
max-width: 100%;
}
div.filter_input > label,
@ -120,6 +120,8 @@ table.dataTable tbody td {
.filter_input {
align-items: center;
min-width: 400px;
max-width: 450px;
}
.filter_input_little > select,

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.742';
$build = '200113';
$build = '200114';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -135,6 +135,10 @@ $id_agent = get_parameter(
'filter[id_agent]',
$filter['id_agent']
);
$text_module = get_parameter(
'filter[text_module]',
$filter['text_module']
);
$id_agent_module = get_parameter(
'filter[id_agent_module]',
$filter['id_agent_module']
@ -210,10 +214,38 @@ $id_source_event = get_parameter(
$filter['id_source_event']
);
$server_id = get_parameter(
'filter[server_id]',
$filter['id_server_meta']
);
if (is_metaconsole()) {
// Connect to node database.
$id_node = $server_id;
if ($id_node != 0) {
if (metaconsole_connect(null, $id_node) != NOERR) {
return false;
}
}
}
if (empty($text_agent) && !empty($id_agent)) {
$text_agent = agents_get_alias($id_agent);
}
if (empty($text_module) && !empty($id_agent_module)) {
$text_module = modules_get_agentmodule_name($id_agent_module);
$text_agent = agents_get_alias(modules_get_agentmodule_agent($id_agent_module));
}
if (is_metaconsole()) {
// Return to metaconsole database.
if ($id_node != 0) {
metaconsole_restore_db();
}
}
// Ajax responses.
if (is_ajax()) {
$get_events = get_parameter('get_events', 0);
@ -862,22 +894,6 @@ $in = '<div class="filter_input"><label>'.__('Event type').'</label>';
$in .= $data.'</div>';
$inputs[] = $in;
// Criticity - severity.
$severity_select .= html_print_select(
get_priorities(),
'severity',
$severity,
'',
__('All'),
'-1',
true,
false,
false
);
$in = '<div class="filter_input"><label>'.__('Severity').'</label>';
$in .= $severity_select.'</div>';
$inputs[] = $in;
// Event status.
$data = html_print_select(
events_get_all_status(),
@ -929,6 +945,28 @@ $in = '<div class="filter_input"><label>'.__('Free search').'</label>';
$in .= $data.'</div>';
$inputs[] = $in;
if (empty($severity) && $severity !== '0') {
$severity = -1;
}
// Criticity - severity.
$data = html_print_select(
get_priorities(),
'severity',
$severity,
'',
__('All'),
-1,
true,
true,
true,
'',
false
);
$in = '<div class="filter_input"><label>'.__('Severity').'</label>';
$in .= $data.'</div>';
$inputs[] = $in;
$buttons = [];
$buttons[] = [
@ -1083,8 +1121,6 @@ if (is_metaconsole()) {
$adv_inputs[] = $in;
}
// Gap.
$adv_inputs[] = '<div class="filter_input"></div>';
// Date from.
$data = html_print_input_text(
@ -1634,6 +1670,10 @@ function process_datatables_callback(table, settings) {
}
// Uncheck checkbox to select all.
if ($('#checkbox-all_validate_box').length) {
$('#checkbox-all_validate_box').uncheck();
}
}
function process_datatables_item(item) {

View File

@ -87,8 +87,8 @@ if ($layout) {
$id_layout,
true,
true,
$width,
$height,
$bwidth,
$bheight,
'../../',
true,
true,
@ -196,7 +196,6 @@ $ignored_params['refr'] = '';
$('body').css('background-color','<?php echo $layout['background_color']; ?>');
$('body').css('margin','0');
$('body').css('height','100%');
$('body').css('overflow','hidden');
$(".module_graph .menu_graph").css('display','none');

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.742
%define release 200113
%define release 200114
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.742
%define release 200113
%define release 200114
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.742
%define release 200113
%define release 200114
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1098,7 +1098,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` (
`id_name` varchar(600) NOT NULL,
`id_group` int(10) NOT NULL default 0,
`event_type` text NOT NULL,
`severity` int(10) NOT NULL default -1,
`severity` text NOT NULL,
`status` int(10) NOT NULL default -1,
`search` TEXT,
`text_agent` TEXT,

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.742-200113
Version: 7.0NG.742-200114
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.742-200113"
pandora_version="7.0NG.742-200114"
package_cpan=0
package_pandora=1

View File

@ -45,7 +45,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.742";
my $pandora_build = "200113";
my $pandora_build = "200114";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.742";
my $pandora_build = "200113";
my $pandora_build = "200114";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.742
%define release 200113
%define release 200114
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.742
%define release 200113
%define release 200114
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.742"
PI_BUILD="200113"
PI_BUILD="200114"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.742 PS200113";
my $version = "7.0NG.742 PS200114";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.742 PS200113";
my $version = "7.0NG.742 PS200114";
# save program name for logging
my $progname = basename($0);