Fix SQL statement for .port command in irc bot

This commit is contained in:
Mike Rostermund
2016-01-20 01:58:10 +01:00
parent 7a19fa2a67
commit 8f34e0e30e

View File

@ -640,7 +640,7 @@ class ircbot {
}
$device = dbFetchRow('SELECT * FROM `devices` WHERE `hostname` = ?', array($hostname));
$port = dbFetchRow('SELECT * FROM `ports` WHERE `ifName` = ? OR `ifDescr` = ? AND device_id = ?', array($ifname, $ifname, $device['device_id']));
$port = dbFetchRow('SELECT * FROM `ports` WHERE (`ifName` = ? OR `ifDescr` = ?) AND device_id = ?', array($ifname, $ifname, $device['device_id']));
if ($this->user['level'] < 5 && !in_array($port['port_id'], $this->user['ports']) && !in_array($device['device_id'], $this->user['devices'])) {
return $this->respond('Error: Permission denied.');
}