From 223c959cd91359b04b72ec96cf706d59fe513717 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sat, 3 May 2025 12:10:17 +0200 Subject: [PATCH] access: Move /access to access.elwig.at --- README.md | 4 +- www/.php/credentials.sample.inc | 16 -- www/access.php | 100 ---------- www/index.php | 11 +- www/res/access-multiple.js | 190 ------------------ www/res/access-single.js | 330 -------------------------------- www/res/access.js | 80 -------- www/res/style.css | 271 ++++---------------------- www/robots.txt | 1 - 9 files changed, 53 insertions(+), 950 deletions(-) delete mode 100644 www/access.php delete mode 100644 www/res/access-multiple.js delete mode 100644 www/res/access-single.js delete mode 100644 www/res/access.js diff --git a/README.md b/README.md index 7c22631..1116535 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ -# Elwig REST API +# Elwig website + +https://elwig.at/ diff --git a/www/.php/credentials.sample.inc b/www/.php/credentials.sample.inc index 766de78..9246a39 100644 --- a/www/.php/credentials.sample.inc +++ b/www/.php/credentials.sample.inc @@ -2,8 +2,6 @@ global $GITEA_TOKEN; global $CREDENTIALS; global $CLIENT_CREDENTIALS; -global $CLIENT_ACCESS; -global $COMBINED_ACCESS; $GITEA_TOKEN = 'token'; @@ -16,17 +14,3 @@ $CLIENT_CREDENTIALS = [ 'username' => 'password', ], ]; - -$CLIENT_ACCESS = [ - 'WGX' => [ - 'name' => 'Winzergenossenschaft', - 'api' => 'https://example.com/elwig/api/v1', - ], -]; - -$COMBINED_ACCESS = [ - 'HOLDING' => [ - 'name' => 'Name', - 'clients' => ['WGX'], - ], -]; diff --git a/www/access.php b/www/access.php deleted file mode 100644 index 760c40e..0000000 --- a/www/access.php +++ /dev/null @@ -1,100 +0,0 @@ - $data) { - if ($name === $info[1] && (sizeof($info) === 2 || $info[2] === '')) { - $client = $data; - $client['id'] = $name; - } -} -foreach ($COMBINED_ACCESS as $name => $data) { - if ($name === $info[1] && (sizeof($info) === 2 || $info[2] === '')) { - $client = $data; - $client['id'] = $name; - } -} -if ($client === null) { - header('Status: 404'); - header('Content-Length: 0'); - exit(); -} else if ($_SERVER['PATH_INFO'] !== "/$client[id]/") { - header('Status: 308'); - header("Location: /access/$client[id]/"); - exit(); -} - -if ($client['api']) { - $data = "window.ELWIG_API = \"$client[api]\";"; -} else { - $data = "window.CLIENTS = {"; - $first = true; - foreach ($client['clients'] as $id) { - $c = $CLIENT_ACCESS[$id]; - if (!$first) $data .= ", "; - $data .= "\"$id\": {\"name\": \"$c[name]\", \"short\": \"$c[short]\", \"api\": \"$c[api]\"}"; - $first = false; - } - $data .= "};"; -} - -header('Content-Type: application/xhtml+xml; charset=UTF-8'); -echo "\n"; ?> - - - - <?php echo $client['name']; ?> - Elwig - - - - -