Skip to content

Commit

Permalink
Merge pull request #3250 from laf/issue-3236
Browse files Browse the repository at this point in the history
Split out the icon check and update from os
  • Loading branch information
murrant committed Mar 16, 2016
2 parents 57339c4 + 772c917 commit 271e767
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions includes/discovery/os.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

echo 'OS: ';

// MYSQL Check - FIXME
// 1 UPDATE
$os = getHostOS($device);
if ($os != $device['os'] || empty($device['icon'])) {
$os = getHostOS($device);
$icon = getImageName(array('icon' => $os), false);
if ($os != $device['os']) {
$device['os'] = $os;
$sql = dbUpdate(array('os' => $os), 'devices', 'device_id=?', array($device['device_id']));
echo "Changed OS! : $os\n";
log_event('Device OS changed '.$device['os']." => $os", $device, 'system');
}

// update icon
if ($icon != $device['icon']) {
$icon = getImageName($device, false);
$device['icon'] = $icon;


$sql = dbUpdate(array('os' => $os, 'icon' => $icon), 'devices', 'device_id=?', array($device['device_id']));
echo "Changed OS! : $os\n";
log_event('Device OS changed '.$device['os']." => $os", $device, 'system');
$sql = dbUpdate(array('icon' => $icon), 'devices', 'device_id=?', array($device['device_id']));
echo "Changed Icon! : $icon\n";
log_event('Device Icon changed '.$device['icon']." => $icon", $device, 'system');
}

0 comments on commit 271e767

Please sign in to comment.