id_agent control for pandora_revent

This commit is contained in:
José González 2021-05-18 14:52:23 +02:00
parent 5cdc0b8a14
commit 46e0cbca70
1 changed files with 3 additions and 1 deletions

View File

@ -12905,8 +12905,10 @@ function api_set_create_event($id, $trash1, $other, $returnType)
$error_msg = '';
if ($other['data'][2] != '') {
// Id agent assignment.
$id_agent = $other['data'][2];
if (is_metaconsole()) {
// To the next if is metaconsole and id_agent is not none.
if (is_metaconsole() === true && $id_agent > 0) {
// On metaconsole, connect with the node to check the permissions
if (empty($values['server_id'])) {
$agent_cache = db_get_row('tmetaconsole_agent', 'id_tagente', $id_agent);