diff options
author | Simon Rettberg | 2020-11-04 11:18:15 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-11-04 11:18:15 +0100 |
commit | 73fb00658bef1a8ee7793d599e672df7bbb043ee (patch) | |
tree | 3861aae2bc9eb7df8c02084cdccf034678ee0a87 /modules-available/locationinfo/page.inc.php | |
parent | [serversetup-bwlp-ipxe] Re-interoduce direct boot for one-item menus (diff) | |
download | slx-admin-73fb00658bef1a8ee7793d599e672df7bbb043ee.tar.gz slx-admin-73fb00658bef1a8ee7793d599e672df7bbb043ee.tar.xz slx-admin-73fb00658bef1a8ee7793d599e672df7bbb043ee.zip |
[locationinfo] Fix: api.php access in redirect mode not working
Also get rid of slx-admin prefix / {{dirprefix}}. We now have only one
variable to be filled in the template, namely {{api}}, which should also
make sure that accessing other module's API is not possible.
Matching rewrite rules should land in setup-scripts soon.
Diffstat (limited to 'modules-available/locationinfo/page.inc.php')
-rw-r--r-- | modules-available/locationinfo/page.inc.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php index df5b3632..e350d407 100644 --- a/modules-available/locationinfo/page.inc.php +++ b/modules-available/locationinfo/page.inc.php @@ -1047,7 +1047,11 @@ class Page_LocationInfo extends Page preg_match('#^/(.*)/#', $_SERVER['PHP_SELF'], $script); preg_match('#^/([^?]+)/#', $_SERVER['REQUEST_URI'], $request); if ($script[1] !== $request[1]) { - $data['dirprefix'] = $script[1] . '/'; + // Working with server-side redirects + $data['api'] = 'api/'; + } else { + // 1:1 + $data['api'] = 'api.php?do=locationinfo&'; } if ($type === 'DEFAULT') { |