2014-06-16 Alejandro Gallardo <alejandro.gallardo@artica.es>

* godmode/massive/massive_copy_modules.php: Error fixes.
	
	* include/functions_agents.php: Fixed some returns on the
	function "agents_process_manage_config".


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10203 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
alexhigh 2014-06-16 17:22:56 +00:00
parent 2c96e69b40
commit c5ce28963b
3 changed files with 32 additions and 15 deletions

View File

@ -1,3 +1,10 @@
2014-06-16 Alejandro Gallardo <alejandro.gallardo@artica.es>
* godmode/massive/massive_copy_modules.php: Error fixes.
* include/functions_agents.php: Fixed some returns on the
function "agents_process_manage_config".
2014-06-16 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_networkmap.php: fixed into the function

View File

@ -109,6 +109,16 @@ $modules = array ();
if ($source_id_agent)
$modules = agents_get_modules ($source_id_agent, 'nombre');
$agent_alerts = array ();
if ($source_id_agent)
$agent_alerts = agents_get_alerts_simple ($source_id_agent);
$alerts = array ();
foreach ($agent_alerts as $alert) {
$name = alerts_get_alert_template_name ($alert['id_alert_template']);
$name .= ' (<em>'.$modules[$alert['id_agent_module']].'</em>)';
$alerts[$alert['id']] = $name;
}
$table->data['operations'][0] = __('Operations');
$table->data['operations'][1] = '<span class="with_modules'.(empty ($modules) ? ' invisible': '').'">';
$table->data['operations'][1] .= html_print_checkbox ('copy_modules', 1, true, true);
@ -130,16 +140,6 @@ $table->data[1][1] .= '<em>'.__('No modules for this agent').'</em>';
$table->data[1][1] .= '</span>';
$table->data[2][0] = __('Alerts');
$agent_alerts = array ();
if ($source_id_agent)
$agent_alerts = agents_get_alerts_simple ($source_id_agent);
$alerts = array ();
foreach ($agent_alerts as $alert) {
$name = alerts_get_alert_template_name ($alert['id_alert_template']);
$name .= ' (<em>'.$modules[$alert['id_agent_module']].'</em>)';
$alerts[$alert['id']] = $name;
}
$table->data[2][1] = '<span class="with_alerts'.(empty ($alerts) ? ' invisible': '').'">';
$table->data[2][1] .= html_print_select ($alerts,
'target_alerts[]', 0, false, '', '', true, true);
@ -159,7 +159,6 @@ html_print_table ($table);
echo '</fieldset>';
/* Destiny selection */
$table->id = 'destiny_table';
$table->data = array ();
@ -187,9 +186,15 @@ $table->data[2][0] = __('Agent');
$table->data[2][0] .= '<span id="destiny_agent_loading" class="invisible">';
$table->data[2][0] .= html_print_image ("images/spinner.png", true);
$table->data[2][0] .= '</span>';
$agents = ( $destiny_id_group ?
agents_get_group_agents ($destiny_id_group, false, "none") :
agents_get_group_agents (array_keys (users_get_groups ($config["id_user"], "AW", false))) );
$agents = array();
if ($source_id_agent) {
$agents = ( $destiny_id_group ?
agents_get_group_agents ($destiny_id_group, false, "none") :
agents_get_group_agents (array_keys (users_get_groups ($config["id_user"], "AW", false))) );
unset($agents[$source_id_agent]);
}
$table->data[2][1] = html_print_select ($agents, 'destiny_id_agent[]', 0, false, '', '', true, true);
echo '<fieldset id="fieldset_destiny"' .

View File

@ -480,7 +480,7 @@ function agents_process_manage_config ($source_id_agent, $destiny_id_agents, $co
}
if (! $copy_modules && ! $copy_alerts)
return;
return false;
if (empty ($target_modules)) {
$target_modules = (array) get_parameter ('target_modules', array ());
@ -628,6 +628,11 @@ function agents_process_manage_config ($source_id_agent, $destiny_id_agents, $co
db_process_sql ('SET AUTOCOMMIT = 1');
break;
}
if ($error)
return false;
else
return true;
}
function agents_get_next_contact($idAgent, $maxModules = false) {