summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-11-12 16:07:37 +0100
committerSimon Rettberg2019-11-12 16:07:37 +0100
commit3815a3d4e4105364ba2bb5f040e852d41950deaf (patch)
treec6ecc7113d667e80d2dd8493ff96184fe757ef39
parent[baseconfig] bash escape: Replace \r and \n by space (diff)
downloadslx-admin-3815a3d4e4105364ba2bb5f040e852d41950deaf.tar.gz
slx-admin-3815a3d4e4105364ba2bb5f040e852d41950deaf.tar.xz
slx-admin-3815a3d4e4105364ba2bb5f040e852d41950deaf.zip
[locationinfo/runmode] Support new infoscreen variables
Interactive mode, autologin, browser type, bookmarks
-rw-r--r--modules-available/locationinfo/inc/locationinfohooks.inc.php23
-rw-r--r--modules-available/runmode/inc/runmode.inc.php12
2 files changed, 34 insertions, 1 deletions
diff --git a/modules-available/locationinfo/inc/locationinfohooks.inc.php b/modules-available/locationinfo/inc/locationinfohooks.inc.php
index 09489015..b10be51b 100644
--- a/modules-available/locationinfo/inc/locationinfohooks.inc.php
+++ b/modules-available/locationinfo/inc/locationinfohooks.inc.php
@@ -38,16 +38,37 @@ class LocationInfoHooks
ConfigHolder::add('SLX_BROWSER_URL', $data['url']);
ConfigHolder::add('SLX_BROWSER_URLLIST', $data['urllist']);
ConfigHolder::add('SLX_BROWSER_IS_WHITELIST', $data['iswhitelist']);
+ // Additionally, update runmode "isclient" flag depending on whether split-login is allowed or not
+ if (isset($data['split-login']) && $data['split-login']) {
+ RunMode::updateClientFlag($machineUuid, 'locationinfo', true);
+ } else { // Automatic login
+ RunMode::updateClientFlag($machineUuid, 'locationinfo', false);
+ ConfigHolder::add('SLX_AUTOLOGIN', '1', 1000);
+ }
+ if (isset($data['interactive']) && $data['interactive']) {
+ ConfigHolder::add('SLX_BROWSER_INTERACTIVE', '1', 1000);
+ }
+ if (!empty($data['browser'])) {
+ if ($data['browser'] === 'chromium') {
+ $browser = 'chromium chrome';
+ } else {
+ $browser = 'slxbrowser slx-browser';
+ }
+ ConfigHolder::add('SLX_BROWSER', $browser, 1000);
+ }
+ if (!empty($data['bookmarks'])) {
+ ConfigHolder::add('SLX_BROWSER_BOOKMARKS', $data['bookmarks'], 1000);
+ }
} else {
// Not URL panel
ConfigHolder::add('SLX_BROWSER_URL', 'http://' . $_SERVER['SERVER_ADDR'] . '/panel/' . $panelUuid);
ConfigHolder::add('SLX_BROWSER_INSECURE', '1'); // TODO: Sat server might redirect to HTTPS, which in turn could have a self-signed cert - push to client
+ ConfigHolder::add('SLX_AUTOLOGIN', '1', 1000);
}
ConfigHolder::add('SLX_ADDONS', '', 1000);
ConfigHolder::add('SLX_LOGOUT_TIMEOUT', '', 1000);
ConfigHolder::add('SLX_SCREEN_STANDBY_TIMEOUT', '', 1000);
ConfigHolder::add('SLX_SYSTEM_STANDBY_TIMEOUT', '', 1000);
- ConfigHolder::add('SLX_AUTOLOGIN', '1', 1000);
}
} \ No newline at end of file
diff --git a/modules-available/runmode/inc/runmode.inc.php b/modules-available/runmode/inc/runmode.inc.php
index 96f532d7..4d077f02 100644
--- a/modules-available/runmode/inc/runmode.inc.php
+++ b/modules-available/runmode/inc/runmode.inc.php
@@ -69,6 +69,18 @@ class RunMode
}
/**
+ * Change the isClient flag for existing client.
+ * @param string $machineUuid existing machine with some runmode
+ * @param string $moduleId module that assigned the current runmode of that client
+ * @param bool $isClient
+ */
+ public static function updateClientFlag($machineUuid, $moduleId, $isClient)
+ {
+ Database::exec('UPDATE runmode SET isclient = :isclient WHERE machineuuid = :uuid AND module = :module',
+ ['uuid' => $machineUuid, 'module' => $moduleId, 'isclient' => ($isClient ? 1 : 0)]);
+ }
+
+ /**
* @param string $machineuuid
* @param int $returnData bitfield of data to return
* @return false|array {'machineuuid', 'isclient', 'module', 'modeid', 'modedata',