diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index aa4e1fbb0d..9201e50c18 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -66,6 +66,7 @@ if (is_ajax ()) { } if ($get_group_agents) { + ob_clean(); $id_group = (int) get_parameter ('id_group'); $disabled = (int) get_parameter ('disabled', 0); $search = (string) get_parameter ('search', ''); @@ -151,7 +152,34 @@ if (is_ajax ()) { $agents[$keys_prefix . $k] = $v; unset($agents[$k]); if ($all_agents) { - $agent_disabled = db_get_value_filter('disabled', 'tagente', array('id_agente' => $k)); + // Unserialize to get the status + if ($serialized && is_metaconsole()) { + $agent_info = explode($serialized_separator, $k); + $agent_disabled = db_get_value_filter( + 'disabled', + 'tmetaconsole_agent', + array( + 'id_tagente' => $agent_info[1], + 'id_tmetaconsole_setup' => $agent_info[0] + ) + ); + } elseif ($serialized && !is_metaconsole() && $force_serialized) { + $agent_info = explode($serialized_separator, $k); + $agent_disabled = db_get_value_filter( + 'disabled', + 'tagente', + array('id_agente' => $agent_info[1]) + ); + } elseif (!$serialized && is_metaconsole()) { + // Cannot retrieve the disabled status. Mark all as not disabled + $agent_disabled = 0; + } else { + $agent_disabled = db_get_value_filter( + 'disabled', + 'tagente', + array('id_agente' => $k) + ); + } $agents_disabled[$keys_prefix . $k] = $agent_disabled; } }