summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/locationinfohooks.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/locationinfo/inc/locationinfohooks.inc.php')
-rw-r--r--modules-available/locationinfo/inc/locationinfohooks.inc.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/modules-available/locationinfo/inc/locationinfohooks.inc.php b/modules-available/locationinfo/inc/locationinfohooks.inc.php
index b0596c10..8e4975e9 100644
--- a/modules-available/locationinfo/inc/locationinfohooks.inc.php
+++ b/modules-available/locationinfo/inc/locationinfohooks.inc.php
@@ -36,8 +36,16 @@ class LocationInfoHooks
ConfigHolder::add('SLX_BROWSER_RELOAD_SECS', $data['reload-minutes'] * 60);
}
ConfigHolder::add('SLX_BROWSER_URL', $data['url']);
- ConfigHolder::add('SLX_BROWSER_URLLIST', $data['urllist']);
- ConfigHolder::add('SLX_BROWSER_IS_WHITELIST', $data['iswhitelist']);
+ // Mangle non-upgraded panels
+ if (empty($data['blacklist']) && $data['whitelist'] === '*' && !empty($data['urllist'])) {
+ if ($data['iswhitelist']) {
+ $data['whitelist'] = str_replace(' ', "\n", $data['urllist']);
+ } else {
+ $data['blacklist'] = str_replace(' ', "\n", $data['urllist']);
+ }
+ }
+ ConfigHolder::add('SLX_BROWSER_WHITELIST', self::mangleList($data['whitelist']));
+ ConfigHolder::add('SLX_BROWSER_BLACKLIST', self::mangleList($data['blacklist']));
// 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);
@@ -76,4 +84,15 @@ class LocationInfoHooks
ConfigHolder::add('SLX_SYSTEM_STANDBY_TIMEOUT', '', 1000);
}
+ /**
+ * Turn multiline list into space separated list, removing any
+ * comments (starting with #)
+ * @param string $list
+ * @return string
+ */
+ private static function mangleList($list)
+ {
+ return preg_replace('/\s*(#[^\n]*)?(\n|$)/', ' ', $list);
+ }
+
} \ No newline at end of file