2010-08-04 Miguel de Dios <miguel.dedios@artica.es>

* 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".
	


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3106 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2010-08-05 17:02:45 +00:00
parent 23a7e047a3
commit 33e11d7034
4 changed files with 51 additions and 36 deletions

View File

@ -1,3 +1,10 @@
2010-08-04 Miguel de Dios <miguel.dedios@artica.es>
* 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 <sergio.martin@artica.es>
* operation/agentes/networkmap.php: Change the default map to topology map

View File

@ -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';

View File

@ -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] .= '</form>';
if ($editor) {
if (($editor) && (!$readOnly)) {
if ($fileinfo['mime'] == MIME_TEXT) {
$data[4] .= "<a style='vertical-align: top;' href='$url&edit_file=1&location_file=" . $fileinfo['realpath'] . "&hash=" . md5($fileinfo['realpath'] . $config['dbpass']) . "' style='float: left;'><img src='images/edit.png' style='margin-top: 2px;' /></a>";
}
@ -617,23 +617,25 @@ function file_explorer($real_directory, $relative_directory, $url, $father = '',
array_push ($table->data, $data);
}
if (is_writable ($real_directory)) {
echo "<div style='text-align: right; width: " . $table->width . ";'>";
echo "<a href='javascript:show_form_create_folder();' style='margin-right: 3px;' title='" . __('Create directory') . "'>";
echo "<img src='images/mimetypes/directory.png' />";
echo "</a>";
echo "<a href='javascript: show_create_text_file();' style='margin-right: 3px;' title='" . __('Create text') . "'>";
echo "<img src='images/mimetypes/text.png' />";
echo "</a>";
echo "<a href='javascript: show_upload_file();' title='" . __('Upload file/s') . "'>";
echo "<img src='images/mimetypes/unknown.png' />";
echo "</a>";
echo "</div>";
}
else {
echo "<div style='text-align: right; width: " . $table->width . "; color:#AC4444;'>";
echo "<image src='images/info.png' />" . __('The directory is only readble.');
echo "</div>";
if (!$readOnly) {
if (is_writable ($real_directory)) {
echo "<div style='text-align: right; width: " . $table->width . ";'>";
echo "<a href='javascript:show_form_create_folder();' style='margin-right: 3px;' title='" . __('Create directory') . "'>";
echo "<img src='images/mimetypes/directory.png' />";
echo "</a>";
echo "<a href='javascript: show_create_text_file();' style='margin-right: 3px;' title='" . __('Create text') . "'>";
echo "<img src='images/mimetypes/text.png' />";
echo "</a>";
echo "<a href='javascript: show_upload_file();' title='" . __('Upload file/s') . "'>";
echo "<img src='images/mimetypes/unknown.png' />";
echo "</a>";
echo "</div>";
}
else {
echo "<div style='text-align: right; width: " . $table->width . "; color:#AC4444;'>";
echo "<image src='images/info.png' />" . __('The directory is only readble.');
echo "</div>";
}
}
print_table ($table);
}

View File

@ -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` (