mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
Added update standby token in massive operations
This commit is contained in:
parent
9cf578e1f6
commit
823b32ac63
@ -30,6 +30,7 @@ require_once ('include/functions_modules.php');
|
|||||||
require_once ('include/functions_servers.php');
|
require_once ('include/functions_servers.php');
|
||||||
require_once ('include/functions_gis.php');
|
require_once ('include/functions_gis.php');
|
||||||
require_once ('include/functions_users.php');
|
require_once ('include/functions_users.php');
|
||||||
|
enterprise_include_once('include/functions_config_agents.php');
|
||||||
|
|
||||||
if (is_ajax ()) {
|
if (is_ajax ()) {
|
||||||
$get_n_conf_files = (bool) get_parameter ('get_n_conf_files');
|
$get_n_conf_files = (bool) get_parameter ('get_n_conf_files');
|
||||||
@ -136,8 +137,11 @@ if ($update_agents) {
|
|||||||
foreach ($id_agents as $id_agent) {
|
foreach ($id_agents as $id_agent) {
|
||||||
if (!empty($values)) {
|
if (!empty($values)) {
|
||||||
$group_old = false;
|
$group_old = false;
|
||||||
if($values['id_grupo']){
|
$disabled_old = false;
|
||||||
$group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agent);
|
if($values['id_grupo'] || isset($values['disabled'])){
|
||||||
|
$values_old = db_get_row_filter('tagente', array('id_agente' => $id_agent), array('id_grupo', 'disabled'));
|
||||||
|
if ($values_old['id_grupo']) $group_old = $values_old['id_grupo'];
|
||||||
|
if (isset($values['disabled'])) $disabled_old = $values_old['disabled'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = db_process_sql_update ('tagente',
|
$result = db_process_sql_update ('tagente',
|
||||||
@ -150,6 +154,13 @@ if ($update_agents) {
|
|||||||
$result_metaconsole = agent_update_from_cache($id_agent,$values,$server_name);
|
$result_metaconsole = agent_update_from_cache($id_agent,$values,$server_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($disabled_old !== false && $disabled_old != $values['disabled']) {
|
||||||
|
enterprise_hook(
|
||||||
|
'config_agents_update_config_token',
|
||||||
|
array($id_agent, 'standby', $values['disabled'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if($group_old || $result){
|
if($group_old || $result){
|
||||||
if ($group_old && $group_old != null) {
|
if ($group_old && $group_old != null) {
|
||||||
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
$tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups
|
||||||
|
Loading…
x
Reference in New Issue
Block a user