$id_plugin]);
$preload = io_safe_output($description);
$preload = str_replace("\n", '
', $preload);
echo $preload;
return;
}
if ($get_list_modules_and_component_locked_plugin) {
$id_plugin = (int) get_parameter('id_plugin', 0);
$network_components = db_get_all_rows_filter(
'tnetwork_component',
['id_plugin' => $id_plugin]
);
if (empty($network_components)) {
$network_components = [];
}
$modules = db_get_all_rows_filter(
'tagente_modulo',
[
'delete_pending' => 0,
'id_plugin' => $id_plugin,
]
);
if (empty($modules)) {
$modules = [];
}
$table = null;
$table->width = '100%';
$table->head[0] = __('Network Components');
$table->data = [];
foreach ($network_components as $net_comp) {
$table->data[] = [$net_comp['name']];
}
if (!empty($table->data)) {
html_print_table($table);
echo '
';
}
$table = null;
$table->width = '100%';
$table->head[0] = __('Agent');
$table->head[1] = __('Module');
foreach ($modules as $mod) {
$agent_name = ''.modules_get_agentmodule_agent_alias(
$mod['id_agente_modulo']
).'';
$table->data[] = [
$agent_name,
$mod['nombre'],
];
}
if (!empty($table->data)) {
html_print_table($table);
}
return;
}
}
require_once $config['homedir'].'/include/functions_filemanager.php';
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access Plugin Management'
);
include '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);
$edit_file = get_parameter('edit_file', false);
$update_file = get_parameter('update_file', false);
$plugin_command = get_parameter('plugin_command', '');
$tab = get_parameter('tab', '');
$deploy_plugin = get_parameter('deploy_plugin', 0);
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) {
if ($edit_file) {
$location_file = get_parameter('location_file', '');
$filename = array_pop(explode('/', $location_file));
$file = file_get_contents($location_file);
echo '