summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules-available/locations/inc/openingtimes.inc.php8
-rw-r--r--modules-available/remoteaccess/baseconfig/getconfig.inc.php48
-rw-r--r--modules-available/statistics/inc/hardwarequery.inc.php6
3 files changed, 35 insertions, 27 deletions
diff --git a/modules-available/locations/inc/openingtimes.inc.php b/modules-available/locations/inc/openingtimes.inc.php
index 3417a213..72ce92f4 100644
--- a/modules-available/locations/inc/openingtimes.inc.php
+++ b/modules-available/locations/inc/openingtimes.inc.php
@@ -5,6 +5,12 @@ class OpeningTimes
/**
* Get opening times for given location.
+ * Format is the decoded JSON from DB column, i.e. currently a list of entries:
+ * {
+ * "days": ["Monday", "Tuesday", ...],
+ * "openingtime": "8:00",
+ * "closingtime": "20:00"
+ * }
*/
public static function forLocation(int $locationId)
{
@@ -14,7 +20,6 @@ class OpeningTimes
WHERE openingtime IS NOT NULL");
}
$chain = Location::getLocationRootChain($locationId);
- $openingTimes = null;
foreach ($chain as $lid) {
if (isset($openingTimesList[$lid])) {
if (is_string($openingTimesList[$lid])) {
@@ -25,4 +30,5 @@ class OpeningTimes
}
return null;
}
+
} \ No newline at end of file
diff --git a/modules-available/remoteaccess/baseconfig/getconfig.inc.php b/modules-available/remoteaccess/baseconfig/getconfig.inc.php
index 23e623d0..3d0c4470 100644
--- a/modules-available/remoteaccess/baseconfig/getconfig.inc.php
+++ b/modules-available/remoteaccess/baseconfig/getconfig.inc.php
@@ -3,34 +3,34 @@
(function ($machineUuid) {
// Leave clients in any runmode alone
$res = Database::queryFirst('SELECT machineuuid FROM runmode WHERE machineuuid = :uuid',
- array('uuid' => $machineUuid), true);
+ ['uuid' => $machineUuid], true);
if (is_array($res))
return;
// Locations from closest to furthest (order)
$locationId = ConfigHolder::get('SLX_LOCATIONS');
- if ($locationId !== false) {
- $locationId = (int)$locationId;
- $ret = Database::queryFirst("SELECT l.locationid FROM remoteaccess_x_location l
- INNER JOIN remoteaccess_group g USING (groupid)
- WHERE locationid = :lid AND g.active = 1",
- ['lid' => $locationId], true); // TODO Remove true after next point release (2020-05-12)
- if ($ret !== false) {
- // TODO Properly merge
- if (Property::get(RemoteAccess::PROP_TRY_VIRT_HANDOVER)) {
- ConfigHolder::add("SLX_REMOTE_VNC", 'vmware virtualbox');
- } else {
- ConfigHolder::add("SLX_REMOTE_VNC", 'x11vnc');
- }
- ConfigHolder::add("SLX_REMOTE_HOST_ACCESS", Property::get(RemoteAccess::PROP_ALLOWED_VNC_NET));
- ConfigHolder::add('SLX_REMOTE_VNC_PORT', Property::get(RemoteAccess::PROP_VNC_PORT, 5900));
- ConfigHolder::add('SLX_RUNMODE_MODULE', 'remoteaccess');
- // No saver
- $saverTimeout = ConfigHolder::get('SLX_SCREEN_SAVER_TIMEOUT');
- if (!is_numeric($saverTimeout) || $saverTimeout < 1800) {
- ConfigHolder::add('SLX_SCREEN_SAVER_TIMEOUT', '1800', 1000);
- }
- ConfigHolder::add('SLX_SCREEN_SAVER_GRACE_TIME', '86400', 1000);
- }
+ if ($locationId === false)
+ return;
+ $locationId = (int)$locationId;
+ $ret = Database::queryFirst("SELECT l.locationid FROM remoteaccess_x_location l
+ INNER JOIN remoteaccess_group g USING (groupid)
+ WHERE locationid = :lid AND g.active = 1",
+ ['lid' => $locationId], true); // TODO Remove true after next point release (2020-05-12)
+ if ($ret === false)
+ return;
+ // TODO Properly merge
+ if (Property::get(RemoteAccess::PROP_TRY_VIRT_HANDOVER)) {
+ ConfigHolder::add("SLX_REMOTE_VNC", 'vmware virtualbox');
+ } else {
+ ConfigHolder::add("SLX_REMOTE_VNC", 'x11vnc');
+ }
+ ConfigHolder::add("SLX_REMOTE_HOST_ACCESS", Property::get(RemoteAccess::PROP_ALLOWED_VNC_NET));
+ ConfigHolder::add('SLX_REMOTE_VNC_PORT', Property::get(RemoteAccess::PROP_VNC_PORT, 5900));
+ ConfigHolder::add('SLX_RUNMODE_MODULE', 'remoteaccess');
+ // No saver
+ $saverTimeout = ConfigHolder::get('SLX_SCREEN_SAVER_TIMEOUT');
+ if (!is_numeric($saverTimeout) || $saverTimeout < 1800) {
+ ConfigHolder::add('SLX_SCREEN_SAVER_TIMEOUT', '1800', 1000);
}
+ ConfigHolder::add('SLX_SCREEN_SAVER_GRACE_TIME', '86400', 1000);
})($uuid);
diff --git a/modules-available/statistics/inc/hardwarequery.inc.php b/modules-available/statistics/inc/hardwarequery.inc.php
index 14d827aa..71530173 100644
--- a/modules-available/statistics/inc/hardwarequery.inc.php
+++ b/modules-available/statistics/inc/hardwarequery.inc.php
@@ -158,11 +158,13 @@ class HardwareQuery
} else {
$groupBy = '';
}
- return 'SELECT ' . implode(', ', $columns)
+ $query = 'SELECT ' . implode(', ', $columns)
. ' FROM statistic_hw shw '
. implode(' ', $this->joins)
. ' WHERE ' . implode(' AND ', $this->where)
. $groupBy;
+ //error_log($query);
+ return $query;
}
-} \ No newline at end of file
+}