Remove external uses of GenGroupSQL()

This commit is contained in:
Tony Murray
2016-09-18 19:08:33 -05:00
parent b8d085202d
commit c48b71d0af
3 changed files with 7 additions and 17 deletions

View File

@@ -40,14 +40,10 @@ $devices = array();
$where = "";
if (is_numeric($vars['group'])) {
$group_pattern = dbFetchCell('SELECT `pattern` FROM `device_groups` WHERE id = '.$vars['group']);
$group_pattern = rtrim($group_pattern, '&&');
$group_pattern = rtrim($group_pattern, '||');
$device_id_sql = GenGroupSQL($group_pattern);
if ($device_id_sql) {
$where .= " AND D1.device_id IN ($device_id_sql) OR D2.device_id IN ($device_id_sql)";
}
$where .= " AND D1.device_id IN (SELECT `device_id` FROM `device_group_device` WHERE `device_group_id` = ?)";
$sql_array[] = $vars['group'];
$where .= " OR D2.device_id IN (SELECT `device_id` FROM `device_group_device` WHERE `device_group_id` = ?)";
$sql_array[] = $vars['group'];
}
if (in_array('mac', $config['network_map_items'])) {