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