Add tailadmin

This commit is contained in:
2026-02-20 14:48:15 +01:00
parent 4b4a46225f
commit a8df1d61d5
70 changed files with 30775 additions and 8 deletions

1
api/users/info.php Normal file
View File

@@ -0,0 +1 @@
<?php

30
api/users/list.php Normal file
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);
?>