fix: Various variables will all be updated if they are blank #5811 (#5836)

This commit is contained in:
Neil Lathwood
2017-02-10 20:42:46 +00:00
committed by Tony Murray
parent e2675d62bb
commit 2e235b27c6
2 changed files with 5 additions and 5 deletions

View File

@@ -91,7 +91,7 @@ foreach (array('sysLocation', 'sysContact') as $elem) {
// Save results of various polled values to the database
foreach (array('sysContact', 'sysObjectID', 'sysName', 'sysDescr') as $elem) {
if ($poll_device[$elem] && $poll_device[$elem] != $device[$elem]) {
if ($poll_device[$elem] != $device[$elem]) {
$update_array[$elem] = $poll_device[$elem];
log_event("$elem -> " . $poll_device[$elem], $device, 'system');
}

View File

@@ -10,7 +10,7 @@ if (is_file($config['install_dir'].'/includes/polling/os/'.$device['os'].'.inc.p
echo "Generic :(\n";
}
if ($version && $device['version'] != $version) {
if ($device['version'] != $version) {
$update_array['version'] = $version;
log_event('OS Version -> '.$version, $device, 'system');
}
@@ -20,17 +20,17 @@ if ($features != $device['features']) {
log_event('OS Features -> '.$features, $device, 'system');
}
if ($hardware && $hardware != $device['hardware']) {
if ($hardware != $device['hardware']) {
$update_array['hardware'] = $hardware;
log_event('Hardware -> '.$hardware, $device, 'system');
}
if ($serial && $serial != $device['serial']) {
if ($serial != $device['serial']) {
$update_array['serial'] = $serial;
log_event('Serial -> '.$serial, $device, 'system');
}
if ($icon && $icon != $device['icon']) {
if ($icon != $device['icon']) {
$update_array['icon'] = $icon;
log_event('Icon -> '.$icon, $device, 'system');
}