fix: Changing device type now is persistant (#5529)

This commit is contained in:
Neil Lathwood
2017-01-22 09:49:13 +00:00
committed by GitHub
parent 53df1d0b2c
commit 32da1bceea
5 changed files with 18 additions and 4 deletions

View File

@@ -1533,7 +1533,7 @@ function load_os(&$device)
}
// Set type to a predefined type for the OS if it's not already set
if ($config['os'][$device['os']]['type'] != $device['type']) {
if ($device['attribs']['override_device_type'] != 1 && $config['os'][$device['os']]['type'] != $device['type']) {
log_event('Device type changed '.$device['type'].' => '.$config['os'][$device['os']]['type'], $device, 'system');
$device['type'] = $config['os'][$device['os']]['type'];
dbUpdate(array('type' => $device['type']), 'devices', 'device_id=?', array($device['device_id']));