From c7e071f853707cfe4b5a1a5c0c8a9363da13013d Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 7 Nov 2012 15:15:18 +0000 Subject: [PATCH] 2012-11-07 Miguel de Dios * godmode/alerts/configure_alert_command.php, index.php: cleaned source code style. * godmode/alerts/alert_commands.php: fixed the check the name of command that it did not make the update the data. MERGED FROM THE BRANCH PANDORA_4. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7134 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 ++++++++++ pandora_console/godmode/alerts/alert_commands.php | 11 ++++++----- .../godmode/alerts/configure_alert_command.php | 3 ++- pandora_console/index.php | 3 ++- pandora_console/operation/events/events_list.php | 10 ++++++---- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a54e37d880..91d9ac19a6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2012-11-07 Miguel de Dios + + * godmode/alerts/configure_alert_command.php, index.php: cleaned + source code style. + + * godmode/alerts/alert_commands.php: fixed the check the name of + command that it did not make the update the data. + + MERGED FROM THE BRANCH PANDORA_4. + 2012-11-06 Ramon Novoa * pandoradb.sql, diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index e27ca14910..4e7cd87ac1 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -165,16 +165,17 @@ if ($update_command) { $fields_values[] = (string) get_parameter ('field'.$i.'_values'); $info_fields .= ' Field'.$i.': ' . $values['field'.$i]; } - + $values['fields_values'] = json_encode($fields_values); $values['fields_descriptions'] = json_encode($fields_descriptions); $values['name'] = $name; $values['command'] = $command; $values['description'] = $description; - $name_check = db_get_value ('name', 'talert_commands', 'name', $name); - if (!$name || !$name_check) { + //Check it the new name is used in the other command. + $id_check = db_get_value ('id', 'talert_commands', 'name', $name); + if (($id_check != $id) && (!empty($id_check))) { $result = ''; } else { @@ -258,7 +259,7 @@ foreach ($commands as $command) { array_push ($table->data, $data); } -if(isset($data)) { +if (isset($data)) { html_print_table ($table); } else { @@ -271,4 +272,4 @@ html_print_submit_button (__('Create'), 'create', false, 'class="sub next"'); html_print_input_hidden ('create_alert', 1); echo ''; echo ''; -?> +?> \ No newline at end of file diff --git a/pandora_console/godmode/alerts/configure_alert_command.php b/pandora_console/godmode/alerts/configure_alert_command.php index cfc6ad548b..6f0df394e2 100644 --- a/pandora_console/godmode/alerts/configure_alert_command.php +++ b/pandora_console/godmode/alerts/configure_alert_command.php @@ -52,7 +52,8 @@ if(!empty($fields_values)) { } // Header -ui_print_page_header (__('Alerts').' » '.__('Configure alert command'), "images/god2.png", false, "", true); +ui_print_page_header (__('Alerts') . ' » ' . + __('Configure alert command'), "images/god2.png", false, "", true); $table->width = '98%'; $table->style = array (); diff --git a/pandora_console/index.php b/pandora_console/index.php index 5673be8454..e455a29a79 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -311,6 +311,7 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) { } elseif (! isset ($config['id_user'])) { // There is no user connected + require_once ('general/login_page.php'); while (@ob_end_flush ()); exit (""); @@ -434,7 +435,7 @@ else { // Enterprise ACL check if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $sec, $sec2, true)) == false) { require ("general/noaccess.php"); - } + } elseif (file_exists ($page)) { if (! extensions_is_extension ($page)) { require_once($page); diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 21f30c9465..56211e6a7c 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -480,7 +480,6 @@ else { GROUP BY evento, id_agentmodule) AS t"; } - $total_events = (int) db_get_sql ($sql); if (empty ($result)) { $result = array (); @@ -646,9 +645,12 @@ foreach ($result as $event) { // Store group data to show in extended view $data[$i] .= html_print_input_hidden('similar_ids_'.$event["id_evento"], $similar_ids, true); $data[$i] .= html_print_input_hidden('timestamp_first_'.$event["id_evento"], $timestamp_first, true); - $data[$i] .= html_print_input_hidden('timestamp_last_'.$event["id_evento"], $timestamp_last, true); - $data[$i] .= html_print_input_hidden('event_rep_'.$event["id_evento"], $event['event_rep'], true); - // Store concat comments to show in extended view + $data[$i] .= html_print_input_hidden('timestamp_last_'.$event["id_evento"], $timestamp_last, true); + if (empty($event['event_rep'])) { + $event['event_rep'] = 0; + } + $data[$i] .= html_print_input_hidden('event_rep_'.$event["id_evento"], $event['event_rep'], true); + // Store concat comments to show in extended view $data[$i] .= html_print_input_hidden('user_comment_'.$event["id_evento"], base64_encode($event['user_comment']), true); $i++;