mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
11094-Fix plugin data recovery
This commit is contained in:
parent
a6212c2777
commit
f4cf8e769a
@ -146,10 +146,12 @@ foreach ($password_fields as $k => $p) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const moduleId = <?php echo $id_agent_module; ?>;
|
||||
|
||||
load_plugin_description($("#id_plugin").val());
|
||||
|
||||
load_plugin_macros_fields('simple-macro');
|
||||
load_plugin_macros_fields('simple-macro', moduleId);
|
||||
|
||||
forced_title_callback();
|
||||
|
||||
|
@ -38,6 +38,7 @@ if (check_login()) {
|
||||
enterprise_include_once('include/functions_metaconsole.php');
|
||||
|
||||
$get_plugin_macros = get_parameter('get_plugin_macros');
|
||||
$get_module_macros = get_parameter('get_module_macros');
|
||||
$search_modules = get_parameter('search_modules');
|
||||
$get_module_detail = get_parameter('get_module_detail', 0);
|
||||
$get_module_autocomplete_input = (bool) get_parameter(
|
||||
@ -118,6 +119,28 @@ if (check_login()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($get_module_macros && $get_module_macros > 0) {
|
||||
if (https_is_running()) {
|
||||
header('Content-type: application/json');
|
||||
}
|
||||
|
||||
$module_id = $get_module_macros;
|
||||
|
||||
$module_macros = db_get_value(
|
||||
'macros',
|
||||
'tagente_modulo',
|
||||
'id_agente_modulo',
|
||||
$module_id
|
||||
);
|
||||
|
||||
$macros = [];
|
||||
$macros['base64'] = base64_encode($module_macros);
|
||||
$macros['array'] = json_decode($module_macros, true);
|
||||
|
||||
echo json_encode($macros);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($search_modules) {
|
||||
if (https_is_running()) {
|
||||
header('Content-type: application/json');
|
||||
|
@ -997,13 +997,18 @@ function add_macro_field(macro, row_model_id, type_copy, k) {
|
||||
$("#" + row_id).show();
|
||||
}
|
||||
|
||||
function load_plugin_macros_fields(row_model_id) {
|
||||
function load_plugin_macros_fields(row_model_id, moduleId = 0) {
|
||||
// Get plugin macros when selected and load macros fields
|
||||
var id_plugin = $("#id_plugin").val();
|
||||
|
||||
var params = [];
|
||||
params.push("page=include/ajax/module");
|
||||
params.push("get_plugin_macros=1");
|
||||
|
||||
if (moduleId > 0) {
|
||||
params.push("get_module_macros=" + moduleId);
|
||||
} else {
|
||||
params.push("get_plugin_macros=1");
|
||||
}
|
||||
params.push("id_plugin=" + id_plugin);
|
||||
|
||||
jQuery.ajax({
|
||||
|
Loading…
x
Reference in New Issue
Block a user