2013-09-04 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/modificar_agente.php, include/functions_agents.php: fixed the delete agent when sometimes have remote config but not the enterprise. MERGED FROM THE BRANCH PANDORA_4 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8740 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
59054d4401
commit
1506127262
|
@ -1,3 +1,11 @@
|
|||
2013-09-04 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/agentes/modificar_agente.php,
|
||||
include/functions_agents.php: fixed the delete agent when sometimes
|
||||
have remote config but not the enterprise.
|
||||
|
||||
MERGED FROM THE BRANCH PANDORA_4
|
||||
|
||||
2013-09-04 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* include/functions_events.php,
|
||||
|
|
|
@ -85,11 +85,13 @@ if ($agent_to_delete) {
|
|||
|
||||
ui_print_result_message($result, __('Success deleted agent.'), __('Could not be deleted.'));
|
||||
|
||||
// Check if the remote config file still exist
|
||||
if (isset ($config["remote_config"])) {
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
if (enterprise_hook('config_agents_has_remote_configuration', $id_agente)) {
|
||||
ui_print_error_message(__('Maybe the files conf or md5 could not be deleted'));
|
||||
if (enterprise_installed()) {
|
||||
// Check if the remote config file still exist
|
||||
if (isset ($config["remote_config"])) {
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
if (enterprise_hook('config_agents_has_remote_configuration', $id_agente)) {
|
||||
ui_print_error_message(__('Maybe the files conf or md5 could not be deleted'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,8 @@ if (is_ajax ()) {
|
|||
}
|
||||
|
||||
if ($get_module_local_components) {
|
||||
require_once ($config['homedir'].'/'.ENTERPRISE_DIR.'/include/functions_local_components.php');
|
||||
require_once ($config['homedir'] . '/' . ENTERPRISE_DIR .
|
||||
'/include/functions_local_components.php');
|
||||
|
||||
$id_module_group = (int) get_parameter ('id_module_component_group');
|
||||
$localComponents = local_components_get_local_components(
|
||||
|
|
|
@ -1668,26 +1668,28 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
|
|||
// db_process_delete_temp ("tagente_datos_inc", "id_agente_modulo", $where_modules);
|
||||
|
||||
// Delete remote configuration
|
||||
if (isset ($config["remote_config"])) {
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
if (enterprise_hook('config_agents_has_remote_configuration', $id_agent)) {
|
||||
$agent_name = agents_get_name($id_agent);
|
||||
$agent_name = io_safe_output($agent_name);
|
||||
$agent_md5 = md5 ($agent_name, false);
|
||||
if (enterprise_installed()) {
|
||||
if (isset ($config["remote_config"])) {
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
if (enterprise_hook('config_agents_has_remote_configuration', $id_agent)) {
|
||||
$agent_name = agents_get_name($id_agent);
|
||||
$agent_name = io_safe_output($agent_name);
|
||||
$agent_md5 = md5 ($agent_name, false);
|
||||
|
||||
// Agent remote configuration editor
|
||||
$file_name = $config["remote_config"]."/conf/".$agent_md5.".conf";
|
||||
// Agent remote configuration editor
|
||||
$file_name = $config["remote_config"]."/conf/".$agent_md5.".conf";
|
||||
|
||||
$error = !@unlink ($file_name);
|
||||
|
||||
if (!$error) {
|
||||
$file_name = $config["remote_config"]."/md5/".$agent_md5.".md5";
|
||||
$error = !@unlink ($file_name);
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
db_pandora_audit( "Agent management",
|
||||
"Error: Deleted agent '$agent_name', the error is in the delete conf or md5.");
|
||||
if (!$error) {
|
||||
$file_name = $config["remote_config"]."/md5/".$agent_md5.".md5";
|
||||
$error = !@unlink ($file_name);
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
db_pandora_audit( "Agent management",
|
||||
"Error: Deleted agent '$agent_name', the error is in the delete conf or md5.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue