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:
mdtrooper 2013-09-04 12:49:27 +00:00
parent 59054d4401
commit 1506127262
4 changed files with 38 additions and 25 deletions

View File

@ -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> 2013-09-04 Ramon Novoa <rnovoa@artica.es>
* include/functions_events.php, * include/functions_events.php,

View File

@ -85,6 +85,7 @@ if ($agent_to_delete) {
ui_print_result_message($result, __('Success deleted agent.'), __('Could not be deleted.')); ui_print_result_message($result, __('Success deleted agent.'), __('Could not be deleted.'));
if (enterprise_installed()) {
// Check if the remote config file still exist // Check if the remote config file still exist
if (isset ($config["remote_config"])) { if (isset ($config["remote_config"])) {
enterprise_include_once('include/functions_config_agents.php'); enterprise_include_once('include/functions_config_agents.php');
@ -92,6 +93,7 @@ if ($agent_to_delete) {
ui_print_error_message(__('Maybe the files conf or md5 could not be deleted')); ui_print_error_message(__('Maybe the files conf or md5 could not be deleted'));
} }
} }
}
} }
if ($enable_agent) { if ($enable_agent) {

View File

@ -52,7 +52,8 @@ if (is_ajax ()) {
} }
if ($get_module_local_components) { 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'); $id_module_group = (int) get_parameter ('id_module_component_group');
$localComponents = local_components_get_local_components( $localComponents = local_components_get_local_components(

View File

@ -1668,6 +1668,7 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
// db_process_delete_temp ("tagente_datos_inc", "id_agente_modulo", $where_modules); // db_process_delete_temp ("tagente_datos_inc", "id_agente_modulo", $where_modules);
// Delete remote configuration // Delete remote configuration
if (enterprise_installed()) {
if (isset ($config["remote_config"])) { if (isset ($config["remote_config"])) {
enterprise_include_once('include/functions_config_agents.php'); enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration', $id_agent)) { if (enterprise_hook('config_agents_has_remote_configuration', $id_agent)) {
@ -1691,6 +1692,7 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
} }
} }
} }
}
//And at long last, the agent //And at long last, the agent
db_process_delete_temp ("tagente", "id_agente", $id_agent); db_process_delete_temp ("tagente", "id_agente", $id_agent);