mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Fix duplicate code
This commit is contained in:
parent
3c01ffa27f
commit
e0437d3fbd
@ -1970,10 +1970,10 @@ if ($create_module) {
|
|||||||
|
|
||||||
// MODULE ENABLE/DISABLE
|
// MODULE ENABLE/DISABLE
|
||||||
// =====================.
|
// =====================.
|
||||||
if ($enable_module) {
|
/*
|
||||||
|
if ($enable_module) {
|
||||||
$result = modules_change_disabled($enable_module, 0);
|
$result = modules_change_disabled($enable_module, 0);
|
||||||
$module_name = modules_get_agentmodule_name($enable_module);
|
$module_name = modules_get_agentmodule_name($enable_module);
|
||||||
|
|
||||||
// Write for conf disable if remote_config.
|
// Write for conf disable if remote_config.
|
||||||
$configuration_data = enterprise_hook(
|
$configuration_data = enterprise_hook(
|
||||||
'config_agents_get_module_from_conf',
|
'config_agents_get_module_from_conf',
|
||||||
@ -1987,10 +1987,8 @@ if ($enable_module) {
|
|||||||
|
|
||||||
// Force Update when disabled for save disabled in conf.
|
// Force Update when disabled for save disabled in conf.
|
||||||
$old_configuration_data = $configuration_data;
|
$old_configuration_data = $configuration_data;
|
||||||
|
|
||||||
// Successfull action.
|
// Successfull action.
|
||||||
$success_action = $result;
|
$success_action = $result;
|
||||||
|
|
||||||
$success_action = $result;
|
$success_action = $result;
|
||||||
if ($result === NOERR) {
|
if ($result === NOERR) {
|
||||||
db_pandora_audit(
|
db_pandora_audit(
|
||||||
@ -2003,9 +2001,11 @@ if ($enable_module) {
|
|||||||
'Fail to enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
'Fail to enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($disable_module) {
|
if ($disable_module) {
|
||||||
|
|
||||||
|
hd($disable_module, true);
|
||||||
$result = modules_change_disabled($disable_module, 1);
|
$result = modules_change_disabled($disable_module, 1);
|
||||||
$module_name = modules_get_agentmodule_name($disable_module);
|
$module_name = modules_get_agentmodule_name($disable_module);
|
||||||
|
|
||||||
@ -2029,18 +2029,20 @@ if ($disable_module) {
|
|||||||
|
|
||||||
|
|
||||||
if ($result === NOERR) {
|
if ($result === NOERR) {
|
||||||
|
hd($disable_module, true);
|
||||||
db_pandora_audit(
|
db_pandora_audit(
|
||||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||||
'Disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
'Disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
hd($disable_module, true);
|
||||||
db_pandora_audit(
|
db_pandora_audit(
|
||||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||||
'Fail to disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
'Fail to disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// Fix to stop the module from being added to the agent's conf
|
// Fix to stop the module from being added to the agent's conf
|
||||||
// when an error occurred while updating or inserting. or enable disable module.
|
// when an error occurred while updating or inserting. or enable disable module.
|
||||||
if ($update_module || $create_module
|
if ($update_module || $create_module
|
||||||
|
Loading…
x
Reference in New Issue
Block a user