mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
pol group api create agent auto-assign fix
This commit is contained in:
parent
f1a3d40309
commit
83d8b5348f
@ -1535,10 +1535,6 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3)
|
|||||||
'disabled',
|
'disabled',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$tpolicy_group_old = db_get_all_rows_sql(
|
|
||||||
'SELECT id_policy FROM tpolicy_groups
|
|
||||||
WHERE id_group = '.$values_old['id_grupo']
|
|
||||||
);
|
|
||||||
|
|
||||||
$return = db_process_sql_update(
|
$return = db_process_sql_update(
|
||||||
'tagente',
|
'tagente',
|
||||||
@ -1955,23 +1951,6 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3)
|
|||||||
agents_add_address($id_agente, $direccion_agente);
|
agents_add_address($id_agente, $direccion_agente);
|
||||||
}
|
}
|
||||||
|
|
||||||
$tpolicy_group_old = db_get_all_rows_sql(
|
|
||||||
'SELECT id_policy FROM tpolicy_groups
|
|
||||||
WHERE id_group = '.$grupo
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($tpolicy_group_old) {
|
|
||||||
foreach ($tpolicy_group_old as $key => $old_group) {
|
|
||||||
db_process_sql_insert(
|
|
||||||
'tpolicy_agents',
|
|
||||||
[
|
|
||||||
'id_policy' => $old_group['id_policy'],
|
|
||||||
'id_agent' => $id_agente,
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$info = '{"Name":"'.$nombre_agente.'",
|
$info = '{"Name":"'.$nombre_agente.'",
|
||||||
"IP":"'.$direccion_agente.'",
|
"IP":"'.$direccion_agente.'",
|
||||||
"Group":"'.$grupo.'",
|
"Group":"'.$grupo.'",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user