MADE only on compatible module types

This commit is contained in:
Calvo 2023-10-11 17:43:28 +02:00
parent 35db83647a
commit 6612fe96bd
4 changed files with 578 additions and 540 deletions

View File

@ -1337,7 +1337,7 @@ if ($update_module === true || $create_module === true) {
*/
$post_process = (string) get_parameter('post_process', 0.0);
if (modules_is_string_type($id_module_type) === false) {
if (modules_made_compatible($id_module_type) === false) {
$made_enabled = (bool) get_parameter_checkbox('made_enabled', 0);
} else {
$made_enabled = false;

View File

@ -2654,7 +2654,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
$values['macros'] = json_encode($module_macros);
}
if (modules_is_string_type($module['id_tipo_modulo']) === true) {
if (modules_made_compatible($module['id_tipo_modulo']) === false) {
$values['made_enabled'] = 0;
}

View File

@ -4762,3 +4762,30 @@ function export_agents_module_csv($filters)
return $result;
}
/**
* Check if modules are compatible with MADE server.
*
* @param integer $id_tipo_modulo
* @retur boolean True if compatible, false otherwise.
*/
function modules_made_compatible($id_tipo_modulo)
{
$compatible_types = [
1,
4,
5,
15,
16,
22,
30,
34,
];
if (array_search($id_tipo_modulo, $compatible_types) === false) {
return false;
} else {
return true;
}
}