Add tailadmin

This commit is contained in:
admin committed 2026-02-20 14:48:15 +01:00
1 parent 4b4a46225f
commit a8df1d61d5
70 files changed
+30775 -8

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
<?php
require "../api.php";
$api = new mcServApi();
if (!$api->checkAuth()) {
die('{"status":500, "error:"Unauthorized"}');
}
$db = $api->getDB();
$sql = "SELECT * FROM users";
$stmt = $db->query($sql);
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$users= [];
foreach($result as $user_res) {
$user["name"] = $user_res["username"];
$user["mail"] = $user_res["mail"];
$users[] = $user;
}
$json["status"] = 200;
$json["users"] = $users;
echo json_encode($json);
?>