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

Commit

Permalink
fix(log): datetime of log entries
Browse files Browse the repository at this point in the history
when n object is updated by an incoming mqtt message

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Nov 16, 2018
1 parent 3623120 commit 356da0b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inc/mqtthandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ public function publish(\sskaje\mqtt\MQTT $mqtt, \sskaje\mqtt\Message\PUBLISH $p

$mqttPath = explode('/', $topic, 4);
if (isset($mqttPath[3])) {

// Workaround the current time for Log object
$_SESSION["glpi_currenttime"] = date("Y-m-d H:i:s");

if ($mqttPath[3] == "Status/Ping") {
$this->updateLastContact($topic, $message);
} else if ($mqttPath[3] === "Status/Geolocation" && $message != "?") {
Expand Down

0 comments on commit 356da0b

Please sign in to comment.