Updated most files to use dbFacile

This commit is contained in:
laf
2014-01-13 17:43:58 +00:00
parent a0650f0547
commit 02792176fa
45 changed files with 334 additions and 346 deletions

View File

@@ -1,6 +1,6 @@
<?php
$interface = mysql_fetch_assoc(mysql_query("SELECT * FROM `ports` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '".$entry[2]."'"));
$interface = dbFetchRow("SELECT * FROM `ports` WHERE `device_id` = ? AND `ifIndex` = ?",array($device['device_id'],$entry[2]));
if (!$interface) { exit; }
@@ -12,14 +12,13 @@ log_event("SNMP Trap: linkUp $ifAdminStatus/$ifOperStatus " . $interface['ifDesc
if ($ifAdminStatus != $interface['ifAdminStatus'])
{
log_event("Interface Enabled : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['port_id']);
mysql_query("UPDATE `ports` SET ifAdminStatus = 'up' WHERE `port_id` = '".$interface['port_id']."'");
dbUpdate(array('`ifAdminStatus`' => 'up'), 'ports', 'port_id=?',array($interface['port_id']));
}
if ($ifOperStatus != $interface['ifOperStatus'])
{
log_event("Interface went Up : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['port_id']);
mysql_query("UPDATE `ports` SET ifOperStatus = 'up' WHERE `port_id` = '".$interface['port_id']."'");
dbUpdate(array('`ifOperStatus`' => 'up'), 'ports', 'port_id=?',array($interface['port_id']));
}
?>
?>