mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2013-03-15 Miguel de Dios <miguel.dedios@artica.es>
* godmode/massive/massive_copy_modules.php: uploaded lost changes for previous fixed (days ago). * godmode/groups/group_list.php, include/graphs/functions_flot.php, include/graphs/fgraph.php, include/functions_agents.php, general/logon_ok.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7858 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c91f41f0b3
commit
7025a8deec
@ -1,3 +1,12 @@
|
|||||||
|
2013-03-15 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* godmode/massive/massive_copy_modules.php: uploaded lost changes
|
||||||
|
for previous fixed (days ago).
|
||||||
|
|
||||||
|
* godmode/groups/group_list.php, include/graphs/functions_flot.php,
|
||||||
|
include/graphs/fgraph.php, include/functions_agents.php,
|
||||||
|
general/logon_ok.php: cleaned source code style.
|
||||||
|
|
||||||
2013-03-15 Mario Pulido <mario.pulido@artica.es>
|
2013-03-15 Mario Pulido <mario.pulido@artica.es>
|
||||||
|
|
||||||
* include/help/en/help_plugin_policy.php
|
* include/help/en/help_plugin_policy.php
|
||||||
|
@ -40,7 +40,7 @@ if(tags_has_user_acl_tags()) {
|
|||||||
echo '<div style="width:50%; float:left; padding-right: 30px;" id="leftcolumn">';
|
echo '<div style="width:50%; float:left; padding-right: 30px;" id="leftcolumn">';
|
||||||
//////////////////NEWS BOARD/////////////////////////////
|
//////////////////NEWS BOARD/////////////////////////////
|
||||||
echo '<div id="news_board">';
|
echo '<div id="news_board">';
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
@ -50,7 +50,7 @@ echo '<div style="width:50%; float:left; padding-right: 30px;" id="leftcolumn">'
|
|||||||
$sql = "SELECT subject,timestamp,text,author FROM tnews where rownum <= 3 ORDER by timestamp DESC";
|
$sql = "SELECT subject,timestamp,text,author FROM tnews where rownum <= 3 ORDER by timestamp DESC";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$news = db_get_all_rows_sql ($sql);
|
$news = db_get_all_rows_sql ($sql);
|
||||||
if ($news !== false) {
|
if ($news !== false) {
|
||||||
echo '<table cellpadding="4" cellspacing="4" class="databox">';
|
echo '<table cellpadding="4" cellspacing="4" class="databox">';
|
||||||
@ -83,7 +83,7 @@ echo '<div style="width:50%; float:left; padding-right: 30px;" id="leftcolumn">'
|
|||||||
|
|
||||||
// Show last activity from this user
|
// Show last activity from this user
|
||||||
echo '<div id="activity">';
|
echo '<div id="activity">';
|
||||||
|
|
||||||
$table->width = '100%'; //Don't specify px
|
$table->width = '100%'; //Don't specify px
|
||||||
$table->data = array ();
|
$table->data = array ();
|
||||||
$table->size = array ();
|
$table->size = array ();
|
||||||
@ -97,7 +97,7 @@ echo '<div style="width:50%; float:left; padding-right: 30px;" id="leftcolumn">'
|
|||||||
$table->head[3] = __('Source IP');
|
$table->head[3] = __('Source IP');
|
||||||
$table->head[4] = __('Comments');
|
$table->head[4] = __('Comments');
|
||||||
$table->title = '<span class="med_data">' . __('This is your last activity in Pandora FMS console') . '</span>';
|
$table->title = '<span class="med_data">' . __('This is your last activity in Pandora FMS console') . '</span>';
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$sql = sprintf ("SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp
|
$sql = sprintf ("SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp
|
||||||
@ -118,12 +118,12 @@ echo '<div style="width:50%; float:left; padding-right: 30px;" id="leftcolumn">'
|
|||||||
AND id_usuario = '%s') AND rownum <= 10 ORDER BY utimestamp DESC", $config["id_user"]);
|
AND id_usuario = '%s') AND rownum <= 10 ORDER BY utimestamp DESC", $config["id_user"]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sessions = db_get_all_rows_sql ($sql);
|
$sessions = db_get_all_rows_sql ($sql);
|
||||||
|
|
||||||
if ($sessions === false)
|
if ($sessions === false)
|
||||||
$sessions = array ();
|
$sessions = array ();
|
||||||
|
|
||||||
foreach ($sessions as $session) {
|
foreach ($sessions as $session) {
|
||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ if (is_ajax ()) {
|
|||||||
require ("general/noaccess.php");
|
require ("general/noaccess.php");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$get_group_json = (bool) get_parameter ('get_group_json');
|
$get_group_json = (bool) get_parameter ('get_group_json');
|
||||||
$get_group_agents = (bool) get_parameter ('get_group_agents');
|
$get_group_agents = (bool) get_parameter ('get_group_agents');
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ if (is_ajax ()) {
|
|||||||
$recursion = (int) get_parameter ('recursion', 0);
|
$recursion = (int) get_parameter ('recursion', 0);
|
||||||
// Ids of agents to be include in the SQL clause as id_agent IN ()
|
// Ids of agents to be include in the SQL clause as id_agent IN ()
|
||||||
$filter_agents_json = (string) get_parameter ('filter_agents_json', '');
|
$filter_agents_json = (string) get_parameter ('filter_agents_json', '');
|
||||||
|
|
||||||
if (! check_acl ($config['id_user'], $id_group, "AR")) {
|
if (! check_acl ($config['id_user'], $id_group, "AR")) {
|
||||||
db_pandora_audit("ACL Violation",
|
db_pandora_audit("ACL Violation",
|
||||||
"Trying to access Alert Management");
|
"Trying to access Alert Management");
|
||||||
@ -77,13 +77,13 @@ if (is_ajax ()) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($filter_agents_json != '') {
|
if ($filter_agents_json != '') {
|
||||||
$filter['id_agente'] = json_decode(io_safe_output($filter_agents_json), true);
|
$filter['id_agente'] = json_decode(io_safe_output($filter_agents_json), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$filter['disabled'] = $disabled;
|
$filter['disabled'] = $disabled;
|
||||||
|
|
||||||
if($search != '') {
|
if ($search != '') {
|
||||||
$filter['string'] = $search;
|
$filter['string'] = $search;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ if (is_ajax ()) {
|
|||||||
echo json_encode ($agents);
|
echo json_encode ($agents);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ if (! check_acl($config['id_user'], 0, "PM")) {
|
|||||||
|
|
||||||
// Header
|
// Header
|
||||||
if (defined('METACONSOLE')) {
|
if (defined('METACONSOLE')) {
|
||||||
|
|
||||||
user_meta_print_header();
|
user_meta_print_header();
|
||||||
$sec = 'advanced';
|
$sec = 'advanced';
|
||||||
|
|
||||||
|
@ -191,11 +191,11 @@ ui_require_jquery_file ('pandora.controls');
|
|||||||
var module_alerts;
|
var module_alerts;
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
var source_recursion;
|
var source_recursion;
|
||||||
$("#checkbox-source_recursion").click(function (){
|
$("#checkbox-source_recursion").click(function () {
|
||||||
source_recursion = this.checked ? 1 : 0;
|
source_recursion = this.checked ? 1 : 0;
|
||||||
$("#source_id_group").trigger("change");
|
$("#source_id_group").trigger("change");
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#source_id_group").pandoraSelectGroupAgent ({
|
$("#source_id_group").pandoraSelectGroupAgent ({
|
||||||
agentSelect: "select#source_id_agent",
|
agentSelect: "select#source_id_agent",
|
||||||
recursion: function() {return source_recursion},
|
recursion: function() {return source_recursion},
|
||||||
@ -203,11 +203,11 @@ $(document).ready (function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var destiny_recursion;
|
var destiny_recursion;
|
||||||
$("#checkbox-destiny_recursion").click(function (){
|
$("#checkbox-destiny_recursion").click(function () {
|
||||||
destiny_recursion = this.checked ? 1 : 0;
|
destiny_recursion = this.checked ? 1 : 0;
|
||||||
$("#destiny_id_group").trigger("change");
|
$("#destiny_id_group").trigger("change");
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#destiny_id_group").pandoraSelectGroupAgent ({
|
$("#destiny_id_group").pandoraSelectGroupAgent ({
|
||||||
agentSelect: "select#destiny_id_agent",
|
agentSelect: "select#destiny_id_agent",
|
||||||
recursion: function() {return destiny_recursion},
|
recursion: function() {return destiny_recursion},
|
||||||
@ -222,9 +222,23 @@ $(document).ready (function () {
|
|||||||
|
|
||||||
$("#source_id_agent").change (function () {
|
$("#source_id_agent").change (function () {
|
||||||
var id_agent = this.value;
|
var id_agent = this.value;
|
||||||
|
|
||||||
if (id_agent == 0) {
|
if (id_agent == 0) {
|
||||||
|
$("#submit-go").attr("disabled", "disabled");
|
||||||
|
|
||||||
|
$("span.without_modules, span.without_alerts").hide();
|
||||||
|
$("span.without_modules").hide();
|
||||||
|
$("span.with_modules").hide();
|
||||||
|
$("span.without_alerts").hide();
|
||||||
|
$("span.with_alerts").hide();
|
||||||
|
$("#fieldset_destiny, #target_table-operations").hide();
|
||||||
|
$("#fieldset_targets").hide();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#submit-go").attr("disabled", false);
|
||||||
|
|
||||||
$("#modules_loading").show ();
|
$("#modules_loading").show ();
|
||||||
$("#target_modules option, #target_alerts option").remove ();
|
$("#target_modules option, #target_alerts option").remove ();
|
||||||
$("#target_modules, #target_alerts").disable ();
|
$("#target_modules, #target_alerts").disable ();
|
||||||
|
@ -963,10 +963,18 @@ function agents_get_group_agents ($id_group = 0, $search = false, $case = "lower
|
|||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
$sql = sprintf ("SELECT id_agente, nombre FROM tagente WHERE (%s %s) AND (%s) ORDER BY nombre", $extra_sql, $search_group_sql, $search_sql);
|
$sql = sprintf ("SELECT id_agente, nombre
|
||||||
|
FROM tagente
|
||||||
|
WHERE (%s %s) AND (%s)
|
||||||
|
ORDER BY nombre",
|
||||||
|
$extra_sql, $search_group_sql, $search_sql);
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$sql = sprintf ("SELECT id_agente, nombre FROM tagente WHERE (%s %s) AND (%s) ORDER BY dbms_lob.substr(nombre,4000,1)", $extra_sql, $search_group_sql, $search_sql);
|
$sql = sprintf ("SELECT id_agente, nombre
|
||||||
|
FROM tagente
|
||||||
|
WHERE (%s %s) AND (%s)
|
||||||
|
ORDER BY dbms_lob.substr(nombre,4000,1)",
|
||||||
|
$extra_sql, $search_group_sql, $search_sql);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,15 +495,15 @@ function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height,
|
|||||||
$graph['font_size'] = $font_size;
|
$graph['font_size'] = $font_size;
|
||||||
$graph['legend_position'] = $legend_position;
|
$graph['legend_position'] = $legend_position;
|
||||||
$graph['color'] = $colors;
|
$graph['color'] = $colors;
|
||||||
|
|
||||||
$id_graph = serialize_in_temp($graph, null, $ttl);
|
$id_graph = serialize_in_temp($graph, null, $ttl);
|
||||||
|
|
||||||
switch($graph_type) {
|
switch ($graph_type) {
|
||||||
case "2d":
|
case "2d":
|
||||||
return "<img src='" . $homedir . "include/graphs/functions_pchart.php?static_graph=1&graph_type=pie2d&ttl=".$ttl."&id_graph=".$id_graph."'>";
|
return "<img src='" . $homedir . "include/graphs/functions_pchart.php?static_graph=1&graph_type=pie2d&ttl=".$ttl."&id_graph=".$id_graph."'>";
|
||||||
break;
|
break;
|
||||||
case "3d":
|
case "3d":
|
||||||
return "<img src='" . $homedir . "include/graphs/functions_pchart.php?static_graph=1&graph_type=pie3d&ttl=".$ttl."&id_graph=".$id_graph."'>";
|
return "<img src='" . $homedir . "include/graphs/functions_pchart.php?static_graph=1&graph_type=pie3d&ttl=".$ttl."&id_graph=".$id_graph."'>";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,36 +50,33 @@ function include_javascript_dependencies_flot_graph($return = false) {
|
|||||||
<script language="javascript" type="text/javascript" src="'.
|
<script language="javascript" type="text/javascript" src="'.
|
||||||
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.symbol.min.js') .'"></script>
|
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.symbol.min.js') .'"></script>
|
||||||
<script language="javascript" type="text/javascript" src="'.
|
<script language="javascript" type="text/javascript" src="'.
|
||||||
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/pandora.flot.js') .'"></script>
|
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/pandora.flot.js') .'"></script>';
|
||||||
';
|
|
||||||
$output .= "
|
$output .= "
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
function pieHover(event, pos, obj)
|
function pieHover(event, pos, obj)
|
||||||
{
|
{
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return;
|
return;
|
||||||
percent = parseFloat(obj.series.percent).toFixed(2);
|
percent = parseFloat(obj.series.percent).toFixed(2);
|
||||||
$('#hover').html('<span style=\'font-weight: bold; color: '+obj.series.color+'\'>'+obj.series.label+' ('+percent+'%)</span>');
|
$('#hover').html('<span style=\'font-weight: bold; color: '+obj.series.color+'\'>'+obj.series.label+' ('+percent+'%)</span>');
|
||||||
$('.legendLabel').each(function() {
|
$('.legendLabel').each(function() {
|
||||||
if($(this).html() == obj.series.label) {
|
if($(this).html() == obj.series.label) {
|
||||||
$(this).css('font-weight','bold');
|
$(this).css('font-weight','bold');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$(this).css('font-weight','');
|
$(this).css('font-weight','');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function pieClick(event, pos, obj)
|
function pieClick(event, pos, obj)
|
||||||
{
|
{
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return;
|
return;
|
||||||
percent = parseFloat(obj.series.percent).toFixed(2);
|
percent = parseFloat(obj.series.percent).toFixed(2);
|
||||||
alert(''+obj.series.label+': '+percent+'%');
|
alert(''+obj.series.label+': '+percent+'%');
|
||||||
}
|
}
|
||||||
</script>
|
</script>";
|
||||||
"
|
|
||||||
;
|
|
||||||
|
|
||||||
if (!$return)
|
if (!$return)
|
||||||
echo $output;
|
echo $output;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user