Enhance API functionality: add token generation methods, implement entry management, and improve setup process with settings storage

This commit is contained in:
marc-go committed 2026-10-06 14:46:25 +02:00
1 parent 8ef5f7a941
commit 9316818753
9 files changed
+248 -25

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
<?php
// Load Main Library
require "../api.php";
$api = new gbAPI(false);
// Get Entrys
$command = "SELECT * FROM entrys WHERE status = :status";
$result = $api->dbCommand($command, true, true, [":status" => 1]);
$entrys = [];
if (!$result) {
$api->answer(200, [
"entrys" => [],
"empty" => true
]);
}
foreach($result as $row) {
$entry_name = $row["name"];
$entry_text = $row["text"];
$entry = [
"name" => $entry_name,
"text" => $entry_text
];
$entrys[] = $entry;
}
$json = json_encode($entrys);
$api->answer(200, [
"entrys" => $entrys,
"empty" => false
]);