Add tailadmin
This commit is contained in:
1
api/users/info.php
Normal file
1
api/users/info.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php
|
||||
30
api/users/list.php
Normal file
30
api/users/list.php
Normal 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);
|
||||
?>
|
||||
Reference in New Issue
Block a user