diff --git a/cacti/plugins/grid/grid_clients.php b/cacti/plugins/grid/grid_clients.php index 3f348a81..f1846d58 100644 --- a/cacti/plugins/grid/grid_clients.php +++ b/cacti/plugins/grid/grid_clients.php @@ -32,19 +32,20 @@ bottom_footer(); function grid_view_get_clients_records(&$sql_where, $apply_limits = true, $rows, &$sql_params) { - /* user id sql where */ - if (get_request_var('clusterid') == '0') { - /* Show all items */ - } else { - $sql_where = 'WHERE (grid_clusters.clusterid = ?)'; + if (get_request_var('clusterid') > '0') { + $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . 'grid_clusters.clusterid = ?'; $sql_params[] = get_request_var('clusterid'); } /* make sure we are looking at clients only */ - if ($sql_where != '') { - $sql_where .= " AND isServer='0'"; - } else { - $sql_where = "WHERE isServer='0'"; + $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . " isServer = 0"; + + if (get_request_var('type') > 0) { + if (get_request_var('type') == 1) { + $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . 'licFeaturesNeeded = 16'; + } else if (get_request_var('type') == 2) { + $sql_where .= ($sql_where != '' ? ' AND ':'WHERE ') . 'licFeaturesNeeded != 512'; + } } /* filter sql where */ @@ -92,6 +93,26 @@ function clientsFilter() {