From d97e5f7ba3aa6cf1094895025cbdbc7a7da2fdc4 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 25 Nov 2010 10:15:41 +0000 Subject: [PATCH] 2010-11-25 Miguel de Dios * extras/pandoradb_migrate_v3.1_to_v3.2.sql: erase the problematic foreign key in trecon_task. Fixes: #3118273 * godmode/servers/recon_script.php: when I readed source code for to check that when delete a recon_script delete recon task that use this. Cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3628 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 13 +++++++--- .../extras/pandoradb_migrate_v3.1_to_v3.2.sql | 1 - .../godmode/servers/recon_script.php | 24 ++++++++++--------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8057074667..c545631213 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,6 +1,13 @@ -2010-11-23 Raúl Mateos - - * operation/events/events.php: Use "back not normal" icon in full screen. +2010-11-25 Miguel de Dios + + * extras/pandoradb_migrate_v3.1_to_v3.2.sql: erase the problematic + foreign key in trecon_task. + + Fixes: #3118273 + + * godmode/servers/recon_script.php: when I readed source code for + to check that when delete a recon_script delete recon task that use + this. Cleaned source code style. 2010-11-23 Miguel de Dios diff --git a/pandora_console/extras/pandoradb_migrate_v3.1_to_v3.2.sql b/pandora_console/extras/pandoradb_migrate_v3.1_to_v3.2.sql index ca5d40e343..8db166011d 100644 --- a/pandora_console/extras/pandoradb_migrate_v3.1_to_v3.2.sql +++ b/pandora_console/extras/pandoradb_migrate_v3.1_to_v3.2.sql @@ -165,7 +165,6 @@ ALTER TABLE trecon_task ADD COLUMN `field1` varchar(250) NOT NULL default ''; ALTER TABLE trecon_task ADD COLUMN `field2` varchar(250) NOT NULL default ''; ALTER TABLE trecon_task ADD COLUMN `field3` varchar(250) NOT NULL default ''; ALTER TABLE trecon_task ADD COLUMN `field4` varchar(250) NOT NULL default ''; -ALTER TABLE trecon_task ADD FOREIGN KEY (`id_recon_script`) REFERENCES trecon_script(`id_recon_script`) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE tagente_modulo MODIFY `descripcion` TEXT NOT NULL default ''; ALTER TABLE tagente_modulo MODIFY `tcp_send` TEXT default ''; diff --git a/pandora_console/godmode/servers/recon_script.php b/pandora_console/godmode/servers/recon_script.php index 4d7bbcf360..b8528ee5b3 100644 --- a/pandora_console/godmode/servers/recon_script.php +++ b/pandora_console/godmode/servers/recon_script.php @@ -91,17 +91,17 @@ if (($create != "") OR ($view != "")){ if ($create != ""){ echo ""; - } else { + } + else { echo ""; } echo ''; } - else { print_page_header (__('Recon scripts registered in Pandora FMS'), "", false, "", true); // Update reconscript - if (isset($_GET["update_reconscript"])){ // if modified any parameter + if (isset($_GET["update_reconscript"])) { // if modified any parameter $id_recon_script = get_parameter ("update_reconscript", 0); $reconscript_name = get_parameter ("form_name", ""); $reconscript_description = get_parameter ("form_description", ""); @@ -122,7 +122,7 @@ else { } // Create reconscript - if (isset($_GET["create_reconscript"])){ + if (isset($_GET["create_reconscript"])) { $reconscript_name = get_parameter ("form_name", ""); $reconscript_description = get_parameter ("form_description", ""); $reconscript_script = get_parameter ("form_script", ""); @@ -145,7 +145,8 @@ else { $result = process_sql($sql_delete); if (! $result){ echo "

".__('Problem deleting reconscript')."

"; - } else { + } + else { echo "

".__('reconscript deleted successfully')."

"; } if ($reconscript_id != 0){ @@ -158,7 +159,7 @@ else { $sql1='SELECT * FROM trecon_script ORDER BY name'; $result=mysql_query($sql1); - if (mysql_num_rows($result) > 0){ + if (mysql_num_rows($result) > 0) { echo ''; echo ""; echo ""; @@ -175,20 +176,21 @@ else { $color = 1; } echo ""; - echo ""; - echo ""; } echo "
".__('Name')."".__('Command')."
"; + echo ""; echo ""; echo $row["name"]; echo ""; + echo ""; echo $row["script"]; - echo ""; + echo ""; echo $row["description"]; - echo ""; + echo ""; echo ""; echo "
"; - } else { + } + else { echo '
'. __('There are no recon scripts in the system'); echo "
"; }