summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/api.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/statistics/api.inc.php')
-rw-r--r--modules-available/statistics/api.inc.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules-available/statistics/api.inc.php b/modules-available/statistics/api.inc.php
index 0a194f2e..52dbe284 100644
--- a/modules-available/statistics/api.inc.php
+++ b/modules-available/statistics/api.inc.php
@@ -1,15 +1,19 @@
<?php
if (Request::any('action') === 'test' && isLocalExecution()) {
+ /*
+ error_log(HardwareInfo::getKclModifications());
+ exit;
$x = new HardwareQuery(HardwareInfo::PCI_DEVICE);
//$x->addCompare(false, 'Memory Slot Occupied', '>=', true, 'Memory Slot Count');
$x->addWhere(true, 'vendor', '=', '8086');
- $x->addColumn(true, 'device');
+ $x->addGlobalColumn('device');
$res = $x->query();
foreach ($res as $row) {
error_log(json_encode($row));
}
exit;
+ */
HardwareParser::parseMachine('0A5D9E23-80F4-9C43-912C-96D80AE7E80B',
file_get_contents('/tmp/bla.json'));
echo 'Kweries: ' . Database::getQueryCount();
@@ -79,7 +83,7 @@ if ($type[0] === '~') {
$hostname = '';
}
$data = Util::cleanUtf8(Request::post('json', '', 'string'));
- $hasJson = !empty($data);
+ $hasJson = !empty($data) && $data[0] === '{';
if (!$hasJson) {
$data = Util::cleanUtf8(Request::post('data', '', 'string'));
}
@@ -340,7 +344,6 @@ if ($type[0] === '~') {
'hwid' => $hwid,
'machineuuid' => $uuid,
'devpath' => $port,
- 'serial' => '',
), array('disconnecttime' => 0));
$validProps = array();
if (count($screen) > 1) {
@@ -383,7 +386,7 @@ if ($type[0] === '~') {
// Some screens connected, make sure old entries get removed
Database::exec("UPDATE machine_x_hw x, statistic_hw h
SET x.disconnecttime = UNIX_TIMESTAMP()
- WHERE (x.hwid, x.devpath) NOT IN (:pairs) AND x.disconnecttime = 0 AND h.hwtype = :type
+ WHERE (x.hwid, x.devpath) NOT IN (:pairs) AND x.hwid = h.hwid AND x.disconnecttime = 0 AND h.hwtype = :type
AND x.machineuuid = :uuid", array(
'pairs' => $keepPair,
'uuid' => $uuid,