Merge branch 'develop' into '253-bit-de-licencia-ux-para-pandora-7'

# Conflicts:
#   pandora_console/extras/pandoradb_migrate_6.0_to_6.1.mysql.sql
#   pandora_console/extras/pandoradb_migrate_6.0_to_6.1.oracle.sql
This commit is contained in:
nramon 2017-02-15 15:49:16 +01:00
commit 165b59656e
109 changed files with 1759 additions and 646 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0dev-170208
Version: 7.0dev-170215
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.0dev-170208"
pandora_version="7.0dev-170215"
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

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0dev';
use constant AGENT_BUILD => '170208';
use constant AGENT_BUILD => '170215';
# 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.0dev
%define release 170208
%define release 170215
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0dev"
PI_BUILD="170208"
PI_BUILD="170215"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{170208}
{170215}
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.0dev(Build 170208)")
#define PANDORA_VERSION ("7.0dev(Build 170215)")
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.0dev(Build 170208))"
VALUE "ProductVersion", "(7.0dev(Build 170215))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0dev-170208
Version: 7.0dev-170215
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.0dev-170208"
pandora_version="7.0dev-170215"
package_pear=0
package_pandora=1

View File

@ -69,19 +69,33 @@ function mainAgentsModules() {
$offset = (int)get_parameter('offset', 0);
$hor_offset = (int)get_parameter('hor_offset', 0);
$block = $config['block_size'];
$agents_id = (array)get_parameter('id_agents2', -1);
$selection_a_m = (int)get_parameter('selection_agent_module');
$modules_selected = (array)get_parameter('module', 0);
$update_item = (string)get_parameter('edit_item','');
$save_serialize = (int)get_parameter('save_serialize', 0);
$groups = users_get_groups ();
if($save_serialize && $update_item == ''){
$unserialize_modules_selected = unserialize_in_temp($config['id_user']."_agent_module", true, 1);
$unserialize_agents_id = unserialize_in_temp($config['id_user']."_agents", true, 1);
if($unserialize_modules_selected){
$modules_selected = $unserialize_modules_selected;
}
if($unserialize_agents_id){
$agents_id = $unserialize_agents_id;
}
}
else{
unserialize_in_temp($config['id_user']."_agent_module", true, 1);
unserialize_in_temp($config['id_user']."_agents", true, 1);
}
$filter_module_groups = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
$filter_module_groups .= '<b>'.__('Module group').'</b>';
$filter_module_groups .= html_print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name",
'modulegroup', $modulegroup, 'this.form.submit()',__('All'), 0, true, false, true, false, 'width: auto;');
$filter_module_groups .= '</form>';
$filter_groups = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
$filter_groups .= '<b>'.__('Group').'</b>';
$filter_groups .= html_print_select_groups(false, "AR", true, 'group_id', $group_id, 'this.form.submit()', '', '', true, false, true, '', false , 'width: auto;');
$filter_groups .= '</form>';
if($modules_selected[0]){
serialize_in_temp($modules_selected, $config['id_user']."_agent_module", 1);
}
if($agents_id[0] != -1 ){
serialize_in_temp($agents_id, $config['id_user']."_agents", 1);
}
$comborefr = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
$comborefr .= '<b>'.__('Refresh').'</b>';
@ -108,6 +122,49 @@ function mainAgentsModules() {
$config['refr'] = $refr;
}
$groups = users_get_groups ();
//groups
$filter_groups_label = '<b>'.__('Group').'</b>';
$filter_groups = html_print_select_groups(false, "AR", true, 'group_id', $group_id, '', '', '', true, false, true, '', false , 'width: auto;');
//groups module
$filter_module_groups_label = '<b>'.__('Module group').'</b>';
$filter_module_groups = html_print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name",
'modulegroup', $modulegroup, '',__('All'), 0, true, false, true, false, 'width: auto;');
$agents_select = array();
if (is_array($id_agents) || is_object($id_agents)){
foreach ($id_agents as $id) {
foreach ($agents as $key => $a) {
if ($key == (int)$id) {
$agents_select[$key] = $key;
}
}
}
}
//agent
$agents = agents_get_group_agents($group_id);
if ((empty($agents)) || $agents == -1) $agents = array();
$filter_agents_label = '<b>'.__('Agents').'</b>';
$filter_agents = html_print_select($agents, 'id_agents2[]', $agents_id, '', '', 0, true, true, true, '', false, "min-width: 180px");
//type show
$selection = array(0 => __('Show common modules'),
1=> __('Show all modules'));
$filter_type_show_label = '<b>'.__('Show common modules').'</b>';
$filter_type_show = html_print_select($selection, 'selection_agent_module', $selection_a_m, '', "", 0, true, false, true, '', false, "min-width: 180px");
//modules
$all_modules = db_get_all_rows_sql("SELECT DISTINCT nombre, id_agente_modulo FROM tagente_modulo WHERE id_agente IN (" . implode(',', array_keys($agents)) . ")");
$filter_modules_label = '<b>'.__('Module').'</b>';
$filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', __('None'), 0, true, true, true, '', false, "min-width: 180px");
//update
$filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true);
$onheader = array('updated_time' => $updated_time, 'fullscreen' => $fullscreen,
'combo_module_groups' => $filter_module_groups,
'combo_groups' => $filter_groups);
@ -121,37 +178,76 @@ function mainAgentsModules() {
// Old style table, we need a lot of special formatting,don't use table function
// Prepare old-style table
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
echo '<table style="width:100%;">';
echo "<tr>";
echo "<td>" . $filter_module_groups . "</td>";
echo "<td>" . $filter_groups . "</td>";
if ($config['pure'] == 1)
echo "<td>" . $comborefr . "</td>";
echo "<td> <strong>" . __("Full screen") . "</strong>" . $fullscreen['text'] . "</td>";
if ($config['pure'] == 1){
echo "<td>" . $comborefr . "</td>";
echo "<td>" . $fullscreen['text'] . "</td>";
}
else{
echo "<td> <span style='float: right;'>" . $fullscreen['text'] . "</span> </td>";
}
echo "</tr>";
echo "</table>";
$agents = '';
$agents = agents_get_group_agents($group_id,array('disabled' => 0));
$agents = array_keys($agents);
$filter_module_group = array('disabled' => 0);
if ($modulegroup > 0) {
$filter_module_group['id_module_group'] = $modulegroup;
if($config['pure'] != 1){
echo '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
echo "<tr>";
echo "<td>" . $filter_groups_label . "</td>";
echo "<td>" . $filter_groups . "</td>";
echo "<td></td>";
echo "<td></td>";
echo "<td>" . $filter_module_groups_label . "</td>";
echo "<td>" . $filter_module_groups . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>" . $filter_agents_label . "</td>";
echo "<td>" . $filter_agents . "</td>";
echo "<td>" . $filter_type_show_label . "</td>";
echo "<td>" . $filter_type_show . "</td>";
echo "<td>" . $filter_modules_label . "</td>";
echo "<td>" . $filter_modules . "</td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan=6 ><span style='float: right; padding-right: 20px;'>" . $filter_update . "</sapn></td>";
echo "</tr>";
echo "</table>";
echo '</form>';
}
$count = 0;
foreach ($agents as $agent) {
$module = agents_get_modules($agent, false,
$filter_module_group, true, false);
if ($module == false) {
unset($agents[$count]);
if($agents_id[0] != -1){
$agents = $agents_id;
$all_modules = array();
$total_pagination = count($agents);
foreach ($modules_selected as $key => $value) {
$all_modules[$value] = io_safe_output(modules_get_agentmodule_name($value));
}
$count++;
}
$total_pagination = count($agents);
$all_modules = agents_get_modules($agents, false,
$filter_module_group, true, false);
else {
$agents = '';
$agents = agents_get_group_agents($group_id,array('disabled' => 0));
$agents = array_keys($agents);
$filter_module_group = array('disabled' => 0);
if ($modulegroup > 0) {
$filter_module_group['id_module_group'] = $modulegroup;
}
$count = 0;
foreach ($agents as $agent) {
$module = agents_get_modules($agent, false,
$filter_module_group, true, false);
if ($module == false) {
unset($agents[$count]);
}
$count++;
}
$total_pagination = count($agents);
$all_modules = agents_get_modules($agents, false,
$filter_module_group, true, false);
}
$modules_by_name = array();
$name = '';
@ -173,8 +269,14 @@ function mainAgentsModules() {
$block = count($modules_by_name);
}
$filter_groups = array ('offset' => (int) $offset,
'limit' => (int) $config['block_size'], 'disabled' => 0,'id_agente'=>$agents);
if($update_item == ''){
$filter_groups = array ('offset' => (int) $offset,
'limit' => (int) $config['block_size'], 'disabled' => 0,'id_agente'=>$agents);
}
else{
$filter_groups = array ('offset' => 0,
'limit' => (int) $config['block_size'], 'disabled' => 0,'id_agente'=>$agents);
}
if ($group_id > 0) {
$filter_groups['id_grupo'] = $group_id;
@ -204,10 +306,11 @@ function mainAgentsModules() {
"sec=extensions&" .
"sec2=extensions/agents_modules&" .
"refr=0&" .
"save_serialize=1&" .
"selection_a_m=" . $selection_a_m . "&" .
"hor_offset=" . $new_hor_offset . "&" .
"offset=" . $offset . "&" .
"group_id=" . $group_id . "&" .
"modulegroup=" . $modulegroup . "'>" .
"offset=" . $offset .
"'>" .
html_print_image("images/arrow_left.png", true,
array('title' => __('Previous modules'))) .
"</a>" .
@ -241,10 +344,11 @@ function mainAgentsModules() {
"extension_in_menu=estado&" .
"sec=extensions&".
"sec2=extensions/agents_modules&".
"save_serialize=1&" .
"selection_a_m=" . $selection_a_m . "&" .
"hor_offset=" . $new_hor_offset . "&".
"offset=" . $offset . "&" .
"group_id=" . $group_id . "&" .
"modulegroup=" . $modulegroup . "'>" .
"offset=" . $offset .
"'>" .
html_print_image(
"images/arrow.png", true,
array('title' => __('More modules'))) .
@ -259,7 +363,8 @@ function mainAgentsModules() {
$filter_agents['id_grupo'] = $group_id;
}
// Prepare pagination
ui_pagination ($total_pagination);
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&' . "hor_offset=" . $hor_offset ."&selection_a_m=" . $selection_a_m;
ui_pagination ($total_pagination, $url);
foreach ($agents as $agent) {
// Get stats for this group
@ -407,3 +512,108 @@ extensions_add_operation_menu_option(__("Agents/Modules view"), 'estado', 'agent
extensions_add_main_function('mainAgentsModules');
?>
<script type="text/javascript">
$(document).ready (function () {
$("#group_id").change (function () {
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_agents_group_json" : 1,
"id_group" : this.value,
"privilege" : "AW",
"keys_prefix" : "_"
},
function (data, status) {
$("#id_agents2").html('');
$("#module").html('');
jQuery.each (data, function (id, value) {
// Remove keys_prefix from the index
id = id.substring(1);
option = $("<option></option>")
.attr ("value", value["id_agente"])
.html (value["nombre"]);
$("#id_agents").append (option);
$("#id_agents2").append (option);
});
},
"json"
);
});
$("#modulegroup").change (function () {
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_modules_group_json" : 1,
"id_module_group" : this.value,
"id_agents" : $("#id_agents2").val(),
"selection" : $("#selection_agent_module").val()
},
function (data, status) {
$("#module").html('');
if(data){
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr ("value", value["id_agente_modulo"])
.html (value["nombre"]);
$("#module").append (option);
});
}
},
"json"
);
});
$("#id_agents2").change (function(){
selection_agent_module();
});
$("#selection_agent_module").change(function() {
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_modules_group_json" : 1,
"id_module_group" : $("#modulegroup").val(),
"id_agents" : $("#id_agents2").val(),
"selection" : $("#selection_agent_module").val()
},
function (data, status) {
$("#module").html('');
if(data){
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr ("value", value["id_agente_modulo"])
.html (value["nombre"]);
$("#module").append (option);
});
}
},
"json"
);
});
selection_agent_module();
});
function selection_agent_module() {
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_modules_group_json" : 1,
"id_module_group" : $("#modulegroup").val(),
"id_agents" : $("#id_agents2").val(),
"selection" : $("#selection_agent_module").val()
},
function (data, status) {
$("#module").html('');
if(data){
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr ("value", value["id_agente_modulo"])
.html (value["nombre"]);
$("#module").append (option);
});
}
},
"json"
);
}
</script>

4
pandora_console/extras/mr/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignorar todo en este directorio
*
# Excepto este archivo
!.gitignore

View File

@ -156,6 +156,7 @@ ALTER TABLE trel_item ADD `id_map` int(11) NOT NULL DEFAULT 0;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 0);
UPDATE tconfig SET value = 'https://firefly.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
-- ---------------------------------------------------------------------
@ -244,3 +245,8 @@ UPDATE tagente_modulo SET cron_interval = '' WHERE cron_interval LIKE '% %';
-- Table `tgraph`
-- ---------------------------------------------------------------------
ALTER TABLE tgraph ADD COLUMN `percentil` int(4) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tnetflow_filter`
-- ---------------------------------------------------------------------
ALTER TABLE tnetflow_filter ADD COLUMN `router_ip` TEXT NOT NULL DEFAULT "";

View File

@ -79,6 +79,7 @@ UPDATE talert_commands SET fields_descriptions = '[\"Integria&#x20;IMS&#x20;API&
INSERT INTO tconfig (token, value) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO tconfig (token, value) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO tconfig (token, value) VALUES ('days_autodisable_deletion', '30');
INSERT INTO tconfig (token, value) VALUES ('MR', 0);
UPDATE tconfig SET value = 'https://firefly.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
-- ---------------------------------------------------------------------
@ -153,3 +154,8 @@ INSERT INTO tagent_custom_fields (name) VALUES ('eHorusID');
-- Table `tgraph`
-- ---------------------------------------------------------------------
ALTER TABLE tgraph ADD COLUMN percentil int(4) unsigned default '0';
-- ---------------------------------------------------------------------
-- Table `tnetflow_filter`
-- ---------------------------------------------------------------------
ALTER TABLE tnetflow_filter ADD COLUMN router_ip CLOB DEFAULT "";

View File

@ -86,3 +86,8 @@ ALTER TABLE talert_actions ADD COLUMN field12_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field13_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field14_recovery TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_actions ADD COLUMN field15_recovery TEXT NOT NULL DEFAULT "";
-- ---------------------------------------------------------------------
-- Table `tnetflow_filter`
-- ---------------------------------------------------------------------
ALTER TABLE tnetflow_filter ADD COLUMN router_ip TEXT NOT NULL DEFAULT "";

View File

@ -26,8 +26,14 @@ if (! file_exists ($config["homedir"] . $license_file)) {
$license_file = 'general/license/pandora_info_en.html';
}
if (!$config["MR"]) {
$config["MR"] = 0;
}
echo '<a class="white_bold footer" target="_blank" href="' . $config["homeurl"] . $license_file. '">';
echo sprintf(__('Pandora FMS %s - Build %s', $pandora_version, $build_version));
echo sprintf(__('Pandora FMS %s - Build %s - MR %s', $pandora_version, $build_version, $config["MR"]));
echo '</a><br />';
echo '<a class="white footer">'. __('Page generated at') . ' '. ui_print_timestamp ($time, true, array ("prominent" => "timestamp")); //Always use timestamp here
echo '</a>';

View File

@ -233,9 +233,15 @@ config_check();
//======================================================
$check_minor_release_available = false;
$pandora_management = check_acl($config['id_user'], 0, "PM");
$check_minor_release_available = db_check_minor_relase_available ();
if ($check_minor_release_available) {
set_pandora_error_for_header('There are one or more minor releases waiting for update, there are required administrator permissions', 'minor release/s available');
}
echo '<div id="alert_messages" style="display: none"></div>';
if ($config["alert_cnt"] > 0) {

View File

@ -75,10 +75,17 @@ var id_user = "<?php echo $config['id_user']; ?>";
var cookie_name = id_user + '-pandora_menu_state';
var cookie_name_encoded = btoa(cookie_name);
var click_display = "<?php echo $config["click_display"]; ?>";
var classic_menu = "<?php echo $config["classic_menu"]; ?>";
var classic_menu = parseInt("<?php echo $config["classic_menu"]; ?>");
if ((isNaN(classic_menu)) || (classic_menu == 0)) {
classic_menu = false;
}
else {
classic_menu = true;
}
if (classic_menu) {
autohidden_menu = true;
autohidden_menu = 1;
}
var menuState = $.cookie(cookie_name_encoded);
@ -239,6 +246,19 @@ $(document).ready( function() {
$('#menu').css('position', 'block');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
$('#menu').mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
if(openedMenu > 1000 && handsInMenu == 0) {
$('#menu').css('width', '145px');
$('#menu').css('position', 'block');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}
}, 2500);
});
}
else {
if(!click_display){
@ -289,26 +309,6 @@ $(document).ready( function() {
});
}
}
/*$('#menu').mouseenter(function() {
$('div#title_menu').show();
handsInMenu = 1;
openTimeMenu = new Date().getTime();
$('#menu').css('width', '145px');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}).mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
if(openedMenu > 1000 && handsInMenu == 0) {
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
}
}, 1500);
});*/
}
else {
$('div#title_menu').hide();
@ -465,23 +465,27 @@ $(document).ready( function() {
//Daniel maya 02/06/2016 Display menu with click --END
}
else {
$('#container').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('ul.submenu').css('left', '144px');
});
$('#main').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('ul.submenu').css('left', '144px');
});
if(!click_display){
$('#container').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '145px');
$('ul.submenu').css('left', '144px');
});
}else{
$('#main').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '145px');
$('ul.submenu').css('left', '144px');
});
}
}
if (classic_menu) {

View File

@ -1014,13 +1014,51 @@ if ($update_module || $create_module) {
$id_category = (int) get_parameter('id_category');
$hour = get_parameter('hour');
$minute = get_parameter('minute');
$mday = get_parameter('mday');
$month = get_parameter('month');
$wday = get_parameter('wday');
$cron_interval = "$minute $hour $mday $month $wday";
if (!cron_check_syntax($cron)) {
$hour_from = get_parameter('hour_from');
$minute_from = get_parameter('minute_from');
$mday_from = get_parameter('mday_from');
$month_from = get_parameter('month_from');
$wday_from = get_parameter('wday_from');
$hour_to = get_parameter('hour_to');
$minute_to = get_parameter('minute_to');
$mday_to = get_parameter('mday_to');
$month_to = get_parameter('month_to');
$wday_to = get_parameter('wday_to');
if ($hour_to != "*") {
$hour_to = "-" . $hour_to;
}
else {
$hour_to = "";
}
if ($minute_to != "*") {
$minute_to = "-" . $minute_to;
}
else {
$minute_to = "";
}
if ($mday_to != "*") {
$mday_to = "-" . $mday_to;
}
else {
$mday_to = "";
}
if ($month_to != "*") {
$month_to = "-" . $month_to;
}
else {
$month_to = "";
}
if ($wday_to != "*") {
$wday_to = "-" . $wday_to;
}
else {
$wday_to = "";
}
$cron_interval = $minute_from . $minute_to . " " . $hour_from . $hour_to . " " . $mday_from . $mday_to . " " . $month_from . $month_to . " " . $wday_from . $wday_to;
if (!cron_check_syntax($cron_interval)) {
$cron_interval = '';
}

View File

@ -499,7 +499,7 @@ if ($agents !== false) {
/* Begin Update tagente.remote 0/1 with remote agent function return */
if(enterprise_hook('config_agents_has_remote_configuration',$agent['id_agente'])){
if(enterprise_hook('config_agents_has_remote_configuration',array($agent['id_agente']))){
db_process_sql_update('tagente', array('remote' => 1),'id_agente = '.$agent['id_agente'].'');
}
else{
@ -584,7 +584,7 @@ if ($agents !== false) {
// Has remote configuration ?
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration',$agent["id_agente"])) {
if (enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]))) {
echo "<a href='index.php?" .
"sec=gagente&" .
"sec2=godmode/agentes/configurar_agente&" .

View File

@ -229,18 +229,53 @@ if ($id_agent_module) {
$cron_interval = explode (" ", $module['cron_interval']);
if (isset ($cron_interval[4])) {
$minute = $cron_interval[0];
$hour = $cron_interval[1];
$mday = $cron_interval[2];
$month = $cron_interval[3];
$wday = $cron_interval[4];
$minute_from = $cron_interval[0];
$min = explode("-", $minute_from);
$minute_from = $min[0];
if (isset($min[1])) {
$minute_to = $min[1];
}
$hour_from = $cron_interval[1];
$h = explode("-", $hour_from);
$hour_from = $h[0];
if (isset($h[1])) {
$hour_to = $h[1];
}
$mday_from = $cron_interval[2];
$md = explode("-", $mday_from);
$mday_from = $md[0];
if (isset($md[1])) {
$mday_to = $md[1];
}
$month_from = $cron_interval[3];
$m = explode("-", $month_from);
$month_from = $m[0];
if (isset($m[1])) {
$month_to = $m[1];
}
$wday_from = $cron_interval[4];
$wd = explode("-", $wday_from);
$wday_from = $wd[0];
if (isset($wd[1])) {
$wday_to = $wd[1];
}
}
else {
$minute = '*';
$hour = '*';
$mday = '*';
$month = '*';
$wday = '*';
$minute_from = '*';
$hour_from = '*';
$mday_from = '*';
$month_from = '*';
$wday_from = '*';
$minute_to = '*';
$hour_to = '*';
$mday_to = '*';
$month_to = '*';
$wday_to = '*';
}
$module_macros = null;
@ -322,11 +357,16 @@ else {
$id_category = 0;
$cron_interval = '* * * * *';
$hour = '*';
$minute = '*';
$mday = '*';
$month = '*';
$wday = '*';
$hour_from = '*';
$minute_from = '*';
$mday_from = '*';
$month_from = '*';
$wday_from = '*';
$hour_to = '*';
$minute_to = '*';
$mday_to = '*';
$month_to = '*';
$wday_to = '*';
$ff_interval = 0;
@ -396,7 +436,7 @@ switch ($moduletype) {
$remote_conf = false;
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
$remote_conf = enterprise_hook('config_agents_has_remote_configuration',$id_agente);
$remote_conf = enterprise_hook('config_agents_has_remote_configuration',array($id_agente));
}
/* Categories is an array containing the allowed module types

View File

@ -108,7 +108,12 @@ $page = get_parameter('page', '');
if (strstr($page, "policy_modules") === false && $id_agent_module) {
if ($config['enterprise_installed'])
$disabledBecauseInPolicy = policies_is_module_in_policy($id_agent_module) && policies_is_module_linked($id_agent_module);
if(policies_is_module_linked($id_agent_module) == 1){
$disabledBecauseInPolicy = 1;
}
else{
$disabledBecauseInPolicy = 0;
}
else
$disabledBecauseInPolicy = false;
if ($disabledBecauseInPolicy)
@ -571,34 +576,55 @@ $table_advanced->data[10][1] = html_print_textarea ('unknown_instructions', 2, 6
$table_advanced->colspan[10][1] = 6;
if (isset($id_agente) && $moduletype == MODULE_DATA) {
$table_advanced->data[11][0] = __('Cron') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour, $minute, $mday, $month, $wday, true, true);
$table_advanced->colspan[11][1] = 6;
$has_remote_conf = enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]));
if ($has_remote_conf) {
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;
$table_advanced->data[12][0] = __('Cron to');
$table_advanced->data[12][1] = html_print_extended_select_for_cron ($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, $disabledBecauseInPolicy, true);
$table_advanced->colspan[12][1] = 6;
}
else {
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, true);
$table_advanced->colspan[11][1] = 6;
$table_advanced->data[12][0] = __('Cron to');
$table_advanced->data[12][1] = html_print_extended_select_for_cron ($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, true, true);
$table_advanced->colspan[12][1] = 6;
}
}
else {
$table_advanced->data[11][0] = __('Cron') .
$table_advanced->data[11][0] = __('Cron from') .
ui_print_help_tip (__('If cron is set the module interval is ignored and the module runs on the specified date and time'), true);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour, $minute, $mday, $month, $wday, true, $disabledBecauseInPolicy);
$table_advanced->data[11][1] = html_print_extended_select_for_cron ($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, $disabledBecauseInPolicy);
$table_advanced->colspan[11][1] = 6;
$table_advanced->data[12][0] = __('Cron to');
$table_advanced->data[12][1] = html_print_extended_select_for_cron ($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, $disabledBecauseInPolicy, true);
$table_advanced->colspan[12][1] = 6;
}
$table_advanced->data[12][0] = __('Timeout');
$table_advanced->data[12][1] = html_print_input_text ('max_timeout', $max_timeout, '', 5, 10, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy). ' ' . ui_print_help_tip (__('Seconds that agent will wait for the execution of the module.'), true);
$table_advanced->data[12][2] = '';
$table_advanced->data[12][3] = __('Retries');
$table_advanced->data[12][4] = html_print_input_text ('max_retries', $max_retries, '', 5, 10, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy). ' ' . ui_print_help_tip (__('Number of retries that the module will attempt to run.'), true);
$table_advanced->colspan[12][4] = 3;
$table_advanced->data[13][0] = __('Timeout');
$table_advanced->data[13][1] = html_print_input_text ('max_timeout', $max_timeout, '', 5, 10, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy). ' ' . ui_print_help_tip (__('Seconds that agent will wait for the execution of the module.'), true);
$table_advanced->data[13][2] = '';
$table_advanced->data[13][3] = __('Retries');
$table_advanced->data[13][4] = html_print_input_text ('max_retries', $max_retries, '', 5, 10, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy). ' ' . ui_print_help_tip (__('Number of retries that the module will attempt to run.'), true);
$table_advanced->colspan[13][4] = 3;
if (check_acl ($config['id_user'], 0, "PM")) {
$table_advanced->data[13][0] = __('Category');
$table_advanced->data[13][1] = html_print_select(
$table_advanced->data[14][0] = __('Category');
$table_advanced->data[14][1] = html_print_select(
categories_get_all_categories('forselect'), 'id_category', $id_category, '', __('None'), 0, true, false, true, "", $disabledBecauseInPolicy);
$table_advanced->colspan[13][1] = 6;
$table_advanced->colspan[14][1] = 6;
}
else {
// Store in a hidden field if is not visible to avoid delete the value
$table_advanced->data[12][4] .= html_print_input_hidden ('id_category', $id_category, true);
$table_advanced->data[13][4] .= html_print_input_hidden ('id_category', $id_category, true);
}
/* Advanced form part */

View File

@ -98,7 +98,7 @@ else {
}
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
if (defined("METACONSOLE")) {
@ -203,7 +203,9 @@ else
$sec = "gagente";
if (isset($config['metaconsole_node_id']) && $config['metaconsole_node_id'] > 0) {
$confirm_bottom = " onsubmit=' return message_check_create();'";
if(isset($config['metaconsole_agent_cache']) && $config['metaconsole_agent_cache'] == 1){
$confirm_bottom = " onsubmit=' return message_check_create();'";
}
}
else
{

View File

@ -187,6 +187,7 @@ foreach ($groups as $group_key => $group_val) {
// Format component groups in tree form
$groups = component_groups_get_groups_tree_recursive($groups_clean,0,0);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox data';
$table->head = array ();

View File

@ -44,6 +44,7 @@ else {
$parent = '';
}
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';

View File

@ -239,7 +239,7 @@ switch ($action) {
case 'SLA_weekly':
case 'SLA_monthly':
case 'SLA_hourly':
case 'availability_graph';
case 'availability_graph':
$description = $item['description'];
$only_display_wrong = $item['only_display_wrong'];
$monday = $item['monday'];
@ -257,6 +257,13 @@ switch ($action) {
$period = $item['period'];
break;
case 'module_histogram_graph':
$description = $item['description'];
$period = $item['period'];
$idAgentModule = $item['id_agent_module'];
$idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $idAgentModule));
break;
case 'SLA_services':
$description = $item['description'];
$period = $item['period'];
@ -1912,12 +1919,14 @@ $(document).ready (function () {
},
function (data, status) {
$("#module").html('');
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr ("value", value["id_agente_modulo"])
.html (value["nombre"]);
$("#module").append (option);
});
if(data){
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr ("value", value["id_agente_modulo"])
.html (value["nombre"]);
$("#module").append (option);
});
}
},
"json"
);
@ -1935,12 +1944,14 @@ $(document).ready (function () {
},
function (data, status) {
$("#module").html('');
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr ("value", value["id_agente_modulo"])
.html (value["nombre"]);
$("#module").append (option);
});
if(data){
jQuery.each (data, function (id, value) {
option = $("<option></option>")
.attr ("value", value["id_agente_modulo"])
.html (value["nombre"]);
$("#module").append (option);
});
}
},
"json"
);
@ -1988,7 +1999,6 @@ $(document).ready (function () {
});
$("#submit-create_item").click(function () {
var type = $('#type').val();
switch (type){
@ -1998,7 +2008,7 @@ $(document).ready (function () {
case 'MTBF': case 'MTTR': case 'prediction_date': case 'projection_graph':
case 'avg_value': case 'max_value': case 'min_value': case 'monitor_report':
case 'database_serialized': case 'sumatory': case 'historical_data':
case 'agent_configuration':
case 'agent_configuration': case 'module_histogram_graph':
if ($("#hidden-id_agent").val() == 0) {
alert( <?php echo "'" . __('Please select Agent'). "'"; ?> );
return false;
@ -2018,7 +2028,7 @@ $(document).ready (function () {
case 'MTBF': case 'MTTR': case 'prediction_date': case 'projection_graph':
case 'avg_value': case 'max_value': case 'min_value': case 'monitor_report':
case 'database_serialized': case 'sumatory': case 'historical_data':
case 'agent_configuration':
case 'agent_configuration': case 'module_histogram_graph':
if ($("#hidden-id_agent").val() == 0) {
alert( <?php echo "'" . __('Please select Agent'). "'"; ?> );
return false;
@ -2609,6 +2619,13 @@ function chooseType() {
$("#row_working_time").show();
break;
case 'module_histogram_graph':
$("#row_description").show();
$("#row_period").show();
$("#row_agent").show();
$("#row_module").show();
break;
case 'SLA_monthly':
case 'SLA_weekly':
case 'SLA_hourly':

View File

@ -1162,6 +1162,7 @@ switch ($action) {
else
$style['label'] = '';
break;
case 'module_histogram_graph':
case 'agent_configuration':
case 'alert_report_agent':
case 'alert_report_module':
@ -1489,6 +1490,7 @@ switch ($action) {
else
$style['label'] = '';
break;
case 'module_histogram_graph':
case 'agent_configuration':
case 'alert_report_agent':
case 'alert_report_module':

View File

@ -1109,13 +1109,12 @@ function loadFieldsFromDB(item) {
}
});
if (data.type == 6 || data.type == 7 || data.type == 8) {
$("#period_row").css('display', '');
if (data.type == 6 || data.type == 7 || data.type == 8 || data.type == 1) {
$("#period_row." + item).css('display', '');
}
else if (data.type == 2) {
$("#period_row").css('display', 'none');
$("#period_row." + item).css('display', 'none');
}
@ -1265,7 +1264,7 @@ function hiddenFields(item) {
$("#percentile_item_row_4." + item).css('display', '');
$("#period_row").css('display', 'none');
$("#period_row." + item).css('display', 'none');
$("#period_row." + item).css('display', '');
$("#size_row").css('display', 'none');
$("#size_row." + item).css('display', '');
@ -3070,7 +3069,6 @@ function unselectAll() {
function click_button_toolbox(id) {
unselectAll();
selectedItem = null;
switch (id) {
case 'static_graph':
toolbuttonActive = creationItem = 'static_graph';
@ -3088,6 +3086,7 @@ function click_button_toolbox(id) {
case 'simple_value':
toolbuttonActive = creationItem = 'simple_value';
toggle_item_palette();
$("#period_row." + id).css('display', 'none');
break;
case 'label':
toolbuttonActive = creationItem = 'label';

View File

@ -186,14 +186,14 @@ $row++;
$table_styles->data[$row][0] = __('Custom logo') . ui_print_help_icon("custom_logo", true);
if(enterprise_installed()){
$ent_files = list_files('enterprise/images/custom_logo', "png", 1, 0);
$open_files = list_files('images/custom_logo', "png", 1, 0);
$table_styles->data[$row][1] = html_print_select(
list_files('enterprise/images/custom_logo', "png", 1, 0), 'custom_logo',
$config["custom_logo"], '', '', '',true,false,true,'',$open,'width:240px');
$table_styles->data[$row][1] = html_print_select(
array_merge($ent_files, $open_files), 'custom_logo',
$config["custom_logo"], '', '', '',true,false,true,'',$open,'width:240px');
}
else{
$table_styles->data[$row][1] = html_print_select(
list_files('images/custom_logo', "png", 1, 0), 'custom_logo',
$config["custom_logo"], '', '', '',true,false,true,'',$open,'width:240px');
@ -214,7 +214,7 @@ $table_styles->data[$row][0] = __('Custom logo in login') . ui_print_help_icon("
$row++;
$table_styles->data[$row][0] = __('Disable Pandora FMS on graphs');
$table_styles->data[$row][0] = __('Disable logo in graphs');
$table_styles->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button_extended ('fixed_graph', 1, '', $config["fixed_graph"], $open, '','',true) .
'&nbsp;&nbsp;';

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

View File

@ -0,0 +1,105 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2012 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.
// Only accesible by ajax
if (is_ajax ()) {
global $config;
check_login();
$updare_rr = get_parameter('updare_rr', 0);
if ($updare_rr) {
$number = get_parameter('number');
$dir = $config["homedir"]."/extras/mr";
$file = "$dir/$number.sql";
$dangerous_query = false;
$mr_file = fopen($file, "r");
while (!feof($mr_file)) {
$line = fgets($mr_file);
if ((preg_match("/^drop/", $line)) ||
(preg_match("/^truncate table/", $line))) {
$dangerous_query = true;
}
}
if ($dangerous_query) {
$error_file = fopen($config["homedir"] . "/extras/mr/error.txt", "w");
$message = "The sql file contains a dangerous query";
fwrite($error_file, $message);
fclose($error_file);
}
else {
if (file_exists($dir) && is_dir($dir)) {
if (is_readable($dir)) {
if ($config["MR"] >= $number) {
if (!file_exists($dir."/updated") || !is_dir($dir."/updated")) {
mkdir($dir."/updated");
}
$file_dest = "$dir/updated/$number.sql";
if (copy($file, $file_dest)) {
unlink($file);
}
}
else {
$result = db_run_sql_file($file);
if ($result) {
$update_config = update_config_token("MR", $number);
if ($update_config) {
$config["MR"] = $number;
}
if ($config["MR"] == $number) {
if (!file_exists($dir."/updated") || !is_dir($dir."/updated")) {
mkdir($dir."/updated");
}
$file_dest = "$dir/updated/$number.sql";
if (copy($file, $file_dest)) {
unlink($file);
}
}
}
else {
$error_file = fopen($config["homedir"] . "/extras/mr/error.txt", "w");
$message = "An error occurred while updating the database schema to the minor release " . $number;
fwrite($error_file, $message);
fclose($error_file);
}
}
}
else {
$error_file = fopen($config["homedir"] . "/extras/mr/error.txt", "w");
$message = "The directory ' . $dir . ' should have read permissions in order to update the database schema";
fwrite($error_file, $message);
fclose($error_file);
}
}
else {
$error_file = fopen($config["homedir"] . "/extras/mr/error.txt", "w");
$message = "The directory ' . $dir . ' does not exist";
fwrite($error_file, $message);
fclose($error_file);
}
}
echo $message;
return;
}
}
?>

View File

@ -56,7 +56,12 @@ $no_login_msg = "";
// Don't change the format, it is parsed by applications
switch($info) {
case 'version':
echo 'Pandora FMS ' . $pandora_version . ' - ' . $build_version;
if (!$config["MR"]) {
$config["MR"] = 0;
}
echo 'Pandora FMS ' . $pandora_version . ' - ' . $build_version . " MR" . $config["MR"];
exit;
}

View File

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

View File

@ -37,9 +37,9 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null,
// Non-persistent connection: This will help to avoid mysql errors like "has gone away" or locking problems
// If you want persistent connections change it to mysql_pconnect().
if ($config["mysqli"] === true) {
if ($config["mysqli"]) {
$connect_id = mysqli_connect($host, $user, $pass, $db, $port);
if (mysqli_connect_error() > 0) {
if (mysqli_connect_errno() > 0) {
return false;
}
db_change_cache_id ($db, $host);
@ -1080,7 +1080,7 @@ function mysql_db_get_all_row_by_steps_sql($new = true, &$result, $sql = null) {
function mysql_db_process_sql_begin() {
global $config;
if ($config["mysqli"] === true) {
if ($config["mysqli"]) {
mysqli_query ($config['dbconnection'], 'SET AUTOCOMMIT = 0');
mysqli_query ($config['dbconnection'], 'START TRANSACTION');
}
@ -1096,7 +1096,7 @@ function mysql_db_process_sql_begin() {
function mysql_db_process_sql_commit() {
global $config;
if ($config["mysqli"] === true) {
if ($config["mysqli"]) {
mysqli_query ($config['dbconnection'], 'COMMIT');
mysqli_query ($config['dbconnection'], 'SET AUTOCOMMIT = 1');
}
@ -1112,7 +1112,7 @@ function mysql_db_process_sql_commit() {
function mysql_db_process_sql_rollback() {
global $config;
if ($config["mysqli"] === true) {
if ($config["mysqli"]) {
mysqli_query ($config['dbconnection'], 'ROLLBACK ');
mysqli_query ($config['dbconnection'], 'SET AUTOCOMMIT = 1');
}
@ -1144,7 +1144,7 @@ function mysql_safe_sql_string($string) {
function mysql_db_get_last_error() {
global $config;
if ($config["mysqli"] === true) {
if ($config["mysqli"]) {
return mysqli_error();
}
else {
@ -1188,7 +1188,7 @@ function mysql_get_system_time() {
function mysql_db_get_type_field_table($table, $field) {
global $config;
if ($config["mysqli"] === true) {
if ($config["mysqli"]) {
$result = mysqli_query($config['dbconnection'], 'SELECT parameters FROM ' . $table);
return mysqli_fetch_field_direct($result, $field);
@ -1221,7 +1221,7 @@ function mysql_db_get_table_count($sql, $search_history_db = false) {
// Connect to the history DB
if (! isset ($config['history_db_connection']) || $config['history_db_connection'] === false) {
if ($config["mysqli"] === true) {
if ($config["mysqli"]) {
$config['history_db_connection'] = mysqli_connect_db ($config['history_db_host'], $config['history_db_user'], io_output_password($config['history_db_pass']), $config['history_db_name'], $config['history_db_port'], false);
}
else {
@ -1272,7 +1272,7 @@ function mysql_db_process_file ($path, $handle_error = true) {
$query .= $sql_line;
if (preg_match("/;[\040]*\$/", $sql_line)) {
if ($config["mysqli"] === true) {
if ($config["mysqli"]) {
$query_result = mysqli_query($config['dbconnection'], $query);
}
else {
@ -1315,4 +1315,76 @@ function mysql_db_process_file ($path, $handle_error = true) {
return false;
}
}
// ---------------------------------------------------------------
// Initiates a transaction and run the queries of an sql file
// ---------------------------------------------------------------
function db_run_sql_file ($location) {
global $config;
// Load file
$commands = file_get_contents($location);
// Delete comments
$lines = explode("\n", $commands);
$commands = '';
foreach ($lines as $line) {
$line = trim($line);
if ($line && !preg_match('/^--/', $line) && !preg_match('/^\/\*/', $line)) {
$commands .= $line;
}
}
// Convert to array
$commands = explode(";", $commands);
if ($config['mysqli']) {
$mysqli = new mysqli($config["dbhost"], $config["dbuser"], $config["dbpass"], $config["dbname"], $config["dbport"]);
// Run commands
$mysqli->query($config['dbconnection'], 'SET AUTOCOMMIT = 0');
$mysqli->query($config['dbconnection'], 'START TRANSACTION');
}
else {
// Run commands
mysql_db_process_sql_begin(); // Begin transaction
}
foreach ($commands as $command) {
if (trim($command)) {
if ($config['mysqli']) {
$result = $mysqli->query($command);
}
else {
$result = mysql_query($command);
}
if (!$result) {
break; // Error
}
}
}
if ($result) {
if ($config['mysqli']) {
$mysqli->query($config['dbconnection'], 'COMMIT');
$mysqli->query($config['dbconnection'], 'SET AUTOCOMMIT = 1');
}
else {
mysql_db_process_sql_commit(); // Save results
}
return true;
}
else {
if ($config['mysqli']) {
$mysqli->query($config['dbconnection'], 'ROLLBACK ');
$mysqli->query($config['dbconnection'], 'SET AUTOCOMMIT = 1');
}
else {
mysql_db_process_sql_rollback(); // Undo results
}
return false;
}
}
?>

View File

@ -2616,6 +2616,7 @@ function date2strftime_format($date_format) {
'O' => '%z',
'T' => '%Z',
'%' => '%%',
'G' => '%k',
);
$return = "";
@ -2666,6 +2667,46 @@ function pandora_setlocale() {
str_replace(array_keys($replace_locale), $replace_locale, $user_language));
}
function update_config_token ($cfgtoken, $cfgvalue) {
global $config;
$delete = db_process_sql ("DELETE FROM tconfig WHERE token = '$cfgtoken'");
$insert = db_process_sql ("INSERT INTO tconfig (token, value) VALUES ('$cfgtoken', '$cfgvalue')");
if ($delete && $insert) {
return true;
}
else {
return false;
}
}
function get_number_of_mr() {
global $config;
$dir = $config["homedir"]."/extras/mr";
$mr_size = array();
if (file_exists($dir) && is_dir($dir)) {
if (is_readable($dir)) {
$files = scandir($dir); // Get all the files from the directory ordered by asc
if ($files !== false) {
$pattern = "/^\d+\.sql$/";
$sqlfiles = preg_grep($pattern, $files); // Get the name of the correct files
$pattern = "/\.sql$/";
$replacement = "";
$sqlfiles_num = preg_replace($pattern, $replacement, $sqlfiles);
foreach ($sqlfiles_num as $num) {
$mr_size[] = $num;
}
}
}
}
return $mr_size;
}
function remove_right_zeros ($value) {
$is_decimal = explode(".", $value);
if (isset($is_decimal[1])) {

View File

@ -1672,4 +1672,47 @@ function db_process_file ($path, $handle_error = true) {
}
}
/**
* Search for minor release files.
*
* @return bool Return if minor release is available or not
*/
function db_check_minor_relase_available () {
global $config;
$dir = $config["homedir"]."/extras/mr";
$have_minor_release = false;
if (file_exists($dir) && is_dir($dir)) {
if (is_readable($dir)) {
$files = scandir($dir); // Get all the files from the directory ordered by asc
if ($files !== false) {
$pattern = "/^\d+\.sql$/";
$sqlfiles = preg_grep($pattern, $files); // Get the name of the correct files
$files = null;
$pattern = "/\.sql$/";
$replacement = "";
$sqlfiles_num = preg_replace($pattern, $replacement, $sqlfiles); // Get the number of the file
if ($sqlfiles_num) {
foreach ($sqlfiles_num as $sqlfile_num) {
if ($config["MR"] < $sqlfile_num) {
$have_minor_release = true;
}
}
}
}
}
}
if ($have_minor_release) {
return true;
}
else {
return false;
}
}
?>

View File

@ -581,7 +581,7 @@ function groups_get_status ($id_group = 0, $strict_user = false) {
$data['agent_unknown'] = $groups_status['_agents_unknown_'];
} else {
$data = reporting_get_group_stats($id_group);
$data = reporting_get_group_stats_resume($id_group);
}
if ($data['monitor_alerts_fired'] > 0) {

View File

@ -819,7 +819,7 @@ function html_print_extended_select_for_time ($name, $selected = '',
*
* @return string HTML code if return parameter is true.
*/
function html_print_extended_select_for_cron ($hour = '*', $minute = '*', $mday = '*', $month = '*', $wday = '*', $return = false, $disabled = false) {
function html_print_extended_select_for_cron ($hour = '*', $minute = '*', $mday = '*', $month = '*', $wday = '*', $return = false, $disabled = false, $to = false) {
# Hours
for ($i = 0; $i < 24; $i++) {
@ -862,11 +862,20 @@ function html_print_extended_select_for_cron ($hour = '*', $minute = '*', $mday
$table->head[3] = __('Month');
$table->head[4] = __('Week day');
$table->data[0][0] = html_print_select ($hours, 'hour', $hour, '', __('Any'), '*', true, false, false,'',$disabled);
$table->data[0][1] = html_print_select ($minutes, 'minute', $minute, '', __('Any'), '*', true, false, false,'',$disabled);
$table->data[0][2] = html_print_select ($mdays, 'mday', $mday, '', __('Any'), '*', true, false, false,'',$disabled);
$table->data[0][3] = html_print_select ($months, 'month', $month, '', __('Any'), '*', true, false, false,'',$disabled);
$table->data[0][4] = html_print_select ($wdays, 'wday', $wday, '', __('Any'), '*', true, false, false,'',$disabled);
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][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][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);
}
return html_print_table ($table, $return);
}

View File

@ -231,7 +231,7 @@ function modules_copy_agent_module_to_agent ($id_agent_module, $id_destiny_agent
if ($module['id_modulo'] == MODULE_DATA) {
if (enterprise_installed()) {
if (enterprise_hook('config_agents_has_remote_configuration',$id_agente)) {
if (enterprise_hook('config_agents_has_remote_configuration',array($id_agente))) {
$result = enterprise_hook(
'config_agents_copy_agent_module_to_agent',
array($id_agent_module, $id_new_module));

View File

@ -295,6 +295,7 @@ function netflow_data_table ($data, $start_date, $end_date, $aggregate, $unit) {
foreach ($data['sources'] as $source => $null) {
$table->style[$j+1] = 'padding: 4px';
$table->align[$j+1] = "right";
$table->headstyle[$j+1] = 'text-align: right;';
$table->head[$j+1] = $source;
$source_index[$j] = $source;
$source_count++;

View File

@ -448,6 +448,7 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
enterprise_include_once('include/functions_pandora_networkmap.php');
}
$count = 0;
foreach ($relations as $key => $relation) {
if (($relation['parent_type'] == 1) && ($relation['child_type'] == 1)) {
$id_target_agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']);
@ -471,6 +472,8 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
}
$item = array();
$item['id'] = $count;
$count++;
if (enterprise_installed()) {
$item['id_db'] = get_relation_id($relation);
}

View File

@ -500,6 +500,12 @@ function reporting_make_reporting_data($report = null, $id_report,
$force_width_chart,
$force_height_chart);
break;
case 'module_histogram_graph':
$report['contents'][] = reporting_enterprise_module_histogram_graph(
$report,
$content,
$pdf);
break;
}
}
@ -5258,7 +5264,12 @@ function reporting_availability_graph($report, $content, $pdf=false) {
}
$i++;
}
$data['sla_value'] = ($data['time_ok']/($data['time_ok']+$data['time_error']))*100;
if (($data['time_ok']+$data['time_error']) > 0 ) {
$data['sla_value'] = ($data['time_ok']/($data['time_ok']+$data['time_error']))*100;
}
else {
$data['sla_value'] = 0;
}
$data['sla_fixed'] = sla_truncate($data['sla_value'], $config['graph_precision'] );
}
else{
@ -6726,22 +6737,104 @@ function reporting_get_group_stats_resume ($id_group = 0, $access = 'AR') {
else {
if (!empty($id_group)) {
//check tags for user
$tags = db_get_value("tags", "tusuario_perfil", "id_usuario" , $config['id_user']);
if($tags){
$tags_sql = " AND tae.id_agente_modulo IN ( SELECT id_agente_modulo
FROM ttag_module
WHERE id_tag IN ($tags) ) ";
}
else{
$tags_sql = "";
}
if(is_array($id_group)){
$id_group = implode("," , $id_group);
}
//for stats modules
$sql = "SELECT tg.id_grupo as id, tg.nombre as name,
SUM(ta.normal_count) as monitor_ok,
SUM(ta.warning_count) as monitor_warning,
SUM(ta.critical_count) as monitor_critical,
SUM(ta.unknown_count) as monitor_unknown,
SUM(ta.notinit_count) as monitor_not_init,
count(ta.nombre) as total_agents
FROM tagente ta, tgrupo tg
WHERE tg.id_grupo = ta.id_grupo
AND ta.id_grupo = ". $id_group ."
GROUP BY ta.id_grupo;";
SUM(tae.estado=0) as monitor_ok,
SUM(tae.estado=1) as monitor_critical,
SUM(tae.estado=2) as monitor_warning,
SUM(tae.estado=3) as monitor_unknown,
SUM(tae.estado=4) as monitor_not_init,
COUNT(tae.estado) as monitor_total
FROM
tagente_estado tae,
tagente ta,
tagente_modulo tam,
tgrupo tg
WHERE 1=1
AND tae.id_agente = ta.id_agente
AND tae.id_agente_modulo = tam.id_agente_modulo
AND ta.id_grupo = tg.id_grupo
AND tam.disabled = 0
AND ta.disabled = 0
AND ta.id_grupo IN ($id_group) $tags_sql
GROUP BY tg.id_grupo;";
$data_array = db_get_all_rows_sql($sql);
$data = $data_array[0];
// Get alerts configured, except disabled
$data["monitor_alerts"] += groups_monitor_alerts ($group_array) ;
// Get alert configured currently FIRED, except disabled
$data["monitor_alerts_fired"] += groups_monitor_fired_alerts ($group_array);
//for stats agents
$sql = "SELECT tae.id_agente id_agente, tg.id_grupo id_grupo,
SUM(tae.estado=0) as monitor_agent_ok,
SUM(tae.estado=1) as monitor_agent_critical,
SUM(tae.estado=2) as monitor_agent_warning,
SUM(tae.estado=3) as monitor_agent_unknown,
SUM(tae.estado=4) as monitor_agent_not_init,
COUNT(tae.estado) as monitor_agent_total
FROM
tagente_estado tae,
tagente ta,
tagente_modulo tam,
tgrupo tg
WHERE 1=1
AND tae.id_agente = ta.id_agente
AND tae.id_agente_modulo = tam.id_agente_modulo
AND ta.id_grupo = tg.id_grupo
AND tam.disabled = 0
AND ta.disabled = 0
AND ta.id_grupo IN ($id_group) $tags_sql
GROUP BY tae.id_agente;";
$data_array_2 = db_get_all_rows_sql($sql);
if (is_array($data_array_2) || is_object($data_array_2)){
foreach ($data_array_2 as $key => $value) {
if($value['monitor_agent_critical'] != 0){
$data['agent_critical'] ++;
}
elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] != 0){
$data['agent_warning'] ++;
}
elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] == 0 &&
$value['monitor_agent_unknown'] != 0){
$data['agent_unknown'] ++;
}
elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] == 0 &&
$value['monitor_agent_unknown'] == 0 && $value['monitor_agent_ok'] != 0){
$data['agent_ok'] ++;
}
elseif($value['monitor_agent_critical'] == 0 && $value['monitor_agent_warning'] == 0 &&
$value['monitor_agent_unknown'] == 0 && $value['monitor_agent_ok'] == 0 &&
$value['monitor_agent_not_init'] != 0){
$data['agent_not_init'] ++;
}
$data['total_agents'] ++;
}
}
// Get total count of monitors for this group, except disabled.
$data["monitor_checks"] = $data["monitor_not_init"] + $data["monitor_unknown"] + $data["monitor_warning"] + $data["monitor_critical"] + $data["monitor_ok"];
@ -10244,6 +10337,7 @@ function reporting_label_macro ($item, $label) {
}
break;
case 'simple_graph':
case 'module_histogram_graph':
case 'custom_graph':
case 'simple_baseline_graph':
case 'event_report_module':

View File

@ -318,6 +318,9 @@ function reporting_html_print_report($report, $mini = false, $report_info = 1) {
case 'SLA_services':
reporting_enterprise_html_SLA_services($table, $item, $mini);
break;
case 'module_histogram_graph':
reporting_enterprise_html_module_histogram_graph($table, $item, $mini);
break;
}
if ($item['type'] == 'agent_module')

View File

@ -522,7 +522,8 @@ function reports_get_report_types ($template = false, $not_editor = false) {
$types['availability_graph'] = array('optgroup' => __('Graphs'),
'name' => __('Availability graph'));
$types['module_histogram_graph'] = array('optgroup' => __('Graphs'),
'name' => __('Module Histogram graph'));
$types['TTRT'] = array('optgroup' => __('ITIL'),
'name' => __('TTRT'));

View File

@ -615,20 +615,20 @@ function ui_print_group_icon_path ($id_group, $return = false, $path = "images/g
*/
function ui_print_os_icon ($id_os, $name = true, $return = false,
$apply_skin = true, $networkmap = false, $only_src = false,
$relative = false, $options = false) {
$relative = false, $options = false, $big_icons = false) {
$subfolter = 'os_icons';
$subfolder = 'os_icons';
if ($networkmap) {
$subfolter = 'networkmap';
$subfolder = 'networkmap';
}
if ($big_icons)
$subfolder .= '/so_big_icons';
$icon = (string) db_get_value ('icon_name', 'tconfig_os', 'id_os', (int) $id_os);
$os_name = get_os_name ($id_os);
if (empty ($icon)) {
if ($only_src) {
$output = html_print_image("images/" . $subfolter . "/unknown.png",
$output = html_print_image("images/" . $subfolder . "/unknown.png",
true, $options, true, $relative, false, true);
}
else {
@ -637,18 +637,18 @@ function ui_print_os_icon ($id_os, $name = true, $return = false,
}
else if ($apply_skin) {
if ($only_src) {
$output = html_print_image("images/" . $subfolter . "/" . $icon, true, $options, true, $relative, false, true);
$output = html_print_image("images/" . $subfolder . "/" . $icon, true, $options, true, $relative, false, true);
}
else {
if (!isset($options['title'])) {
$options['title'] = $os_name;
}
$output = html_print_image("images/" . $subfolter . "/" . $icon, true, $options, false, $relative, false, true);
$output = html_print_image("images/" . $subfolder . "/" . $icon, true, $options, false, $relative, false, true);
}
}
else
//$output = "<img src='images/os_icons/" . $icon . "' alt='" . $os_name . "' title='" . $os_name . "'>";
$output = "images/" . $subfolter . "/" . $icon;
$output = "images/" . $subfolder . "/" . $icon;
if ($name === true) {
$output .= '&nbsp;&nbsp;' . $os_name;

View File

@ -273,17 +273,29 @@ if (empty($colors)) {
}
foreach ($colors as $i => $color) {
$rgb['border'] = html_html2rgb($color['border']);
$rgb_color[$i]['border']['R'] = $rgb['border'][0];
$rgb_color[$i]['border']['G'] = $rgb['border'][1];
$rgb_color[$i]['border']['B'] = $rgb['border'][2];
if (isset ($color['border'])) {
$rgb['border'] = html_html2rgb($color['border']);
$rgb['color'] = html_html2rgb($color['color']);
$rgb_color[$i]['color']['R'] = $rgb['color'][0];
$rgb_color[$i]['color']['G'] = $rgb['color'][1];
$rgb_color[$i]['color']['B'] = $rgb['color'][2];
if (isset($rgb['border'])) {
$rgb_color[$i]['border']['R'] = $rgb['border'][0];
$rgb_color[$i]['border']['G'] = $rgb['border'][1];
$rgb_color[$i]['border']['B'] = $rgb['border'][2];
}
}
$rgb_color[$i]['alpha'] = $color['alpha'];
if (isset ($color['color'])) {
$rgb['color'] = html_html2rgb($color['color']);
if (isset($rgb['color'])) {
$rgb_color[$i]['color']['R'] = $rgb['color'][0];
$rgb_color[$i]['color']['G'] = $rgb['color'][1];
$rgb_color[$i]['color']['B'] = $rgb['color'][2];
}
}
if (isset ($color['alpha'])) {
$rgb_color[$i]['alpha'] = $color['alpha'];
}
}
//add for report with max 15 modules comparation repeat
$countlegend = count($legend);

View File

@ -141,19 +141,37 @@ function delete_link(source_id, source_module_id, target_id, target_module_id, i
url: action="ajax.php",
success: function (data) {
if (data['correct']) {
do {
found = -1;
var found = -1;
jQuery.each(graph.links, function(i, element) {
if ((element.source.id_db == source_id)
&& (element.target.id_db == target_id)) {
found = i;
}
});
if (found != -1)
graph.links.splice(found, 1);
jQuery.each(graph.links, function(i, element) {
if (element.id_db == id_link) {
found = i;
}
});
if (found != -1) {
graph.links.splice(found, 1);
}
while (found != -1);
$("#layer_graph_links_" + networkmap_id).remove();
$("#layer_graph_nodes_" + networkmap_id).remove();
window.layer_graph_links = window.layer_graph
.append("g")
.attr("id", "layer_graph_links_" + networkmap_id);
window.layer_graph_nodes = window.layer_graph
.append("g")
.attr("id", "layer_graph_nodes_" + networkmap_id);
force.nodes(graph.nodes)
.links(graph.links)
.start();
window.node = layer_graph_nodes.selectAll(".node");
window.link = layer_graph_links.selectAll(".link");
draw_elements_graph();
init_drag_and_drop();
set_positions_graph();
draw_elements_graph();
set_positions_graph();
@ -163,6 +181,7 @@ function delete_link(source_id, source_module_id, target_id, target_module_id, i
}
});
}
/*
else {
do {
found = -1;
@ -181,7 +200,7 @@ function delete_link(source_id, source_module_id, target_id, target_module_id, i
draw_elements_graph();
set_positions_graph();
}
*/
}
function update_fictional_node(id_db_node) {
@ -483,6 +502,8 @@ function update_link(row_index, id_link) {
params.push("id_link=" + id_link);
params.push("interface_source=" + interface_source);
params.push("interface_target=" + interface_target);
params.push("source_text=" + text_source_interface);
params.push("target_text=" + text_target_interface);
params.push("page=enterprise/operation/agentes/pandora_networkmap.view");
jQuery.ajax ({
@ -501,116 +522,70 @@ function update_link(row_index, id_link) {
$("select[name='interface_target_" + row_index + "'] option[value='" + interface_target + "']")
.prop("selected", true);
if (interface_source == 0) {
jQuery.each(graph.links, function(i, link_each) {
if (link_each.id_db == id_link) {
//Found
graph.links[i].arrow_start = "";
graph.links[i].arrow_start = "";
graph.links[i].text_start = text_source_interface;
var id = "";
var index = -1;
$.each(graph.links, function(j, link) {
if (link['id_db'] == id_link) {
index = j;
id = String(id_link);
}
});
//Remove the arrow
$("#link_id_" + id_link)
.attr("marker-start", "");
delete_link_from_id(index);
$("tspan")
.filter(function() {
var textPath = $(this).parent();
if ($(textPath).attr('href') == "#link_id_" + id_link)
return true;
else return false;
})
.html(Array(25).join(" ") + text_source_interface);
}
});
var temp_link = {};
temp_link["id_db"] = String(data['id_db_link']);
if (data['type_source'] == 1) {
temp_link["arrow_start"] = "module";
temp_link["id_module_start"] = interface_source;
}
else {
jQuery.each(graph.links, function(i, link_each) {
if (link_each.id_db == id_link) {
//Found
if (link_each.arrow_start == "") {
graph.links[i].id_db = data['id_link_change'];
}
graph.links[i].arrow_start = "module";
graph.links[i].id_module_start = interface_source;
graph.links[i].text_start = text_source_interface;
//Added th arrow
$("#link_id_" + id_link)
.attr("marker-start",
"url(#interface_start_1)");
$("tspan")
.filter(function() {
var textPath = $(this).parent();
if ($(textPath).attr('href') == "#link_id_" + id_link)
return true;
else return false;
})
.html(Array(25).join(" ") + text_source_interface);
}
});
temp_link["arrow_start"] = "";
temp_link["id_agent_start"] = interface_source;
temp_link["id_module_start"] = 0;
}
if (interface_target == 0) {
jQuery.each(graph.links, function(i, link_each) {
if (link_each.id_db == id_link) {
//Found
graph.links[i].arrow_end = "";
graph.links[i].id_module_end = 0;
graph.links[i].text_end = text_target_interface;
//Remove the arrow
$("#link_id_" + id_link)
.attr("marker-end", "");
$("tspan")
.filter(function() {
var textPath = $(this).parent();
if ($(textPath).attr('href') == "#link_reverse_id_" + id_link)
return true;
else return false;
})
.html(Array(25).join(" ") + text_target_interface);
}
});
if (data['type_target'] == 1) {
temp_link["arrow_end"] = "module";
temp_link["id_module_end"] = interface_target;
}
else {
jQuery.each(graph.links, function(i, link_each) {
if (link_each.id_db == id_link) {
//Found
if (link_each.arrow_end == "") {
graph.links[i].id_db = data['id_link_change'];
}
graph.links[i].arrow_end = "module";
graph.links[i].id_module_end = interface_target;
graph.links[i].text_end = text_target_interface;
//Added th arrow
$("#link_id_" + id_link)
.attr("marker-end",
"url(#interface_end_1)");
$("tspan")
.filter(function() {
var textPath = $(this).parent();
if ($(textPath).attr('href') == "#link_reverse_id_" + id_link)
return true;
else return false;
})
.html(Array(25).join(" ") + text_target_interface);
}
});
temp_link["arrow_end"] = "";
temp_link["id_agent_end"] = interface_target;
temp_link["id_module_end"] = 0;
}
temp_link["status_start"] = "0";
temp_link["status_end"] = "0";
$.each(graph.nodes, function(k, node) {
if (node['id_agent'] == data['id_db_target']) {
temp_link["target"] = graph.nodes[k];
}
if (node['id_agent'] == data['id_db_source']) {
temp_link["source"] = graph.nodes[k];
}
});
add_new_link(temp_link);
$("#layer_graph_links_" + networkmap_id).remove();
$("#layer_graph_nodes_" + networkmap_id).remove();
window.layer_graph_links = window.layer_graph
.append("g")
.attr("id", "layer_graph_links_" + networkmap_id);
window.layer_graph_nodes = window.layer_graph
.append("g")
.attr("id", "layer_graph_nodes_" + networkmap_id);
force.nodes(graph.nodes)
.links(graph.links)
.start();
window.node = layer_graph_nodes.selectAll(".node");
window.link = layer_graph_links.selectAll(".link");
draw_elements_graph();
init_drag_and_drop();
set_positions_graph();
}
else {
@ -620,6 +595,14 @@ function update_link(row_index, id_link) {
});
}
function delete_link_from_id (index) {
graph.links.splice(index, 1);
}
function add_new_link (new_link) {
graph.links.push(new_link);
}
function edit_node(data, dblClick) {
if (enterprise_installed) {
var flag_edit_node = true;
@ -661,7 +644,7 @@ function edit_node(data, dblClick) {
$("#node_options-fictional_node_update_button-1 input")
.attr("onclick", "update_fictional_node(" + data.id_db + ");");
$("#node_details-0-1").html(data["text"]);
$("#node_details-0-1").html('<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' + data["id_agent"] + '">' + data["text"] + '</a>');
var params = [];
params.push("get_agent_info=1");
params.push("id_agent=" + data["id_agent"]);
@ -671,7 +654,6 @@ function edit_node(data, dblClick) {
dataType: 'json',
type: 'POST',
url: action="ajax.php",
async: false,
success: function (data) {
var adressess = "";
for (adress in data['adressess']) {
@ -694,7 +676,6 @@ function edit_node(data, dblClick) {
dataType: 'json',
type: 'POST',
url: action="ajax.php",
async: false,
success: function (data) {
if (data.length == 0) {
$("#interface_information").find('tbody')
@ -786,8 +767,10 @@ function edit_node(data, dblClick) {
.attr('class', "edit_icon_fail_" + i);
$(".edit_icon_link", template_relation_row)
.attr('class', "edit_icon_link_" + i)
.attr('href', 'javascript: update_link(' + i + "," + link_each.id_db + ');');
.click(function() {
update_link(i, link_each.id_db);
}
);
var params = [];
params.push("get_intefaces=1");
@ -799,9 +782,10 @@ function edit_node(data, dblClick) {
dataType: 'json',
type: 'POST',
url: action="ajax.php",
async: false,
success: function (data) {
if (data['correct']) {
$("select[name='interface_source_" + i + "']", template_relation_row).empty();
$("select[name='interface_source_" + i + "']", template_relation_row).append('<option value="' + link_each.source.id_agent + '">None</option>');
jQuery.each(data['interfaces'], function(j, interface) {
$("select[name='interface_source_" + i + "']", template_relation_row)
@ -828,11 +812,11 @@ function edit_node(data, dblClick) {
dataType: 'json',
type: 'POST',
url: action="ajax.php",
async: false,
success: function (data) {
if (data['correct']) {
$("select[name='interface_target_" + i + "']", template_relation_row).empty();
$("select[name='interface_target_" + i + "']", template_relation_row).append('<option value="' + link_each.target.id_agent + '">None</option>');
jQuery.each(data['interfaces'], function(j, interface) {
$("select[name='interface_target_" + i + "']", template_relation_row)
.append($("<option>")
.attr("value", interface['id_agente_modulo'])
@ -1905,7 +1889,6 @@ function add_interface_link_js () {
//temp_link['text_end'] = link['text_end'];
jQuery.each(graph.nodes, function(j, node) {
console.log(node['id_db']);
if (node['id_agent'] == data['id_db_target']) {
temp_link['target'] = graph.nodes[j];
}
@ -2818,7 +2801,26 @@ function draw_elements_graph() {
});
link_temp = link.enter()
.append("g");
.append("g")
.attr("id", function(d) {
return "link_id_" + d.id_db + networkmap_id;
})
.attr("class", function(d) {
var holding_area_text = "";
if ((d.source.state == 'holding_area') ||
(d.target.state == 'holding_area')) {
holding_area_text = " holding_area_link ";
}
return "link " +
"source_" + d.source.id + networkmap_id + " " +
"target_" + d.target.id + networkmap_id + " " +
holding_area_text +
"id_module_start_" + d.id_module_start + " " +
"id_module_end_" + d.id_module_end;
});
link.exit().remove();
link_temp.append("path")
@ -2937,6 +2939,7 @@ function draw_elements_graph() {
});
node = node.data(force.nodes(), function(d) { return d.id;});
node_temp = node.enter()
.append("g")
.attr("id", function(d) {

View File

@ -214,6 +214,9 @@ $(document).ready (function () {
}
});
$("#alert_messages").draggable();
$("#alert_messages").css({'left':+parseInt(screen.width/2)-parseInt($("#alert_messages").css('width'))/2+'px'});
});
function forced_title_callback() {

View File

@ -359,7 +359,7 @@ function perform_response(target) {
dataType: 'html',
success: function (data) {
if (data == '') {
$('#response_out').html('<i>No output</i>');
$('#response_out').html('<i>Unreachable host</i>');
}
else {
var out = data.replace(/[\n|\r]/g, "<br>");

View File

@ -3573,13 +3573,10 @@ div.simple_value > a > span.text p
-webkit-border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
z-index:2;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
z-index:3;
position:fixed;
width:650px;
top: 30%;
background:white;
}
.modalheader{

View File

@ -181,6 +181,7 @@ if ($change_pass == 1) {
$changed_pass = login_update_password_check ($password_old, $password_new, $password_confirm, $id);
}
$minor_release_message = false;
$searchPage = false;
$search = get_parameter_get("head_search_keywords");
if (strlen($search) > 0) {
@ -443,6 +444,76 @@ if (! isset ($config['id_user'])) {
$_SESSION['id_usuario'] = $nick_in_db;
$config['id_user'] = $nick_in_db;
if (is_user_admin($config['id_user'])) {
$have_minor_releases = db_check_minor_relase_available();
// PHP configuration values
$PHPupload_max_filesize = config_return_in_bytes(ini_get('upload_max_filesize'));
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
$PHPmax_execution_time = ini_get('max_execution_time');
if ($PHPmax_execution_time !== '0') {
set_time_limit(0);
}
$PHPupload_max_filesize_min = config_return_in_bytes('800M');
if ($PHPupload_max_filesize < $PHPupload_max_filesize_min) {
ini_set('upload_max_filesize', config_return_in_bytes('800M'));
}
$PHPmemory_limit_min = config_return_in_bytes('500M');
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== '-1') {
ini_set('memory_limit', config_return_in_bytes('500M'));
}
if ($have_minor_releases) {
$size_mr = get_number_of_mr();
echo "<div class= 'dialog ui-dialog-content' title='".__("Minor release available")."' id='mr_dialog2'>" . __('') . "</div>";
?>
<script type="text/javascript" language="javascript">
$(document).ready (function () {;
$('#mr_dialog2').dialog ({
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: 'black'
},
width: 600,
height: 350,
buttons: {
"Apply minor releases": function () {
var n_mr = '<?php echo implode(",", $size_mr);?>';
apply_minor_release(n_mr.split(","));
},
"Cancel": function () {
$(this).dialog("close");
}
}
});
$('button:contains(Apply minor releases)').attr("id","apply_rr_button");
$('button:contains(Cancel)').attr("id","cancel_rr_button");
var dialog_text = "<div><h3>Do you want to apply minor releases?</h3></br>";
dialog_text = dialog_text + "<h2>We recommend launch a planned downtime to this process</h2></br>";
dialog_text = dialog_text + "<a href=\"<?php echo $config['homeurl']; ?>index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">Planned downtimes</a></div>"
$('#mr_dialog2').html(dialog_text);
$('#mr_dialog2').dialog('open');
});
</script>
<?php
}
}
set_time_limit((int)$PHPmax_execution_time);
ini_set('upload_max_filesize', $PHPupload_max_filesize);
ini_set('memory_limit', $PHPmemory_limit);
//==========================================================
//-------- SET THE CUSTOM CONFIGS OF USER ------------------
@ -904,6 +975,47 @@ require('include/php_to_js_values.php');
};
})();
function apply_minor_release (n_mr) {
var error = false;
$("#apply_rr_button").remove();
$("#cancel_rr_button").text("Close");
$('#mr_dialog2').empty();
$('#mr_dialog2').append("<img id=\"rr_image\" src=\"<?php echo $config['homeurl'] . 'images/spinner.gif'; ?>\">");
$.each(n_mr, function(i, mr) {
var params = {};
params["updare_rr"] = 1;
params["number"] = mr;
params["page"] = "include/ajax/rolling_release.ajax";
jQuery.ajax ({
data: params,
async: false,
dataType: "html",
type: "POST",
url: "ajax.php",
success: function (data) {
if (data != "") {
$('#mr_dialog2').empty();
$('#mr_dialog2').html("<h2>" + data + "</h2>");
error = true;
}
else {
$('#mr_dialog2').append("<p>- Applying DB MR #" + mr + "</p>");
}
}
});
if (error) {
return false;
}
});
$('#rr_image').remove();
if (!error) {
$('#mr_dialog2').append("<h2>Updated finished successfully</h2>");
}
}
function force_run_register () {
run_identification_wizard (1, 0, 0);

View File

@ -71,7 +71,7 @@
<div style='height: 10px'>
<?php
$version = '7.0dev';
$build = '170208';
$build = '170215';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -708,19 +708,19 @@ a.ui-link-inherit {
/* Active class used as the "on" state across all themes
-----------------------------------------------------------------------------------------------------------*/
.ui-btn-active {
border: 1px solid #2373a5 /*{global-active-border}*/;
border: 1px solid #82B92E /*{global-active-border}*/;
background: #5393c5 /*{global-active-background-color}*/;
font-weight: bold;
color: #fff /*{global-active-color}*/;
cursor: pointer;
text-shadow: 0 /*{global-active-shadow-x}*/ 1px /*{global-active-shadow-y}*/ 0 /*{global-active-shadow-radius}*/ #3373a5 /*{global-active-shadow-color}*/;
text-shadow: 0 /*{global-active-shadow-x}*/ 1px /*{global-active-shadow-y}*/ 0 /*{global-active-shadow-radius}*/ #82B92E /*{global-active-shadow-color}*/;
text-decoration: none;
background-image: -webkit-gradient(linear, left top, left bottom, from( #5393c5 /*{global-active-background-start}*/), to( #6facd5 /*{global-active-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/);
background-image: -webkit-gradient(linear, left top, left bottom, from( #82B92E /*{global-active-background-start}*/), to( #82B92E /*{global-active-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #82B92E /*{global-active-background-start}*/, #82B92E /*{global-active-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #82B92E /*{global-active-background-start}*/, #82B92E /*{global-active-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #82B92E /*{global-active-background-start}*/, #82B92E /*{global-active-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #82B92E /*{global-active-background-start}*/, #82B92E /*{global-active-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #82B92E /*{global-active-background-start}*/, #82B92E /*{global-active-background-end}*/);
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-btn-active:visited,
@ -1042,9 +1042,9 @@ a.ui-link-inherit {
}
.ui-focus,
.ui-btn:focus {
-moz-box-shadow: inset 0 0 3px #387bbe /*{global-active-background-color}*/, 0 0 9px #387bbe /*{global-active-background-color}*/;
-webkit-box-shadow: inset 0 0 3px #387bbe /*{global-active-background-color}*/, 0 0 9px #387bbe /*{global-active-background-color}*/;
box-shadow: inset 0 0 3px #387bbe /*{global-active-background-color}*/, 0 0 9px #387bbe /*{global-active-background-color}*/;
-moz-box-shadow: inset 0 0 3px #82B92E /*{global-active-background-color}*/, 0 0 9px #82B92E /*{global-active-background-color}*/;
-webkit-box-shadow: inset 0 0 3px #82B92E /*{global-active-background-color}*/, 0 0 9px #82B92E /*{global-active-background-color}*/;
box-shadow: inset 0 0 3px #82B92E /*{global-active-background-color}*/, 0 0 9px #82B92E /*{global-active-background-color}*/;
}
.ui-input-text.ui-focus,
.ui-input-search.ui-focus {
@ -1123,10 +1123,29 @@ div.ui-mobile-viewport { overflow-x: hidden; }
.ui-header > .ui-btn-icon-notext,
.ui-header-fixed.ui-fixed-hidden > .ui-btn-icon-notext { top: 6px; }
.ui-header-fixed > .ui-btn-icon-notext { top: 7px;}
.ui-header .ui-title, .ui-footer .ui-title { min-height: 1.1em; text-align: center; font-size: 16px; display: block; margin: .6em 30% .8em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; }
.ui-footer .ui-title { margin: .6em 15px .8em; }
.ui-header .ui-title, .ui-footer .ui-title {
min-height: 1.1em;
text-align: center;
font-size: 16px;
display: block;
margin: .6em 30% .8em;
padding: 0;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
outline: 0 !important;
}
.ui-footer .ui-title {
margin: .6em 15px .8em;
}
/* content area*/
.ui-content { border-width: 0; overflow: visible; overflow-x: hidden; padding: 15px; }
.ui-content {
border-width: 0;
overflow: hidden;
overflow-x: hidden;
padding: 5px 5px 0px 5px;
}
/* corner styling for dialogs and popups */
.ui-corner-all > .ui-header:first-child,
.ui-corner-all > .ui-content:first-child,
@ -2128,7 +2147,7 @@ label.ui-submit { font-size: 16px; line-height: 1.4; font-weight: normal; margin
.ui-field-contain .ui-btn.ui-submit { width: 78%; display: inline-block; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; }
.ui-hide-label .ui-btn.ui-submit { width: auto; display: block; }
}
.ui-collapsible-inset { margin: .5em 0; }
.ui-collapsible-inset { margin: .5em 2px 1px; width:99%;}
.ui-collapsible-heading { font-size: 16px; display: block; margin: 0 -15px; padding: 0; position: relative; }
.ui-collapsible-inset .ui-collapsible-heading { margin: 0; }
.ui-collapsible-heading .ui-btn { text-align: left; margin: 0; border-left-width: 0; border-right-width: 0; }
@ -2294,7 +2313,7 @@ label.ui-submit { font-size: 16px; line-height: 1.4; font-weight: normal; margin
padding: 0;
}
.ui-dialog-contain > .ui-content {
padding: 15px;
padding: 5px 5px 0px 5px;
}
.ui-dialog-contain > .ui-footer {
z-index: 10;
@ -3120,7 +3139,7 @@ div.ui-slider-switch.ui-mini {
}
}
/* Breakpoint to show as a standard table at 560px (25em x 16px) or wider */
@media ( min-width: 25em ) {
@media ( min-width: 34.99em ) {
/* Fixes table rendering when switching between breakpoints in Safari <= 5. See https://github.com/jquery/jquery-mobile/issues/5380 */
.ui-table-reflow.ui-responsive {
display: table-row-group;
@ -3143,7 +3162,7 @@ div.ui-slider-switch.ui-mini {
}
/* Hack to make IE9 and WP7.5 treat cells like block level elements, scoped to ui-responsive class */
/* Applied in a max-width media query up to the table layout breakpoint so we don't need to negate this*/
@media ( max-width: 25em ) {
@media ( max-width: 34.98em ) {
.ui-table-reflow.ui-responsive td,
.ui-table-reflow.ui-responsive th {
width: 100%;
@ -3153,6 +3172,15 @@ div.ui-slider-switch.ui-mini {
float: left;
clear: left;
}
#list_agent_Modules.ui-table-reflow.ui-responsive td.cell_0 {
width: 52% !important;
}
#list_agent_Modules.ui-table-reflow.ui-responsive td.cell_1 {
width: 15% !important;
}
#list_agent_Modules.ui-table-reflow.ui-responsive td.cell_4 {
width: 33% !important;
}
}
/* panel */
.ui-panel {

View File

@ -34,6 +34,10 @@ body {
}
.agent_graphs, .events_bar {
padding-top: 10px;
}
#tactical1 *, #tactical2 * {
font-weight: bold;
}
@ -520,11 +524,32 @@ table.event_details td.cell_event_name {
}
.agent_details {
line-height: 35px;
padding: 10px 0px 10px 0px;
}
.agent_details > img {
vertical-align: middle;
width: 20px;
}
.agent_os{
float: right;
position: absolute;
top: 0px;
right: 0px;
padding: 10px;
}
.agent_details img {
float: left;
.agent_list_ips {
padding: 10px 0px 10px 0px;
}
.agent_list_ips > img {
vertical-align: middle;
width: 20px;
}
.agent_last_contact {
padding: 10px 0px 10px 0px;
}
.agent_description {
padding: 10px 0px 10px 0px;
}
.agent_name {
@ -544,8 +569,8 @@ table.event_details td.cell_event_name {
}
#list_agents td {
height: 35px;
padding-top: 20px;
height: 25px;
padding-top: 10px;
}
.agents_tiny_stats_tactical {
@ -554,7 +579,33 @@ table.event_details td.cell_event_name {
width: 100%;
}
@media screen and (max-width: 25em) {
@media screen and (max-width: 34.99em) {
#list_agents td {
height: 35px;
padding-top: 7px;
display: table-cell;
clear: none;
padding-left: 0px !important;
padding-right: 0px !important;
}
#list_agents td.cell_0 {
width: 45%;
border-top: 0px none;
}
#list_agents td.cell_0>span.tiny>img {
width: 5px;
height: 30px;
margin-top: -6px;
margin-left: 0px;
}
#list_agents td.cell_5 {
width: 30%;
}
#list_agents td.cell_6 {
width: 25%;
}
#list_agents .cell_2 .ui-table-cell-label,
#list_agents .cell_3 .ui-table-cell-label,
#list_agents .cell_6 .ui-table-cell-label,
@ -572,7 +623,6 @@ table.event_details td.cell_event_name {
#list_agents .cell_2,
#list_agents .cell_3,
#list_agents .cell_6,
#list_agents .cell_7 {
display: inline !important;
float: none !important;
@ -594,7 +644,7 @@ table.event_details td.cell_event_name {
}
#list_agents .show_collapside {
display: inline !important;
display: none !important;
}
#list_agents .cell_1,
@ -605,16 +655,24 @@ table.event_details td.cell_event_name {
}
#list_agents .cell_0 .ui-link {
font-size: 15px;
font-size: 12px;
}
#list_agents .cell_6 .show_collapside {
display: inline !important;
display: none !important;
}
.agents_tiny_stats * {
font-size: 12px !important;
}
#list_agent_Modules td {
padding-top: 7px !important;
}
.agents_tiny_stats {
float: right;
}
}
/* For mobiles */
@ -738,7 +796,7 @@ table.event_details td.cell_event_name {
/*END-----------Visual maps styles---------------------------------------*/
/*INIT-----------Modules styles---------------------------------------*/
@media screen and (max-width: 25em) {
@media screen and (max-width: 34.99em) {
#list_Modules .cell_1 .ui-table-cell-label,
#list_Modules .cell_5 .ui-table-cell-label,
#list_Modules .cell_6 .ui-table-cell-label {
@ -755,7 +813,17 @@ table.event_details td.cell_event_name {
#list_Modules .cell_3 .ui-table-cell-label,
#list_Modules .cell_4 .ui-table-cell-label,
#list_Modules .cell_5 .ui-table-cell-label {
display: none;
display: none !important;
}
#list_Modules td {
height: 35px;
padding-top: 7px;
display: table-cell;
clear: none;
float: none;
padding-left: 0px !important;
padding-right: 0px !important;
}
#list_Modules .show_collapside {
@ -766,18 +834,43 @@ table.event_details td.cell_event_name {
white-space: nowrap;
}
#list_Modules .cell_1,
#list_Modules .cell_2,
#list_Modules .cell_3 {
display: none !important;
}
#list_Modules .cell_0 .show_collapside,
#list_Modules .cell_1 .show_collapside {
#list_Modules .cell_1 .show_collapside,
#list_Modules .cell_4 .show_collapside,
#list_Modules .cell_5 .show_collapside {
display: none !important;
}
#list_Modules .cell_0 .ui-link {
font-size: 15px;
font-size: 12px;
}
#list_Modules .cell_0{
width: 50%;
border-top: 0px none;
}
#list_Modules .cell_4{
width: 25%;
}
#list_Modules .cell_5{
width: 25%;
}
}
#list_Modules td.cell_0>span.tiny>img {
width: 5px;
height: 30px;
margin-top: -5px;
margin-left: 0px;
float: left;
}
#list_Modules .module_name {
font-size: 12px !important;
}
}
@ -795,6 +888,10 @@ table.event_details td.cell_event_name {
padding-top: 20px;
}
#list_agent_Modules td.cell_0 > span.tiny {
display: none;
}
#list_Modules .cell_5 img {
float: left;
}
@ -809,7 +906,7 @@ table.event_details td.cell_event_name {
line-height: 20px;
}
@media screen and (max-width: 25em) {
@media screen and (max-width: 34.99em) {
#list_agent_Modules .ui-table-cell-label,
#list_agent_Modules .cell_2,
#list_agent_Modules .cell_3 {
@ -877,7 +974,7 @@ li.ui-btn {
float: left;
}
@media screen and (max-width: 25em) {
@media screen and (max-width: 34.99em) {
.ui-table th, .ui-table td {
padding: 8px !important;
padding-left: 3px;
@ -924,7 +1021,7 @@ li.ui-btn {
height: 28px !important;
}
@media screen and (max-width: 25em)
@media screen and (max-width: 35em)
{
.events .status_row {
display: none;
@ -939,12 +1036,12 @@ li.ui-btn {
min-width: 50%;
}
.agents_tiny_stats, .agents_last_contact {
.agents_last_contact {
float: right;
}
}
@media screen and (min-width: 25em)
@media screen and (min-width: 35em)
{
.events .cell_0 .event_link{
display: none;
@ -1028,7 +1125,7 @@ li.ui-btn {
}
.event_name {
font-size: 18px !important;
font-size: 15px !important;
}
.login_logo img {
@ -1050,7 +1147,7 @@ li.ui-btn {
}
.event_name {
font-size: 15px;
font-size: 12px;
font-weight: bold;
}
@ -1199,6 +1296,11 @@ span.nobold * {
line-height: 1.1em;
}
.events_timestamp > img {
vertical-align: middle;
margin-left: 10px;
}
.events_agent {
float: left;
}
@ -1258,3 +1360,15 @@ DIV.nodata_container {
.ui-table-reflow.ui-responsive {
display: table !important;
}
.widget_agent_module > th {
background-color: #373737;
}
#list_agent_Modules >tbody > tr > td {
clear: none;
vertical-align: middle;
padding: 0px;
}
#list_agent_Modules > tbody > tr > td.cell_0 {
border-top: 0px none;
}

View File

@ -780,6 +780,7 @@ class Table {
foreach ($data as $id => $row) {
$table_row = array();
foreach ($row as $key => $value) {
if (!in_array($key, $this->head)) {
$this->head[] = $key;
}
@ -843,45 +844,40 @@ class Table {
$html = '';
$html = "<table data-role='table' id='" . $this->id . "' " .
"data-mode='reflow' class='" . $this->class_table . " ui-responsive table-stroke'>\n";
"data-mode='reflow' class='" . $this->class_table . " ui-responsive table-stroke'>";
$html .= "<thead>\n";
$html .= "<tr>\n";
//Empty head for white space between rows in the responsive vertical layout
$html .= "<th class='head_horizontal'></th>\n";
foreach ($this->head as $head) {
$html .= "<th class='head_horizontal'>" . $head . "</th>\n";
if ($this->head) {
$html .= "<thead>";
$html .= "<tr>";
//Empty head for white space between rows in the responsive vertical layout
//~ $html .= "<th class='head_horizontal'></th>";
foreach ($this->head as $head) {
$html .= "<th class='head_horizontal'>" . $head . "</th>";
}
$html .= "</tr>";
$html .= "</thead>";
}
$html .= "</tr>\n";
$html .= "</thead>\n";
$html .= "<tbody>\n";
$html .= "<tbody>";
foreach ($this->rows as $key => $row) {
$class = '';
if (isset($this->rowClass[$key])) {
$class = $this->rowClass[$key];
}
$html .= "<tr class='" . $class . "'>\n";
$html .= "<tr class='" . $class . "'>";
//Empty head for white space between rows in the responsive vertical layout
if (isset($this->row_heads[$key])) {
$html .= "<th class='head_vertical'>" . $this->row_heads[$key] . "</th>\n";
}
elseif ($this->row_keys_as_head_row) {
$html .= "<th class='head_vertical'>" . $key . "</th>\n";
}
else {
$html .= "<th class='head_vertical' style='font-size: 0px'></th>\n";
}
foreach ($row as $key_cell => $cell) {
$html .= "<td class='cell_" . $key_cell . "'>" . $cell . "</td>\n";
$html .= "<td class='cell_" . $key_cell . "'>" . $cell . "</td>";
}
$html .= "</tr>\n";
$html .= "</tr>";
}
$html .= "</tbody>\n";
$html .= "</table>\n";
$html .= "</tbody>";
$html .= "</table>";
return $html;
}

View File

@ -114,92 +114,123 @@ class Agent {
$ui->showFooter(false);
$ui->beginContent();
if (empty($this->agent)) {
$ui->contentAddHtml('<span style="color: red;">' . __('No agent found') . '</span>');
$ui->contentAddHtml('<span style="color: red;">' .
__('No agent found') . '</span>');
}
else {
$ui->contentBeginGrid();
if ($this->agent['disabled']) {
$agent_name = "<em>" . $agent_name . "</em>" . ui_print_help_tip(__('Disabled'), true);
}
else if ($this->agent['quiet']) {
$agent_name = "<em>" . $agent_name . "&nbsp;" . html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "</em>";
}
else {
$agent_name = $agent_name;
}
if ($this->agent['disabled']) {
$agent_name = "<em>" . $agent_name . "</em>" .
ui_print_help_tip(__('Disabled'), true);
}
else if ($this->agent['quiet']) {
$agent_name = "<em>" . $agent_name . "&nbsp;" .
html_print_image("images/dot_green.disabled.png",
true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "</em>";
}
else {
$agent_name = $agent_name;
}
if ($system->getConfig('metaconsole')) {
metaconsole_connect(null, $this->agent['id_tmetaconsole_setup']);
$addresses = agents_get_addresses($this->agent['id_tagente']);
}
else
$addresses = agents_get_addresses($this->id);
if ($system->getConfig('metaconsole'))
metaconsole_restore_db();
$address = $this->agent['direccion'];
foreach ($addresses as $k => $add) {
if ($add == $address) {
unset($addresses[$k]);
}
}
$ip = html_print_image('images/world.png', true, array('title' => __('IP address'))) . '&nbsp;&nbsp;';
$ip .= empty($address) ? '<em>' . __('N/A') . '</em>' : $address;
if (!empty($addresses)) {
$ip .= ui_print_help_tip(__('Other IP addresses').': <br>'.implode('<br>',$addresses), true);
}
$ip .= '<br />';
$last_contact = '<b>' . __('Last contact') . '</b>:&nbsp;'
.ui_print_timestamp ($this->agent["ultimo_contacto"], true) . '<br />';
$description = '<b>' . __('Description') . ':</b><br>';
if (empty($agent["comentarios"])) {
$description .= '<i>' . __('N/A') . '</i>';
}
else {
$description .= $this->agent["comentarios"];
}
$html = '<div class="agent_details">';
$html .= ui_print_group_icon ($this->agent["id_grupo"], true, "groups_small", "", false) . '&nbsp;&nbsp;';
$html .= '<span class="agent_name">' . $agent_name . '</span><br />';
$html .= $ip;
$html .= $last_contact;
$html .= $description;
$html .= '</div>';
if ($system->getConfig('metaconsole')) {
metaconsole_connect(null, $this->agent['id_tmetaconsole_setup']);
//~ $addresses = agents_get_addresses($this->agent['id_tagente']);
}
else
$addresses = agents_get_addresses($this->id);
if ($system->getConfig('metaconsole'))
metaconsole_restore_db();
$address = $this->agent['direccion'];
//~ foreach ($addresses as $k => $add) {
//~ if ($add == $address) {
//~ unset($addresses[$k]);
//~ }
//~ }
//~ $ip = html_print_image('images/world.png',
//~ true, array('title' => __('IP address'))) .
//~ '&nbsp;&nbsp;';
$ip .= empty($address) ? '<em>' . __('N/A') .
'</em>' : $address;
//~ if (!empty($addresses)) {
//~ $ip .= ui_print_help_tip(__('Other IP addresses') .
//~ ': ' . implode(', ',$addresses), true);
//~ }
$last_contact = '<b>' . __('Last contact') .
'</b>:&nbsp;' .
ui_print_timestamp ($this->agent["ultimo_contacto"], true);
//~ $description = '<b>' . __('Description') . ':</b>&nbsp;';
if (empty($agent["comentarios"])) {
$description .= '<i>' . __('N/A') . '</i>';
}
else {
$description .= $this->agent["comentarios"];
}
$html = '<div class="agent_details" style:"float:left;">';
$html .= '<span class="agent_name">' . $agent_name .
'</span>';
$html .= '</div>';
$html .= '<div class="agent_os">' . ui_print_os_icon ($this->agent["id_os"], false, true,
true, false, false, false, false, true) . '</div>';
$html .= '<div class="agent_list_ips">';
$html .= $ip . ' - ' .
groups_get_name ($this->agent["id_grupo"], true);
$html .= '</div>
<div class="agent_last_contact">';
$html .= $last_contact;
$html .= '</div>
<div class="agent_description">';
$html .= $description;
$html .= '</div>';
if ($system->getConfig('metaconsole')) {
metaconsole_connect(null,
$this->agent['id_tmetaconsole_setup']);
}
$ui->contentGridAddCell($html, 'agent_details');
ob_start();
$html = '<div class="agent_graphs">';
$html .= "<b>" . __('Modules by status') . "</b><br />";
$html .= graph_agent_status ($this->id, 160, 160, true);
$graph_js = ob_get_clean();
$html = $graph_js . $html;
unset($this->agent['fired_count']);
if ($this->agent['total_count'] > 0) {
$html .= '<span class="agents_tiny_stats agents_tiny_stats_tactical">' . reporting_tiny_stats($this->agent, true) . ' </span><br>';
}
$html .= "<b>" . __('Events (24h)') . "</b><br /><br />";
$html .= '<div id="events_bar"></div>';
$html .= '<br>';
$html .= '</div>';
ob_start();
$html = '<div class="agent_graphs">';
$html .= "<b>" . __('Modules by status') . "</b>";
$html .= graph_agent_status ($this->id, 160, 160, true);
$graph_js = ob_get_clean();
$html = $graph_js . $html;
unset($this->agent['fired_count']);
if ($this->agent['total_count'] > 0) {
$html .= '<div class="agents_tiny_stats agents_tiny_stats_tactical">' .
reporting_tiny_stats($this->agent, true, 'agent', '&nbsp;') . ' </div>';
}
$html .= '</div>';
$html .= '<div class="events_bar">';
$html .= "<b>" . __('Events (24h)') . "</b>";
$html .= '<div id="events_bar"></div>';
$html .= '</div>';
$ui->contentGridAddCell($html, 'agent_graphs');
$ui->contentEndGrid();
if ($system->getConfig('metaconsole'))
metaconsole_restore_db();
$modules = new Modules();
if ($system->getConfig('metaconsole'))
$filters = array('id_agent' => $this->agent['id_tagente'], 'all_modules' => true, 'status' => -1);
else
$filters = array('id_agent' => $this->id, 'all_modules' => true, 'status' => -1);
$modules->setFilters($filters);
$modules->disabledColumns(array('agent'));
$ui->contentBeginCollapsible(__('Modules'));
@ -209,18 +240,23 @@ class Agent {
if ($system->getConfig('metaconsole')) {
metaconsole_connect(null, $this->agent['id_tmetaconsole_setup']);
}
$alerts = new Alerts();
if ($system->getConfig('metaconsole'))
$filters = array('id_agent' => $this->agent['id_tagente'], 'all_alerts' => true);
else
$filters = array('id_agent' => $this->id, 'all_alerts' => true);
$alerts->setFilters($filters);
$alerts->disabledColumns(array('agent'));
$ui->contentBeginCollapsible(__('Alerts'));
$ui->contentCollapsibleAddItem($alerts->listAlertsHtml(true));
$ui->contentEndCollapsible();
if ($system->getConfig('metaconsole'))
metaconsole_restore_db();
$events = new Events();
$events->addJavascriptDialog();

View File

@ -325,7 +325,7 @@ class Agents {
$row[7] = $row[__('Modules')] =
'<span class="show_collapside" style="vertical-align: 0%; display: none; font-weight: bolder;">' . __('Modules') . ' </span>' .
'<span class="agents_tiny_stats">' . reporting_tiny_stats($agent, true) . ' </span>';
'<span class="agents_tiny_stats">' . reporting_tiny_stats($agent, true, 'agent', '&nbsp;') . ' </span>';
$last_time = strtotime ($agent["ultimo_contacto"]);
$now = time ();

View File

@ -105,7 +105,7 @@ class Events {
$status_icon = html_print_image($img_st, true, false, false, false, false, true);
$row = array();
$row[] = '<b class="ui-table-cell-label">' . __('Event Name') . '</b><a href="javascript: openDetails(' . $event['id_evento'] . ')"><div class="event_name">' . io_safe_output($event['evento']) . '</div></a>';
$row[] = '<b class="ui-table-cell-label">' . __('Event Name') . '</b><a href="javascript: openDetails(' . $event['id_evento'] . ')"><div class="event_name">' . io_safe_output(str_replace(array('&nbsp;','&#20;'), ' ', $event['evento'])) . '</div></a>';
if ($event["id_agente"] == 0) {
$agent_name = __('System');
@ -115,7 +115,7 @@ class Events {
}
$row_1 = '<span class="events_agent">' . $agent_name . '</span>';
$row_1 .= '<span class="events_timestamp">' . $status_icon . '<br>' . ui_print_timestamp ($event['timestamp_rep'], true, array('units' => 'tiny')) . '</span>';
$row_1 .= '<span class="events_timestamp">' . ui_print_timestamp ($event['timestamp_rep'], true, array('units' => 'tiny')) . $status_icon . '</span>';
$row[] = $row_1;
@ -966,10 +966,10 @@ class Events {
var new_rows = \"\";
$.each(data.events, function(key, event) {
new_rows = \"<tr class='events \" + event[2] + \"'>\" +
\"<td class='cell_0'>\" +
\"<td class='cell_0' style='vertical-align:middle;'>\" +
event[0] +
\"</td>\" +
\"<td>\" + event[1] + \"</td>\" +
\"<td style='vertical-align:middle;'>\" + event[1] + \"</td>\" +
\"</tr>\" + new_rows;
});

View File

@ -84,7 +84,7 @@ class ModuleGraph {
$this->height = (int)$system->getRequest('height', 0);
//Sancho says "put the height to 1/2 for to make more beautyful"
//$this->height = $this->height / 2;
$this->height = $this->height / 1.5;
$this->height -= 80; //Correct the height
@ -279,37 +279,34 @@ class ModuleGraph {
ob_start();
?>
<script type="text/javascript">
$(document).bind('ready', function() {
$(document).ready(function() {
function load_graph() {
$("#loading_graph").show();
$("#graph_content").html($('#loading_graph').html())
.height(($(window).height()
var heigth = $(document).height()
- $(".ui-header").height()
- $(".ui-collapsible").height()
- 55) + "px").width($(".ui-collapsible").width() + "px");
ajax_get_graph($("#id_module").val());
- 55;
var width = $(document).width() - 25;
ajax_get_graph($("#id_module").val(), heigth, width);
}
load_graph();
// Detect orientation change to refresh dinamic content
$(window).on({
orientationchange: function(e) {
// Reload dinamic content
load_graph();
}
window.addEventListener("resize", function() {
// Reload dinamic content
load_graph();
});
});
function ajax_get_graph(id) {
function ajax_get_graph(id, heigth_graph, width_graph) {
postvars = {};
postvars["action"] = "ajax";
postvars["parameter1"] = "module_graph";
postvars["parameter2"] = "get_graph";
postvars["width"] = $("#graph_content").width();
postvars["height"] = $("#graph_content").height();
postvars["width"] = width_graph;
postvars["height"] = heigth_graph;
postvars["draw_alerts"] = ($("input[name = 'draw_alerts']").is(":checked"))?1:0;
postvars["draw_events"] = ($("input[name = 'draw_events']").is(":checked"))?1:0;

View File

@ -117,8 +117,8 @@ class Modules {
}
$this->status = $system->getRequest('status', __("Status"));
if (($this->status === __("Status")) || ($this->status == AGENT_MODULE_STATUS_NOT_NORMAL)) {
$this->status = AGENT_MODULE_STATUS_NOT_NORMAL;
if (($this->status === __("Status")) || ($this->status == AGENT_MODULE_STATUS_ALL)) {
$this->status = AGENT_MODULE_STATUS_ALL;
}
else {
$this->default = false;
@ -443,8 +443,49 @@ class Modules {
foreach ($modules_db as $module) {
$row = array();
$image_status = '';
if ($module['utimestamp'] == 0 && (($module['module_type'] < 21 ||
$module['module_type'] > 23) && $module['module_type'] != 100)) {
$image_status = ui_print_status_image(STATUS_MODULE_NO_DATA,
__('NOT INIT'), true);
}
elseif ($module["estado"] == 0) {
$image_status = ui_print_status_image(STATUS_MODULE_OK,
__('NORMAL') . ": " . $module["datos"], true);
}
elseif ($module["estado"] == 1) {
$image_status = ui_print_status_image(STATUS_MODULE_CRITICAL,
__('CRITICAL') . ": " . $module["datos"], true);
}
elseif ($module["estado"] == 2) {
$image_status = ui_print_status_image(STATUS_MODULE_WARNING,
__('WARNING') . ": " . $module["datos"], true);
}
else {
$last_status = modules_get_agentmodule_last_status(
$module['id_agente_modulo']);
switch($last_status) {
case 0:
$image_status = ui_print_status_image(STATUS_MODULE_UNKNOWN,
__('UNKNOWN') . " - " . __('Last status') . " " .
__('NORMAL') . ": " . $module["datos"], true);
break;
case 1:
$image_status = ui_print_status_image(STATUS_MODULE_UNKNOWN,
__('UNKNOWN') . " - " . __('Last status') ." " .
__('CRITICAL') . ": " . $module["datos"], true);
break;
case 2:
$image_status = ui_print_status_image(STATUS_MODULE_UNKNOWN,
__('UNKNOWN') . " - " . __('Last status') . " " .
__('WARNING') . ": " . $module["datos"], true);
break;
}
}
$row[0] =
$row[__('Module name')] =
$row[__('Module name')] = '<span class="tiny" style="margin-right: 5px;">' . $image_status . '</span>' .
'<span class="data module_name">' .
ui_print_truncate_text($module['module_name'], 30, false) .
"</span>";
@ -455,6 +496,7 @@ class Modules {
ui_print_truncate_text($module['agent_name'], 50, false) .
'</span>';
}
if ($module['utimestamp'] == 0 && (($module['module_type'] < 21 ||
$module['module_type'] > 23) && $module['module_type'] != 100)) {
$row[5] = $row[__('Status')] = ui_print_status_image(STATUS_MODULE_NO_DATA,
@ -559,34 +601,30 @@ class Modules {
"&refr=" . $module["module_interval"]."','".$handle."','width=700, height=480')";
if ($is_snapshot) {
if (is_image_data($module["datos"])) {
$row[7] = $row[__('Data')] = '<a href="javascript:' . $link . '">' .
html_print_image("images/photo.png", true,
array("border" => '0',
"alt" => "",
"title" => __("Snapshot view"))) . '</a> &nbsp;&nbsp;';
if (is_image_data($module["datos"])) {
$row[7] = $row[__('Data')] = '<a href="javascript:' . $link . '">' .
html_print_image("images/photo.png", true,
array("border" => '0',
"alt" => "",
"title" => __("Snapshot view"))) . '</a> &nbsp;&nbsp;';
}
else {
$row[7] = $row[__('Data')] = '<a href="javascript:' . $link . '">' .
html_print_image("images/default_list.png", true,
array("border" => '0',
"alt" => "",
"title" => __("Snapshot view"))) . '</a> &nbsp;&nbsp;';
}
}
else {
$row[7] = $row[__('Data')] = '<span style="white-space: nowrap;">' .
'<span style="display: none;" class="show_collapside">' .
$row[__('Status')] . '&nbsp;&nbsp;</span>' .
'<a data-ajax="false" class="ui-link" ' .
'href="index.php?page=module_graph&id=' .
$module['id_agente_modulo'] . '&id_agent=' .
$this->id_agent . '">' . $output . '</a>' . '</span>';
}
else {
$row[7] = $row[__('Data')] = '<a href="javascript:' . $link . '">' .
html_print_image("images/default_list.png", true,
array("border" => '0',
"alt" => "",
"title" => __("Snapshot view"))) . '</a> &nbsp;&nbsp;';
}
}
else{
$row[7] = $row[__('Data')] = '<span style="white-space: nowrap;">' .
'<span style="display: none;" class="show_collapside">' .
$row[__('Status')] . '&nbsp;&nbsp;</span>' .
'<a data-ajax="false" class="ui-link" ' .
'href="index.php?page=module_graph&id=' .
$module['id_agente_modulo'] . '&id_agent=' .
$this->id_agent . '">' . $output . '</a>' . '</span>';
}
/*
@ -643,12 +681,12 @@ class Modules {
$ui->contentAddHtml($table->getHTML());
}
else {
foreach ($listModules['modules'] as $key => $module) {
$listModules['modules'][$key][__('Status')] .=
'<span style="display: none;" class="show_collapside">' .
$listModules['modules'][$key][__('Data')] .
'</span>';
}
//~ foreach ($listModules['modules'] as $key => $module) {
//~ $listModules['modules'][$key][__('Status')] .=
//~ '<span style="display: none;" class="show_collapside">' .
//~ $listModules['modules'][$key][__('Data')] .
//~ '</span>';
//~ }
$table = new Table();
$table->id = 'list_agent_Modules';
@ -710,9 +748,8 @@ class Modules {
else {
$.each(data.modules, function(key, module) {
$(\"table#list_Modules tbody\").append(\"<tr>\" +
\"<th class='head_vertical'></th>\" +
\"<td class='cell_1'><b class='ui-table-cell-label'>" . __('Module name') . "</b>\" + module[0] + \"</td>\" +
\"<td class='cell_0'><b class='ui-table-cell-label'>" . __('Agent name') . "</b>\" + module[1] + \"</td>\" +
\"<td class='cell_1'><b class='ui-table-cell-label'>" . __('Module name') . "</b>\" + module[1] + \"</td>\" +
\"<td class='cell_0'><b class='ui-table-cell-label'>" . __('Agent name') . "</b>\" + module[0] + \"</td>\" +
\"<td class='cell_2'><b class='ui-table-cell-label'>" . __('Status') . "</b>\" + module[5] + \"</td>\" +
\"<td class='cell_3'><b class='ui-table-cell-label'>" . __('Interval') . "</b>\" + module[4] + \"</td>\" +
\"<td class='cell_4'><b class='ui-table-cell-label'>" . __('Timestamp') . "</b>\" + module[6] + \"</td>\" +

View File

@ -207,7 +207,7 @@ class Tactical {
}
else {
max_height = $('#tactical2 .tactical_set').height();
$('#tactical1').height(max_height);
//~ $('#tactical1').height(max_height);
}
}

View File

@ -586,7 +586,7 @@ foreach ($agents as $agent) {
if (enterprise_installed()) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration',$agent["id_agente"])) {
if (enterprise_hook('config_agents_has_remote_configuration',array($agent["id_agente"]))) {
$data[9] = html_print_image("images/application_edit.png", true, array("align" => 'middle', "title" => __('Remote config')));

View File

@ -126,8 +126,9 @@ if (is_ajax ()) {
$id_group = (int) get_parameter('id_module_group');
$id_agents = get_parameter('id_agents');
$selection = get_parameter('selection');
$agents = implode(",", $id_agents);
if(!isset($id_agents)){
$agents = implode(",", $id_agents);
}
$filter_group = "";
$filter_agent = "";
@ -144,12 +145,12 @@ if (is_ajax ()) {
if (empty($modules)) $modules = array();
foreach ($modules as $k => $v) {
for ($j = $k + 1; $j <= sizeof($modules); $j++) {
if ($modules[$j]['nombre'] == $v['nombre']) {
unset($modules[$j]);
}
}
$found = array();
foreach ($modules as $i=>$row) {
$check = $row['nombre'];
if (@$found[$check]++) {
unset($modules[$i]);
}
}
}
else {
@ -173,13 +174,21 @@ if (is_ajax ()) {
}
$modules = $modules_to_report;
$modules = array_unique($modules);
$found = array();
if (is_array($modules) || is_object($modules)){
foreach ($modules as $i=>$row) {
$check = $row['nombre'];
if (@$found[$check]++) {
unset($modules[$i]);
}
}
}
}
foreach ($modules as $k => $v) {
$modules[$k] = io_safe_output($v);
if (is_array($modules) || is_object($modules)){
foreach ($modules as $k => $v) {
$modules[$k] = io_safe_output($v);
}
}
echo json_encode($modules);
return;
}

View File

@ -192,7 +192,13 @@ if (!empty($tag_with)) {
foreach ($tag_with as $id_tag) {
if ($first) $first = false;
else $sql_post .= " AND ";
$sql_post .= "tags LIKE '%" . tags_get_name($id_tag) . "%'";
$sql_post .= "tags LIKE '" . tags_get_name($id_tag) . "'";
$sql_post .= " OR ";
$sql_post .= "tags LIKE '" . tags_get_name($id_tag) . ",%'";
$sql_post .= " OR ";
$sql_post .= "tags LIKE '%, " . tags_get_name($id_tag) . "'";
$sql_post .= " OR ";
$sql_post .= "tags LIKE '%, " . tags_get_name($id_tag) . ",%'";
}
$sql_post .= ' ) ';
}

View File

@ -532,6 +532,7 @@ ui_include_time_picker();
$("#text-ip_src").val('');
$("#text-dst_port").val('');
$("#text-src_port").val('');
$("#text-router_ip").val('');
$("#textarea_advanced_filter").val('');
$("#aggregate").val('');
$("#output").val('');
@ -599,6 +600,8 @@ ui_include_time_picker();
$("#text-dst_port").val(val);
if (i == 'src_port')
$("#text-src_port").val(val);
if (i == 'router_ip')
$("#text-router_ip").val(val);
if (i == 'advanced_filter')
$("#textarea_advanced_filter").val(val);
if (i == 'aggregate')

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0dev
%define release 170208
%define release 170215
# 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.0dev
%define release 170208
%define release 170215
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -66,7 +66,7 @@ INSERT INTO tconfig (token, value) VALUES ('graph_res','5');
INSERT INTO tconfig (token, value) VALUES ('step_compact','1');
INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc');
INSERT INTO tconfig (token, value) VALUES('db_scheme_version','7.0dev');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170208');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD170215');
INSERT INTO tconfig (token, value) VALUES ('show_unknown','0');
INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1');
INSERT INTO tconfig (token, value) VALUES ('style','pandora');
@ -137,6 +137,7 @@ INSERT INTO tconfig (token, value) VALUES ('custom_report_front_header', '');
INSERT INTO tconfig (token, value) VALUES ('custom_report_front_footer', '');
INSERT INTO tconfig (token, value) VALUES ('identification_reminder', 1);
INSERT INTO tconfig (token, value) VALUES ('identification_reminder_timestamp', 0);
INSERT INTO tconfig (token, value) VALUES ('MR', 0);
INSERT INTO tconfig (token, value) VALUES ('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}');
COMMIT;

View File

@ -1896,6 +1896,7 @@ CREATE TABLE tnetflow_filter (
ip_src CLOB,
dst_port CLOB,
src_port CLOB,
router_ip CLOB,
advanced_filter CLOB,
filter_args CLOB,
aggregate VARCHAR2(60),

View File

@ -1597,6 +1597,7 @@ CREATE TABLE "tnetflow_filter" (
"ip_src" TEXT NOT NULL,
"dst_port" TEXT NOT NULL,
"src_port" TEXT NOT NULL,
"router_ip" TEXT NOT NULL,
"advanced_filter" TEXT NOT NULL,
"filter_args" TEXT NOT NULL,
"aggregate" varchar(60),

View File

@ -1720,6 +1720,7 @@ CREATE TABLE IF NOT EXISTS `tnetflow_filter` (
`ip_src` TEXT NOT NULL,
`dst_port` TEXT NOT NULL,
`src_port` TEXT NOT NULL,
`router_ip` TEXT NOT NULL,
`advanced_filter` TEXT NOT NULL,
`filter_args` TEXT NOT NULL,
`aggregate` varchar(60),

View File

@ -109,6 +109,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''),
('custom_report_front_footer', ''),
('MR', 0),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}');

Some files were not shown because too many files have changed in this diff Show More