summaryrefslogtreecommitdiffstats
path: root/modules-available/locations/baseconfig
diff options
context:
space:
mode:
authorSimon Rettberg2016-06-14 11:22:53 +0200
committerSimon Rettberg2016-06-14 11:22:53 +0200
commitc8cd280d522a2522c541467b1b84c4a8666b5b38 (patch)
treeb7c8c2475e27dad0859ecf1608164067cc119cba /modules-available/locations/baseconfig
parent[dashboard] Add submenu feature (diff)
downloadslx-admin-c8cd280d522a2522c541467b1b84c4a8666b5b38.tar.gz
slx-admin-c8cd280d522a2522c541467b1b84c4a8666b5b38.tar.xz
slx-admin-c8cd280d522a2522c541467b1b84c4a8666b5b38.zip
[baseconfig] Reimplement toggle/enabled switch from UFPR, sort properly, make download button honor current module/location
Diffstat (limited to 'modules-available/locations/baseconfig')
-rw-r--r--modules-available/locations/baseconfig/getconfig.inc.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules-available/locations/baseconfig/getconfig.inc.php b/modules-available/locations/baseconfig/getconfig.inc.php
index d4a4f40b..2cf5495d 100644
--- a/modules-available/locations/baseconfig/getconfig.inc.php
+++ b/modules-available/locations/baseconfig/getconfig.inc.php
@@ -1,7 +1,14 @@
<?php
// Location handling: figure out location
-$locationId = false; // TODO: machine specific mapping
+$locationId = false;
+if (Request::any('force', 0, 'int') === 1 && Request::any('module', false, 'string') === 'locations') {
+ // Force location for testing, but require logged in admin
+ if (User::load()) {
+ $locationId = Request::any('value', 0, 'int');
+ }
+}
+// TODO: machine specific mapping
if ($locationId === false) {
// Fallback to subnets
$locationId = Location::getFromIp($ip);