diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 17443e6a92..01e33870fd 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2010-08-04 Miguel de Dios + * include/functions_filemanager.php: added parameter $readOnly in the + function "file_explorer". + + *pandoradb.sql, extras/pandoradb_migrate_v3.1_to_v3.2.sql: added into the + table "talert_template_modules" the column "id_policy_alerts". + 2010-08-05 Sergio Martin * operation/agentes/networkmap.php: Change the default map to topology map 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 329650d309..01d5ec7a31 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 @@ -67,3 +67,8 @@ CREATE TABLE IF NOT EXISTS `tnetwork_map` ( -- ----------------------------------------------------- ALTER TABLE `tagente_modulo` ADD COLUMN `id_policy_module` INTEGER UNSIGNED NOT NULL DEFAULT 0 AFTER `nombre`; + +-- ----------------------------------------------------- +-- Table `talert_template_modules` +-- ----------------------------------------------------- +ALTER TABLE `talert_template_modules` ADD COLUMN `id_policy_alerts` int(10) unsigned NOT NULL default '0'; diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index 2e6aa289b2..bf24060816 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -423,7 +423,7 @@ function read_recursive_dir($dir, $relative_path = '') { * @param string $father The directory father don't navigate bottom this. * @param boolean $editor The flag to set the edition of text files. */ -function file_explorer($real_directory, $relative_directory, $url, $father = '', $editor = false) { +function file_explorer($real_directory, $relative_directory, $url, $father = '', $editor = false, $readOnly = false) { global $config; ?> @@ -606,7 +606,7 @@ function file_explorer($real_directory, $relative_directory, $url, $father = '', $data[4] .= print_input_hidden ('delete_file', 1, true); $data[4] .= ''; - if ($editor) { + if (($editor) && (!$readOnly)) { if ($fileinfo['mime'] == MIME_TEXT) { $data[4] .= ""; } @@ -617,23 +617,25 @@ function file_explorer($real_directory, $relative_directory, $url, $father = '', array_push ($table->data, $data); } - if (is_writable ($real_directory)) { - echo "
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
"; - } - else { - echo "
"; - echo "" . __('The directory is only readble.'); - echo "
"; + if (!$readOnly) { + if (is_writable ($real_directory)) { + echo "
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + } + else { + echo "
"; + echo "" . __('The directory is only readble.'); + echo "
"; + } } print_table ($table); } diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 64743b2d01..02ad69238b 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -277,23 +277,24 @@ CREATE TABLE IF NOT EXISTS `talert_templates` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `talert_template_modules` ( - `id` int(10) unsigned NOT NULL auto_increment, - `id_agent_module` int(10) unsigned NOT NULL, - `id_alert_template` int(10) unsigned NOT NULL, - `internal_counter` int(4) default '0', - `last_fired` bigint(20) NOT NULL default '0', - `last_reference` bigint(20) NOT NULL default '0', - `times_fired` int(3) NOT NULL default '0', - `disabled` tinyint(1) default '0', - `priority` tinyint(4) default '0', - `force_execution` tinyint(1) default '0', - PRIMARY KEY (`id`), - KEY `idx_template_module` (`id_agent_module`), - FOREIGN KEY (`id_agent_module`) REFERENCES tagente_modulo(`id_agente_modulo`) - ON DELETE CASCADE ON UPDATE CASCADE, - FOREIGN KEY (`id_alert_template`) REFERENCES talert_templates(`id`) - ON DELETE CASCADE ON UPDATE CASCADE, - UNIQUE (`id_agent_module`, `id_alert_template`) + `id` int(10) unsigned NOT NULL auto_increment, + `id_agent_module` int(10) unsigned NOT NULL, + `id_alert_template` int(10) unsigned NOT NULL, + `id_policy_alerts` int(10) unsigned NOT NULL default '0', + `internal_counter` int(4) default '0', + `last_fired` bigint(20) NOT NULL default '0', + `last_reference` bigint(20) NOT NULL default '0', + `times_fired` int(3) NOT NULL default '0', + `disabled` tinyint(1) default '0', + `priority` tinyint(4) default '0', + `force_execution` tinyint(1) default '0', + PRIMARY KEY (`id`), + KEY `idx_template_module` (`id_agent_module`), + FOREIGN KEY (`id_agent_module`) REFERENCES tagente_modulo(`id_agente_modulo`) + ON DELETE CASCADE ON UPDATE CASCADE, + FOREIGN KEY (`id_alert_template`) REFERENCES talert_templates(`id`) + ON DELETE CASCADE ON UPDATE CASCADE, + UNIQUE (`id_agent_module`, `id_alert_template`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `talert_template_module_actions` (