Skip to content

Commit

Permalink
Merge pull request #1604 from alacn1/multiple_fixes
Browse files Browse the repository at this point in the history
Multiple fixes
  • Loading branch information
charleneauger committed Jul 2, 2024
2 parents 1eec819 + 9f803bd commit b376535
Show file tree
Hide file tree
Showing 10 changed files with 35,366 additions and 50,726 deletions.
7 changes: 5 additions & 2 deletions backend/ipdiscover/methode/local.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
$req = "SELECT DISTINCT n.netid as ipsubnet, s.name, s.id, CONCAT(n.netid, ';', ifnull(s.tag, '')) as pass FROM netmap n
LEFT JOIN subnet s ON s.netid = n.netid";
if (isset($_SESSION['OCS']["mesmachines"]) && $_SESSION['OCS']["mesmachines"] != '' && $_SESSION['OCS']["mesmachines"] != 'NOTAG') {
$req .= ", accountinfo a WHERE " . $_SESSION['OCS']["mesmachines"] . " ORDER BY n.netid";
$req .= " LEFT JOIN networks w ON w.macaddr = n.mac";
$req .= " LEFT JOIN accountinfo a ON w.hardware_id = a.hardware_id";
$req .= " WHERE " . $_SESSION['OCS']["mesmachines"] . " ORDER BY n.netid";
} else {
$req .= " UNION SELECT netid, name, id, CONCAT(netid,';',ifnull(tag,'')) FROM subnet";
}
Expand All @@ -50,7 +52,8 @@
FROM netmap n LEFT JOIN subnet s ON s.netid = n.netid";

if (isset($_SESSION['OCS']["mesmachines"]) && $_SESSION['OCS']["mesmachines"] != '' && $_SESSION['OCS']["mesmachines"] != 'NOTAG') {
$req .= ", accountinfo a ";
$req .= " LEFT JOIN networks w ON w.macaddr = n.mac";
$req .= " LEFT JOIN accountinfo a ON w.hardware_id = a.hardware_id";
}

$req .= " WHERE (s.TAG IS NULL OR s.TAG = '')";
Expand Down
Loading

0 comments on commit b376535

Please sign in to comment.