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:
mdtrooper 2013-03-15 14:35:52 +00:00
parent c91f41f0b3
commit 7025a8deec
7 changed files with 80 additions and 52 deletions

View File

@ -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>
* include/help/en/help_plugin_policy.php

View File

@ -40,7 +40,7 @@ if(tags_has_user_acl_tags()) {
echo '<div style="width:50%; float:left; padding-right: 30px;" id="leftcolumn">';
//////////////////NEWS BOARD/////////////////////////////
echo '<div id="news_board">';
switch ($config["dbtype"]) {
case "mysql":
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";
break;
}
$news = db_get_all_rows_sql ($sql);
if ($news !== false) {
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
echo '<div id="activity">';
$table->width = '100%'; //Don't specify px
$table->data = 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[4] = __('Comments');
$table->title = '<span class="med_data">' . __('This is your last activity in Pandora FMS console') . '</span>';
switch ($config["dbtype"]) {
case "mysql":
$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"]);
break;
}
$sessions = db_get_all_rows_sql ($sql);
if ($sessions === false)
$sessions = array ();
foreach ($sessions as $session) {
$data = array ();

View File

@ -30,7 +30,7 @@ if (is_ajax ()) {
require ("general/noaccess.php");
return;
}
$get_group_json = (bool) get_parameter ('get_group_json');
$get_group_agents = (bool) get_parameter ('get_group_agents');
@ -69,7 +69,7 @@ if (is_ajax ()) {
$recursion = (int) get_parameter ('recursion', 0);
// Ids of agents to be include in the SQL clause as id_agent IN ()
$filter_agents_json = (string) get_parameter ('filter_agents_json', '');
if (! check_acl ($config['id_user'], $id_group, "AR")) {
db_pandora_audit("ACL Violation",
"Trying to access Alert Management");
@ -77,13 +77,13 @@ if (is_ajax ()) {
return;
}
if($filter_agents_json != '') {
if ($filter_agents_json != '') {
$filter['id_agente'] = json_decode(io_safe_output($filter_agents_json), true);
}
$filter['disabled'] = $disabled;
if($search != '') {
if ($search != '') {
$filter['string'] = $search;
}
@ -93,7 +93,7 @@ if (is_ajax ()) {
echo json_encode ($agents);
return;
}
return;
}
@ -106,7 +106,7 @@ if (! check_acl($config['id_user'], 0, "PM")) {
// Header
if (defined('METACONSOLE')) {
user_meta_print_header();
$sec = 'advanced';

View File

@ -191,11 +191,11 @@ ui_require_jquery_file ('pandora.controls');
var module_alerts;
$(document).ready (function () {
var source_recursion;
$("#checkbox-source_recursion").click(function (){
$("#checkbox-source_recursion").click(function () {
source_recursion = this.checked ? 1 : 0;
$("#source_id_group").trigger("change");
});
$("#source_id_group").pandoraSelectGroupAgent ({
agentSelect: "select#source_id_agent",
recursion: function() {return source_recursion},
@ -203,11 +203,11 @@ $(document).ready (function () {
});
var destiny_recursion;
$("#checkbox-destiny_recursion").click(function (){
$("#checkbox-destiny_recursion").click(function () {
destiny_recursion = this.checked ? 1 : 0;
$("#destiny_id_group").trigger("change");
});
$("#destiny_id_group").pandoraSelectGroupAgent ({
agentSelect: "select#destiny_id_agent",
recursion: function() {return destiny_recursion},
@ -222,9 +222,23 @@ $(document).ready (function () {
$("#source_id_agent").change (function () {
var id_agent = this.value;
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;
}
$("#submit-go").attr("disabled", false);
$("#modules_loading").show ();
$("#target_modules option, #target_alerts option").remove ();
$("#target_modules, #target_alerts").disable ();

View File

@ -963,10 +963,18 @@ function agents_get_group_agents ($id_group = 0, $search = false, $case = "lower
switch ($config["dbtype"]) {
case "mysql":
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;
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;
}

View File

@ -495,15 +495,15 @@ function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height,
$graph['font_size'] = $font_size;
$graph['legend_position'] = $legend_position;
$graph['color'] = $colors;
$id_graph = serialize_in_temp($graph, null, $ttl);
switch($graph_type) {
switch ($graph_type) {
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;
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;
}
}

View File

@ -50,36 +50,33 @@ function include_javascript_dependencies_flot_graph($return = false) {
<script language="javascript" type="text/javascript" src="'.
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.symbol.min.js') .'"></script>
<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 .= "
<script type='text/javascript'>
function pieHover(event, pos, obj)
{
if (!obj)
return;
percent = parseFloat(obj.series.percent).toFixed(2);
$('#hover').html('<span style=\'font-weight: bold; color: '+obj.series.color+'\'>'+obj.series.label+' ('+percent+'%)</span>');
$('.legendLabel').each(function() {
if($(this).html() == obj.series.label) {
$(this).css('font-weight','bold');
}
else {
$(this).css('font-weight','');
}
});
}
function pieClick(event, pos, obj)
{
if (!obj)
return;
percent = parseFloat(obj.series.percent).toFixed(2);
alert(''+obj.series.label+': '+percent+'%');
}
</script>
"
;
<script type='text/javascript'>
function pieHover(event, pos, obj)
{
if (!obj)
return;
percent = parseFloat(obj.series.percent).toFixed(2);
$('#hover').html('<span style=\'font-weight: bold; color: '+obj.series.color+'\'>'+obj.series.label+' ('+percent+'%)</span>');
$('.legendLabel').each(function() {
if($(this).html() == obj.series.label) {
$(this).css('font-weight','bold');
}
else {
$(this).css('font-weight','');
}
});
}
function pieClick(event, pos, obj)
{
if (!obj)
return;
percent = parseFloat(obj.series.percent).toFixed(2);
alert(''+obj.series.label+': '+percent+'%');
}
</script>";
if (!$return)
echo $output;