2013-03-13 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_modules.php: fixed the massive deletion of
	modules when only delete one module, the old code deleted all
	modules in the agents on operation.
	
	* godmode/massive/massive_delete_modules.php: cleaned source code
	style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7845 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-03-13 12:59:29 +00:00
parent 1df7a559d4
commit 87c5be69d8
3 changed files with 43 additions and 31 deletions

View File

@ -1,3 +1,12 @@
2013-03-13 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_modules.php: fixed the massive deletion of
modules when only delete one module, the old code deleted all
modules in the agents on operation.
* godmode/massive/massive_delete_modules.php: cleaned source code
style.
2013-03-13 Kikuchi Koichiro <koichiro@rworks.jp>
* extensions/update_manager/lib/functions.ajax.php: Added proxy

View File

@ -72,7 +72,7 @@ function process_manage_delete ($module_name, $id_agents) {
// Selection mode by Agents
if ($selection_delete_mode == 'agents') {
// We are selecting "any" module for the selecteds agents
if (($module_name[0] == 0) and (is_array($module_name)) and (count($module_name) == 1))
if (($module_name[0] == "0") and (is_array($module_name)) and (count($module_name) == 1))
$filter_for_module_deletion = false;
else
$filter_for_module_deletion = sprintf('nombre IN ("%s")', implode('","', $module_name));
@ -117,7 +117,8 @@ $selection_mode = get_parameter('selection_mode', 'modules');
$recursion = get_parameter('recursion');
if ($delete) {
if ($selection_mode == 'modules') {
switch ($selection_mode) {
case 'modules':
$force = get_parameter('force_type', false);
if ($agents_select == false) {
@ -129,12 +130,13 @@ if ($delete) {
$agents_[] = agents_get_agent_id($agent_name);
}
$modules_ = $module_name;
}
else if($selection_mode == 'agents') {
break;
case 'agents':
$force = get_parameter('force_group', false);
$agents_ = $agents_id;
$modules_ = $modules_select;
break;
}
$count = 0;
@ -181,8 +183,9 @@ if ($delete) {
$agents_ = array();
}
if (!$force)
if (!$force) {
$result = process_manage_delete ($modules_, $agents_);
}
if ($result) {
db_pandora_audit("Massive management", "Delete module ", false, false,