Search field parsing is slightly broken

Fix to allow searching based on Location and Device Type.  Without this fix, you can only search on one or the other, but not both.

See Issue 1098 for more info.
https://github.com/librenms/librenms/issues/1098
This commit is contained in:
Freddie Cash
2015-05-21 08:40:31 -07:00
parent 47dc6ec3a9
commit 620a97b2c9

View File

@@ -38,7 +38,8 @@ if (!empty($_POST['ignore'])) { $sql .= " AND `ignore`= ?"; $param[] = $
if (!empty($_POST['location']) && $_POST['location'] == "Unset") { $location_filter = ''; }
if (!empty($_POST['location'])) {
$sql .= " AND (((`DB`.`attrib_value`='1' AND `DA`.`attrib_type`='override_sysLocation_string' AND `DA`.`attrib_value` = ?)) OR `location` = ?)";
$param = array(mres($_POST['location']),mres($_POST['location']));
$param[] = mres($_POST['location']);
$param[] = mres($_POST['location']);
}
if( !empty($_POST['group']) ) {
require_once('../includes/device-groups.inc.php');