2010-11-25 Miguel de Dios <miguel.dedios@artica.es>

* 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
This commit is contained in:
mdtrooper 2010-11-25 10:15:41 +00:00
parent 3171e37234
commit d97e5f7ba3
3 changed files with 23 additions and 15 deletions

View File

@ -1,6 +1,13 @@
2010-11-23 Raúl Mateos <raulofpandora@gmail.com> 2010-11-25 Miguel de Dios <miguel.dedios@artica.es>
* operation/events/events.php: Use "back not normal" icon in full screen. * 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 <miguel.dedios@artica.es> 2010-11-23 Miguel de Dios <miguel.dedios@artica.es>

View File

@ -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 `field2` varchar(250) NOT NULL default '';
ALTER TABLE trecon_task ADD COLUMN `field3` 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 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 `descripcion` TEXT NOT NULL default '';
ALTER TABLE tagente_modulo MODIFY `tcp_send` TEXT default ''; ALTER TABLE tagente_modulo MODIFY `tcp_send` TEXT default '';

View File

@ -91,17 +91,17 @@ if (($create != "") OR ($view != "")){
if ($create != ""){ if ($create != ""){
echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('Create')."'>"; echo "<input name='crtbutton' type='submit' class='sub wand' value='".__('Create')."'>";
} else { }
else {
echo "<input name='uptbutton' type='submit' class='sub upd' value='".__('Update')."'>"; echo "<input name='uptbutton' type='submit' class='sub upd' value='".__('Update')."'>";
} }
echo '</form></table>'; echo '</form></table>';
} }
else { else {
print_page_header (__('Recon scripts registered in Pandora FMS'), "", false, "", true); print_page_header (__('Recon scripts registered in Pandora FMS'), "", false, "", true);
// Update reconscript // 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); $id_recon_script = get_parameter ("update_reconscript", 0);
$reconscript_name = get_parameter ("form_name", ""); $reconscript_name = get_parameter ("form_name", "");
$reconscript_description = get_parameter ("form_description", ""); $reconscript_description = get_parameter ("form_description", "");
@ -122,7 +122,7 @@ else {
} }
// Create reconscript // Create reconscript
if (isset($_GET["create_reconscript"])){ if (isset($_GET["create_reconscript"])) {
$reconscript_name = get_parameter ("form_name", ""); $reconscript_name = get_parameter ("form_name", "");
$reconscript_description = get_parameter ("form_description", ""); $reconscript_description = get_parameter ("form_description", "");
$reconscript_script = get_parameter ("form_script", ""); $reconscript_script = get_parameter ("form_script", "");
@ -145,7 +145,8 @@ else {
$result = process_sql($sql_delete); $result = process_sql($sql_delete);
if (! $result){ if (! $result){
echo "<h3 class='error'>".__('Problem deleting reconscript')."</h3>"; echo "<h3 class='error'>".__('Problem deleting reconscript')."</h3>";
} else { }
else {
echo "<h3 class='suc'>".__('reconscript deleted successfully')."</h3>"; echo "<h3 class='suc'>".__('reconscript deleted successfully')."</h3>";
} }
if ($reconscript_id != 0){ if ($reconscript_id != 0){
@ -158,7 +159,7 @@ else {
$sql1='SELECT * FROM trecon_script ORDER BY name'; $sql1='SELECT * FROM trecon_script ORDER BY name';
$result=mysql_query($sql1); $result=mysql_query($sql1);
if (mysql_num_rows($result) > 0){ if (mysql_num_rows($result) > 0) {
echo '<table width="730" cellspacing="4" cellpadding="4" class="databox">'; echo '<table width="730" cellspacing="4" cellpadding="4" class="databox">';
echo "<th>".__('Name')."</th>"; echo "<th>".__('Name')."</th>";
echo "<th>".__('Command')."</th>"; echo "<th>".__('Command')."</th>";
@ -175,20 +176,21 @@ else {
$color = 1; $color = 1;
} }
echo "<tr>"; echo "<tr>";
echo "<td class=$tdcolor>"; echo "<td class='$tdcolor'>";
echo "<b><a href='index.php?sec=gservers&sec2=godmode/servers/recon_script&view=".$row["id_recon_script"]."'>"; echo "<b><a href='index.php?sec=gservers&sec2=godmode/servers/recon_script&view=".$row["id_recon_script"]."'>";
echo $row["name"]; echo $row["name"];
echo "</a></b></td>"; echo "</a></b></td>";
echo "</td><td class=$tdcolor>"; echo "</td><td class='$tdcolor'>";
echo $row["script"]; echo $row["script"];
echo "</td><td class=$tdcolor>"; echo "</td><td class='$tdcolor'>";
echo $row["description"]; echo $row["description"];
echo "</td><td class=$tdcolor>"; echo "</td><td align='center' class='$tdcolor'>";
echo "<a href='index.php?sec=gservers&sec2=godmode/servers/recon_script&kill_reconscript=".$row["id_recon_script"]."'><img src='images/cross.png' border=0></a>"; echo "<a href='index.php?sec=gservers&sec2=godmode/servers/recon_script&kill_reconscript=".$row["id_recon_script"]."'><img src='images/cross.png' border=0></a>";
echo "</td></tr>"; echo "</td></tr>";
} }
echo "</table>"; echo "</table>";
} else { }
else {
echo '<div class="nf">'. __('There are no recon scripts in the system'); echo '<div class="nf">'. __('There are no recon scripts in the system');
echo "<br>"; echo "<br>";
} }