Make sure port_assoc_mode is an int before inserting a device into the db.

fixes #3090
This commit is contained in:
Tony Murray
2016-02-26 08:04:38 -06:00
parent 7f21325e9f
commit f8f895e5b1

View File

@@ -582,6 +582,11 @@ function createHost($host, $community = NULL, $snmpver, $port = 161, $transport
$poller_group=getpollergroup($poller_group);
/* Get port_assoc_mode id if neccessary
* We can work with names of IDs here */
if (! is_int ($port_assoc_mode))
$port_assoc_mode = get_port_assoc_mode_id ($port_assoc_mode);
$device = array('hostname' => $host,
'sysName' => $host,
'community' => $community,