Merge remote-tracking branch 'origin/develop' into features/oracle

This commit is contained in:
Alejandro Gallardo Escobar 2015-06-22 19:16:01 +02:00
commit 2140d28ef5
37 changed files with 1651 additions and 1329 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 6.0dev-150618 Version: 6.0dev-150622
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '6.0dev'; use constant AGENT_VERSION => '6.0dev';
use constant AGENT_BUILD => '150618'; use constant AGENT_BUILD => '150622';
# Commands to retrieve total memory information in kB # Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => { use constant TOTALMEMORY_CMDS => {

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 6.0dev %define version 6.0dev
%define release 150618 %define release 150622
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 6.0dev %define version 6.0dev
%define release 150618 %define release 150622
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{150618} {150622}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("6.0dev(Build 150618)") #define PANDORA_VERSION ("6.0dev(Build 150622)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(6.0dev(Build 150618))" VALUE "ProductVersion", "(6.0dev(Build 150622))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 6.0dev-150618 Version: 6.0dev-150622
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="6.0dev-150618" pandora_version="6.0dev-150622"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -333,11 +333,14 @@ if (!$id_agente) {
else { else {
$url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente=' . $id_agente . '&offset=' . $offset . $form_params; $url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente=' . $id_agente . '&offset=' . $offset . $form_params;
} }
$table = new stdClass();
if ( defined("METACONSOLE") ) if ( defined("METACONSOLE") )
$table->class = 'alert_list databox'; $table->class = 'alert_list databox';
else else
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->width = '100%'; $table->width = '100%';
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;

View File

@ -466,11 +466,14 @@ if (defined("METACONSOLE")) {
echo "</div>"; echo "</div>";
echo "</form>"; echo "</form>";
} }
}else{ }
ui_pagination ($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . $urlFilter); else {
ui_pagination ($countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . $urlFilter);
html_print_table($table); html_print_table($table);
ui_pagination ($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . $urlFilter); ui_pagination ($countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report=' . $idReport . $urlFilter);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=" . $idReport . "' echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=" . $idReport . "'
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>"; method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
if (defined("METACONSOLE")) if (defined("METACONSOLE"))

View File

@ -51,6 +51,7 @@ if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_us
} }
// Load enterprise extensions // Load enterprise extensions
enterprise_include_once ('include/functions_setup.php'); enterprise_include_once ('include/functions_setup.php');
enterprise_include_once ('include/functions_io.php');
enterprise_include_once ('godmode/setup/setup.php'); enterprise_include_once ('godmode/setup/setup.php');
/* /*

View File

@ -54,7 +54,7 @@ $table->data[0][1] = html_print_select_from_sql (
$table->data[1][0] = __('Remote config directory') . $table->data[1][0] = __('Remote config directory') .
ui_print_help_tip (__("Directory where agent remote configuration is stored."), true); ui_print_help_tip (__("Directory where agent remote configuration is stored."), true);
$table->data[1][1] = html_print_input_text ('remote_config', $config["remote_config"], '', 30, 100, true); $table->data[1][1] = html_print_input_text ('remote_config', io_safe_output($config["remote_config"]), '', 30, 100, true);
$table->data[6][0] = __('Auto login (hash) password'); $table->data[6][0] = __('Auto login (hash) password');
$table->data[6][1] = html_print_input_text ('loginhash_pwd', io_output_password($config["loginhash_pwd"]), '', 15, 15, true); $table->data[6][1] = html_print_input_text ('loginhash_pwd', io_output_password($config["loginhash_pwd"]), '', 15, 15, true);
@ -73,7 +73,7 @@ $table->data[11][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button_ext
$table->data[11][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('https', 0, '', $config["https"], true); $table->data[11][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button ('https', 0, '', $config["https"], true);
$table->data[14][0] = __('Attachment store') . ui_print_help_tip (__("Directory where temporary data is stored."), true); $table->data[14][0] = __('Attachment store') . ui_print_help_tip (__("Directory where temporary data is stored."), true);
$table->data[14][1] = html_print_input_text ('attachment_store', $config["attachment_store"], '', 50, 255, true); $table->data[14][1] = html_print_input_text ('attachment_store', io_safe_output($config["attachment_store"]), '', 50, 255, true);
$table->data[15][0] = __('IP list with API access') . ui_print_help_icon ("ip_api_list", true); $table->data[15][0] = __('IP list with API access') . ui_print_help_icon ("ip_api_list", true);
if (isset($_POST["list_ACL_IPs_for_API"])) { if (isset($_POST["list_ACL_IPs_for_API"])) {

View File

@ -187,7 +187,7 @@ $row++;
$table->data[$row][0] = __('Font path'); $table->data[$row][0] = __('Font path');
$fonts = load_fonts(); $fonts = load_fonts();
$table->data[$row][1] = html_print_select($fonts, 'fontpath', $config["fontpath"], '', '', 0, true); $table->data[$row][1] = html_print_select($fonts, 'fontpath', io_safe_output($config["fontpath"]), '', '', 0, true);
$row++; $row++;

View File

@ -22,7 +22,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC150618'; $build_version = 'PC150622';
$pandora_version = 'v6.0dev'; $pandora_version = 'v6.0dev';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -2404,4 +2404,36 @@ function sort_by_column (&$array_ref, $column_parameter) {
}); });
} }
} }
function array2XML($data, $root = null, $xml = NULL) {
if ($xml == null) {
$xml = simplexml_load_string(
"<?xml version='1.0' encoding='UTF-8'?>\n<" . $root . " />");
}
foreach($data as $key => $value) {
if (is_numeric($key)) {
$key = "item_" . $key;
}
if (is_array($value)) {
$node = $xml->addChild($key);
array2XML($value, $root, $node);
}
else {
$value = htmlentities($value);
if (!is_numeric($value) && !is_bool($value)) {
if (!empty($value)) {
$xml->addChild($key, $value);
}
}
else {
$xml->addChild($key, $value);
}
}
}
return html_entity_decode($xml->asXML());
}
?> ?>

View File

@ -51,7 +51,7 @@ function config_update_value ($token, $value) {
if (!isset ($config[$token])) { if (!isset ($config[$token])) {
$config[$token] = $value; $config[$token] = $value;
return (bool) config_create_value ($token, $value); return (bool) config_create_value ($token, io_safe_input($value));
} }
/* If it has not changed */ /* If it has not changed */
@ -59,9 +59,10 @@ function config_update_value ($token, $value) {
return true; return true;
$config[$token] = $value; $config[$token] = $value;
$value = io_safe_output($value);
$result = db_process_sql_update ('tconfig', $result = db_process_sql_update ('tconfig',
array ('value' => $value), array ('value' => io_safe_input($value)),
array ('token' => $token)); array ('token' => $token));
if ($result === 0) if ($result === 0)
@ -119,7 +120,7 @@ function config_update_config () {
case 'general': case 'general':
if (!config_update_value ('language', (string) get_parameter ('language'))) if (!config_update_value ('language', (string) get_parameter ('language')))
$error_update[] = __('Language code for Pandora'); $error_update[] = __('Language code for Pandora');
if (!config_update_value ('remote_config', io_safe_input((string) get_parameter ('remote_config')))) if (!config_update_value ('remote_config', (string) get_parameter ('remote_config')))
$error_update[] = __('Remote config directory'); $error_update[] = __('Remote config directory');
if (!config_update_value ('loginhash_pwd', io_input_password((string) get_parameter ('loginhash_pwd')))) if (!config_update_value ('loginhash_pwd', io_input_password((string) get_parameter ('loginhash_pwd'))))
$error_update[] = __('Auto login (hash) password'); $error_update[] = __('Auto login (hash) password');
@ -130,7 +131,7 @@ function config_update_config () {
$error_update[] = __('Automatic check for updates'); $error_update[] = __('Automatic check for updates');
if (!config_update_value ('https', (bool) get_parameter ('https'))) if (!config_update_value ('https', (bool) get_parameter ('https')))
$error_update[] = __('Enforce https'); $error_update[] = __('Enforce https');
if (!config_update_value ('attachment_store', io_safe_input((string) get_parameter ('attachment_store')))) if (!config_update_value ('attachment_store', (string) get_parameter ('attachment_store')))
$error_update[] = __('Attachment store'); $error_update[] = __('Attachment store');
if (!config_update_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API'))) if (!config_update_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API')))
$error_update[] = __('IP list with API access'); $error_update[] = __('IP list with API access');
@ -413,7 +414,7 @@ function config_update_config () {
$error_update[] = __('Show QR code header'); $error_update[] = __('Show QR code header');
if (!config_update_value ('status_images_set', (string) get_parameter ('status_images_set'))) if (!config_update_value ('status_images_set', (string) get_parameter ('status_images_set')))
$error_update[] = __('Status icon set'); $error_update[] = __('Status icon set');
if (!config_update_value ('fontpath', io_safe_input((string) get_parameter ('fontpath')))) if (!config_update_value ('fontpath', (string) get_parameter ('fontpath')))
$error_update[] = __('Font path'); $error_update[] = __('Font path');
if (!config_update_value ('font_size', get_parameter('font_size'))) if (!config_update_value ('font_size', get_parameter('font_size')))
$error_update[] = __('Font size'); $error_update[] = __('Font size');
@ -451,7 +452,7 @@ function config_update_config () {
$error_update[] = __('Fixed menu'); $error_update[] = __('Fixed menu');
if (!config_update_value ('paginate_module', get_parameter('paginate_module'))) if (!config_update_value ('paginate_module', get_parameter('paginate_module')))
$error_update[] = __('Paginate module'); $error_update[] = __('Paginate module');
if (!config_update_value ('graphviz_bin_dir', io_safe_input(get_parameter('graphviz_bin_dir')))) if (!config_update_value ('graphviz_bin_dir', get_parameter('graphviz_bin_dir')))
$error_update[] = __('Custom graphviz directory'); $error_update[] = __('Custom graphviz directory');
if (!config_update_value ('networkmap_max_width', get_parameter('networkmap_max_width'))) if (!config_update_value ('networkmap_max_width', get_parameter('networkmap_max_width')))
$error_update[] = __('Networkmap max width'); $error_update[] = __('Networkmap max width');
@ -627,7 +628,7 @@ function config_update_config () {
enterprise_include_once('include/functions_policies.php'); enterprise_include_once('include/functions_policies.php');
$enterprise = enterprise_include_once ('include/functions_skins.php'); $enterprise = enterprise_include_once ('include/functions_skins.php');
if ($enterprise !== ENTERPRISE_NOT_HOOK) { if ($enterprise !== ENTERPRISE_NOT_HOOK) {
$config['relative_path'] = get_parameter('relative_path', io_safe_input($config['relative_path'])); $config['relative_path'] = get_parameter('relative_path', $config['relative_path']);
} }
} }
@ -655,7 +656,7 @@ function config_process_config () {
if (isset ($config['homeurl']) && (strlen($config['homeurl']) > 0)) { if (isset ($config['homeurl']) && (strlen($config['homeurl']) > 0)) {
if ($config['homeurl'][0] != '/') { if ($config['homeurl'][0] != '/') {
$config['homeurl'] = '/'.io_safe_input($config['homeurl']); $config['homeurl'] = '/'.$config['homeurl'];
} }
} }
@ -872,14 +873,14 @@ function config_process_config () {
//after the first uses. //after the first uses.
if (!is_dir($config['attachment_store'])) { if (!is_dir($config['attachment_store'])) {
config_update_value('attachment_store', config_update_value('attachment_store',
io_safe_input($config['homedir']) . '/attachment'); $config['homedir'] . '/attachment');
} }
} }
if (!isset ($config['fontpath'])) { if (!isset ($config['fontpath'])) {
config_update_value('fontpath', config_update_value('fontpath',
io_safe_input($config['homedir']) . '/include/fonts/smallfont.ttf'); $config['homedir'] . '/include/fonts/smallfont.ttf');
} }
if (!isset ($config['style'])) { if (!isset ($config['style'])) {

View File

@ -1442,6 +1442,9 @@ function html_print_table (&$table, $return = false) {
} }
if (empty ($table->border)) { if (empty ($table->border)) {
if (empty($table)) {
$table = new stdClass();
}
$table->border = '0'; $table->border = '0';
} }
@ -1858,7 +1861,7 @@ function html_print_image ($src, $return = false, $options = false,
} }
// New way to show the force_title (cleaner and better performance) // New way to show the force_title (cleaner and better performance)
$output .= 'title="'.io_safe_input_html($options["title"]).'" '; $output .= 'data-title="'.io_safe_input_html($options["title"]).'" ';
$output .= 'data-use_title_for_force_title="1" '; $output .= 'data-use_title_for_force_title="1" ';
} }

View File

@ -0,0 +1,132 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 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.
// Don't use authentication methods.
// This file only uses data retrieved in a request.
require_once ("../../include/config.php");
require_once ("../../include/functions.php");
global $config;
// Get data
$type = (string) get_parameter('type', 'csv');
$data = (string) get_parameter('data');
$data = json_decode(io_safe_output($data), true);
$default_filename = 'data_exported - ' . date($config['date_format']);
$filename = (string) get_parameter('filename', $default_filename);
$filename = io_safe_output($filename);
// Using first-class functions to avoid namespace conflicts
// Type: 'csv'
/* $data = array(
* 'head' => array(<column>,<column>,...,<column>),
* 'data' => array(
* array(<data>,<data>,...,<data>),
* array(<data>,<data>,...,<data>),
* ...,
* array(<data>,<data>,...,<data>),
* )
* );
*/
$output_csv = function ($data, $filename) {
$separator = (string) get_parameter('separator', ';');
$excel_encoding = (bool) get_parameter('excel_encoding', false);
// CSV Output
header ('Content-Type: text/csv; charset=UTF-8');
header ('Content-Disposition: attachment; filename="'.$filename.'.csv"');
// Header
if (!isset($data['head']) || !isset($data['data']))
throw new Exception(__('An error occured exporting the data'));
$head_line = implode($separator, $data['head']);
echo $head_line . "\n";
// Item / data
foreach ($data['data'] as $items) {
$line = implode($separator, $items);
if ($excel_encoding)
echo mb_convert_encoding($line, 'UTF-16LE', 'UTF-8') . "\n";
else
echo $line . "\n";
}
};
// Type: 'json'
/* $data = array(
* array(
* 'key' => <value>,
* 'key' => <value>,
* ...,
* 'key' => <value>
* ),
* array(
* 'key' => <value>,
* 'key' => <value>,
* ...,
* 'key' => <value>
* ),
* ...,
* array(
* 'key' => <value>,
* 'key' => <value>,
* ...,
* 'key' => <value>
* )
* );
*/
$output_json = function ($data, $filename) {
// JSON Output
header ('Content-Type: application/json; charset=UTF-8');
header ('Content-Disposition: attachment; filename="'.$filename.'.json"');
if (version_compare(PHP_VERSION, '5.4.0', '>='))
$json = json_encode($data, JSON_PRETTY_PRINT);
else
$json = json_encode($data);
if ($json !== false)
echo $json;
};
try {
if (!$data)
throw new Exception(__('An error occured exporting the data'));
ob_end_clean();
switch ($type) {
case 'json':
$output_json($data, $filename);
break;
case 'csv':
default:
$output_csv($data, $filename);
break;
}
}
catch (Exception $e) {
die($e->getMessage());
}
exit;
?>

File diff suppressed because it is too large Load Diff

View File

@ -285,7 +285,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
$threshold = true; $threshold = true;
} }
$nbuttons = 2; $nbuttons = 3;
if ($threshold) { if ($threshold) {
$nbuttons++; $nbuttons++;
@ -301,10 +301,16 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
"padding: 4px 4px 4px 4px'> "padding: 4px 4px 4px 4px'>
<a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$homeurl."images/zoom_cross.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>"; <a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$homeurl."images/zoom_cross.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>";
if ($threshold) { if ($threshold) {
$return .= "<a href='javascript:'><img id='menu_threshold_$graph_id' src='".$homeurl."images/chart_curve_threshold.png' alt='".__('Warning and Critical thresholds')."' title='".__('Warning and Critical thresholds')."'></a>"; $return .= " <a href='javascript:'><img id='menu_threshold_$graph_id' src='".$homeurl."images/chart_curve_threshold.png' alt='".__('Warning and Critical thresholds')."' title='".__('Warning and Critical thresholds')."'></a>";
} }
$return .= "<a href='javascript:'><img id='menu_overview_$graph_id' src='".$homeurl."images/chart_curve_overview.png' alt='".__('Overview graph')."' title='".__('Overview graph')."'></a> $return .= " <a href='javascript:'><img id='menu_overview_$graph_id' src='".$homeurl."images/chart_curve_overview.png' alt='".__('Overview graph')."' title='".__('Overview graph')."'></a>";
</div>";
// Export buttons
$return .= " <a href='javascript:'><img id='menu_export_csv_$graph_id' src='".$homeurl."images/csv.png' alt='".__('Export to CSV')."' title='".__('Export to CSV')."'></a>";
// Button disabled. This feature works, but seems that is not useful enough to the final users.
//$return .= " <a href='javascript:'><img id='menu_export_json_$graph_id' src='".$homeurl."images/json.png' alt='".__('Export to JSON')."' title='".__('Export to JSON')."'></a>";
$return .= "</div>";
} }
$extra_width = (int)($width / 3); $extra_width = (int)($width / 3);

View File

@ -185,7 +185,7 @@ function forced_title_callback() {
// into their 'data' prop, the element title will be used for the // into their 'data' prop, the element title will be used for the
// content. // content.
if ($(this).data("use_title_for_force_title")) { if ($(this).data("use_title_for_force_title")) {
var title = $(this).prop("title"); var title = $(this).data("title");
} }
else { else {
var title = $('#forced_title_'+img_id).html(); var title = $('#forced_title_'+img_id).html();

View File

@ -63,7 +63,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '6.0dev'; $version = '6.0dev';
$build = '150618'; $build = '150622';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -254,14 +254,6 @@ echo "<br>";
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Get Report record (to get id_group)
$report = db_get_row ('treport', 'id_report', $id_report);
$report["datetime"] = $datetime;
// The rowspan of the first row is only 2 in controls table. Why is used the same code here and in the items?? // The rowspan of the first row is only 2 in controls table. Why is used the same code here and in the items??

View File

@ -19,38 +19,6 @@ include_once ('include/functions_groups.php');
include_once ('include/functions_netflow.php'); include_once ('include/functions_netflow.php');
enterprise_include_once ('include/functions_metaconsole.php'); enterprise_include_once ('include/functions_metaconsole.php');
function array2XML($data, $root = null, $xml = NULL) {
if ($xml == null) {
$xml = simplexml_load_string(
"<?xml version='1.0' encoding='UTF-8'?>\n<" . $root . " />");
}
foreach($data as $key => $value) {
if (is_numeric($key)) {
$key = "item_" . $key;
}
if (is_array($value)) {
$node = $xml->addChild($key);
array2XML($value, $root, $node);
}
else {
$value = htmlentities($value);
if (!is_numeric($value) && !is_bool($value)) {
if (!empty($value)) {
$xml->addChild($key, $value);
}
}
else {
$xml->addChild($key, $value);
}
}
}
return html_entity_decode($xml->asXML());
}
// Login check // Login check
if (isset ($_GET["direct"])) { if (isset ($_GET["direct"])) {

View File

@ -36,11 +36,10 @@ if ($searchGraphs) {
$filter['id_graph'] = $usergraphs_id; $filter['id_graph'] = $usergraphs_id;
$columns = array('id_graph', 'name', 'description'); $columns = array('id_graph', 'name', 'description');
$count_columns = array('COUNT(id_graph) AS count');
$totalGraphs = db_get_value_filter('tgraph', $filter, $count_columns); $totalGraphs = (int) db_get_value_filter('COUNT(id_graph) AS count', 'tgraph', $filter);
if (! $only_count && (int)$totalGraphs > 0) { if (! $only_count && $totalGraphs > 0) {
$filter['limit'] = $config['block_size']; $filter['limit'] = $config['block_size'];
$filter['offset'] = (int) get_parameter('offset'); $filter['offset'] = (int) get_parameter('offset');
$graphs = db_get_all_rows_filter('tgraph', $filter, $columns); $graphs = db_get_all_rows_filter('tgraph', $filter, $columns);

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0dev %define version 6.0dev
%define release 150618 %define release 150622
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0dev %define version 6.0dev
%define release 150618 %define release 150622
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -38,7 +38,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('graph_res','5'), ('graph_res','5'),
('step_compact','1'), ('step_compact','1'),
('db_scheme_version','6.0dev'), ('db_scheme_version','6.0dev'),
('db_scheme_build','PD150618'), ('db_scheme_build','PD150622'),
('show_unknown','0'), ('show_unknown','0'),
('show_lastalerts','1'), ('show_lastalerts','1'),
('style','pandora'), ('style','pandora'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 6.0dev-150618 Version: 6.0dev-150622
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="6.0dev-150618" pandora_version="6.0dev-150622"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -43,7 +43,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "6.0dev"; my $pandora_version = "6.0dev";
my $pandora_build = "150618"; my $pandora_build = "150622";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 6.0dev %define version 6.0dev
%define release 150618 %define release 150622
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 6.0dev %define version 6.0dev
%define release 150618 %define release 150622
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "6.0dev PS150618"; my $version = "6.0dev PS150622";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "6.0dev PS150618"; my $version = "6.0dev PS150622";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);