Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix(mqtthandler): handling inventory
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry authored and DIOHz0r committed Apr 25, 2018
1 parent 8a52663 commit 4ab9696
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions inc/mqtthandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,9 @@ protected function publishFlyveManifest(\sskaje\mqtt\MQTT $mqtt, $message) {
protected function updateInventory($topic, $message) {
global $DB;

$mqttPath = explode('/', $topic);
$entityId = $mqttPath[1];
$serial = $DB->escape($mqttPath[3]);
$computer = new Computer();
$request = [
'AND' => [
Entity::getForeignKeyField() => $entityId,
'serial' => $serial,
]
];
if ($computer->getFromDBByCrit($request)) {
$agent = new PluginFlyvemdmAgent();
$agent->getByTopic($topic);
if ($agent->getComputer()) {
$_SESSION["MESSAGE_AFTER_REDIRECT"] = [];
$inventoryXML = $message;
$communication = new \PluginFusioninventoryCommunication();
Expand Down

0 comments on commit 4ab9696

Please sign in to comment.