diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b0dbe8893b..b0c20f7761 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2013-03-15 Miguel de Dios + + * 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 * include/help/en/help_plugin_policy.php diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index 5a2184cd5e..9d16db1006 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -40,7 +40,7 @@ if(tags_has_user_acl_tags()) { echo '
'; //////////////////NEWS BOARD///////////////////////////// echo '
'; - + switch ($config["dbtype"]) { case "mysql": case "postgresql": @@ -50,7 +50,7 @@ echo '
' $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 ''; @@ -83,7 +83,7 @@ echo '
' // Show last activity from this user echo '
'; - + $table->width = '100%'; //Don't specify px $table->data = array (); $table->size = array (); @@ -97,7 +97,7 @@ echo '
' $table->head[3] = __('Source IP'); $table->head[4] = __('Comments'); $table->title = '' . __('This is your last activity in Pandora FMS console') . ''; - + switch ($config["dbtype"]) { case "mysql": $sql = sprintf ("SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp @@ -118,12 +118,12 @@ echo '
' 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 (); diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index fd2c8824ac..c600a2fa67 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -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'; diff --git a/pandora_console/godmode/massive/massive_copy_modules.php b/pandora_console/godmode/massive/massive_copy_modules.php index 2ef708e0bf..53e2ae5505 100644 --- a/pandora_console/godmode/massive/massive_copy_modules.php +++ b/pandora_console/godmode/massive/massive_copy_modules.php @@ -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 (); diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 9ca9c39ffa..9048a95b15 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -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; } diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 0ab44db06f..7efbbbfb2f 100755 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -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 ""; + return ""; break; case "3d": - return ""; + return ""; break; } } diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 716be26f1b..26739fc76f 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -50,36 +50,33 @@ function include_javascript_dependencies_flot_graph($return = false) { - '; + ui_get_full_url($metaconsole_hack . '/include/graphs/flot/pandora.flot.js') .'">'; $output .= " - - " - ; + "; if (!$return) echo $output;