Refactor API structure: add internal handling, update templates, and remove deprecated files

This commit is contained in:
marc-go committed 2026-10-10 13:43:18 +02:00
1 parent 313ffec92c
commit a33de15f0c
16 files changed
+91 -29

No files matched your search

+4 -1
View File
@@ -12,6 +12,8 @@ class gbAPI {
private $db;
private $config;
private $internal;
private function b64url_encode($data) {
return rtrim(strtr(base64_encode($data), "+/", "-_"), "=");
}
@@ -20,8 +22,9 @@ class gbAPI {
return base64_decode(strtr($data, "-_", "+/"));
}
function __construct($authRequired) {
function __construct($authRequired, $internal) {
define("APP_PATH", __DIR__ . "/../");
$this->internal = $internal;
if ($authRequired) {
if (!$this->checkAuth()) {
+5
View File
@@ -1,4 +1,9 @@
<?php
// Set internal to false so that the answer goes to the client
if (!isset($internal)) {
$internal = false;
}
// Load Main Library
require "../api.php";
$api = new gbAPI(true);
+5
View File
@@ -1,4 +1,9 @@
<?php
// Set internal to false so that the answer goes to the client
if (!isset($internal)) {
$internal = false;
}
// Load API Library
require "../api.php";
+5
View File
@@ -1,4 +1,9 @@
<?php
// Set internal to false so that the answer goes to the client
if (!isset($internal)) {
$internal = false;
}
// Load Main Library
require "../api.php";
+5
View File
@@ -1,4 +1,9 @@
<?php
// Set internal to false so that the answer goes to the client
if (!isset($internal)) {
$internal = false;
}
// Load Main Library
require "../api.php";
+5
View File
@@ -1,4 +1,9 @@
<?php
// Set internal to false so that the answer goes to the client
if (!isset($internal)) {
$internal = false;
}
// Load Main Library
require "../api.php";
+2 -1
View File
@@ -80,7 +80,8 @@ $settings = [
"application_name" => "Guestbook",
"allow_html" => "false",
"approve_entrys" => "true",
"allow_new_entrys" => "true"
"allow_new_entrys" => "true",
"template" => "standard"
];
foreach ($settings as $key => $value) {