Commit e09d6fc7 authored by Côme Chilliet's avatar Côme Chilliet Committed by Benoit Mortier
Browse files

Fixes #5655 PHP error in OPSI import when IP is empty

Showing with 5 additions and 3 deletions
+5 -3
...@@ -84,10 +84,12 @@ class systemImport extends simplePlugin ...@@ -84,10 +84,12 @@ class systemImport extends simplePlugin
$baseObject = $tabObject->getBaseObject(); $baseObject = $tabObject->getBaseObject();
$baseObject->cn = $cn; $baseObject->cn = $cn;
$baseObject->description = $host['description']; $baseObject->description = $host['description'];
if (!is_array($host['ipAddress'])) { if (!empty($host['ipAddress'])) {
$host['ipAddress'] = array($host['ipAddress']); if (!is_array($host['ipAddress'])) {
$host['ipAddress'] = array($host['ipAddress']);
}
$baseObject->ipHostNumber = $host['ipAddress'];
} }
$baseObject->ipHostNumber = $host['ipAddress'];
$baseObject->macAddress = $host['hardwareAddress']; $baseObject->macAddress = $host['hardwareAddress'];
/* Get existing DHCP servers */ /* Get existing DHCP servers */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment