$id_plugin));
$preload = io_safe_output($description);
$preload = str_replace ("\n", "
", $preload);
echo $preload;
return;
}
// Load global vars
global $config;
require_once ($config['homedir'] . "/include/functions_filemanager.php");
check_login ();
if (! check_acl ($config['id_user'], 0, "LM")) {
db_pandora_audit("ACL Violation",
"Trying to access Plugin Management");
require ("general/noaccess.php");
return;
}
enterprise_include_once ('meta/include/functions_components_meta.php');
$view = get_parameter ("view", "");
$create = get_parameter ("create", "");
$filemanager = (bool)get_parameter("filemanager", false);
$plugin_command = get_parameter('plugin_command', '');
$tab = get_parameter('tab', '');
if ($view != "") {
$form_id = $view;
$plugin = db_get_row ("tplugin", "id", $form_id);
$form_name = $plugin["name"];
$form_description = $plugin["description"];
$form_max_timeout = $plugin ["max_timeout"];
$form_max_retries = $plugin ["max_retries"];
if (empty($plugin_command))
$form_execute = $plugin ["execute"];
else
$form_execute = $plugin_command;
$form_plugin_type = $plugin ["plugin_type"];
$macros = $plugin ["macros"];
$parameters = $plugin ["parameters"];
}
if ($create != "") {
$form_id = 0;
$form_name = "";
$form_description = "";
$form_max_timeout = 15;
$form_max_retries = 1;
$form_execute = $plugin_command;
$form_plugin_type = 0;
$form_parameters = "";
$macros = "";
$parameters = "";
}
//END LOAD VALUES
// =====================================================================
// INIT FILEMANAGER
// =====================================================================
if ($filemanager) {
$id_plugin = (int)get_parameter('id_plugin', 0);
/* Add custom directories here */
$fallback_directory = "attachment/plugin";
$directory = (string) get_parameter ('directory', $fallback_directory);
// A miminal security check to avoid directory traversal
if (preg_match ("/\.\./", $directory))
$directory = $fallback_directory;
if (preg_match ("/^\//", $directory))
$directory = $fallback_directory;
if (preg_match ("/^manager/", $directory))
$directory = $fallback_directory;
$banned_directories['include'] = true;
$banned_directories['godmode'] = true;
$banned_directories['operation'] = true;
$banned_directories['reporting'] = true;
$banned_directories['general'] = true;
$banned_directories[ENTERPRISE_DIR] = true;
if (isset ($banned_directories[$directory]))
$directory = $fallback_directory;
$real_directory = realpath ($config['homedir'] . '/' . $directory);
echo '