Files
spamhasi/api/users/info.php
marc-go 58b5af9e7e feat: Add user edit modal and user management pages
- Implemented user edit modal in user_edit.html for editing user details.
- Updated sidebar.html to correctly reflect active states for Users and Settings.
- Created table-07.html for displaying user data in a structured format.
- Added settings.html for managing email content and configurations.
- Developed users.html for listing all users with functionality to add and edit users.
2026-04-27 19:00:06 +02:00

33 lines
611 B
PHP

<?php
require "../api.php";
$api = new spamhasiApi();
if (!$api->checkAuth()) {
die('{"status":500, "error":"Unauthorized"}');
}
if (!isset($_POST["id"])) {
die('{"status":500, "error":"Missing parameter"}');
}
$id = intval($_POST["id"]);
$db = $api->getDB();
$sql = "SELECT id, username FROM users WHERE id = :id";
$stmt = $db->prepare($sql);
$stmt->execute([':id' => $id]);
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if ($result) {
$json["user"] = $result;
$json["status"] = 200;
}else{
$json["status"] = 500;
$json["error"] = "Empty SQL Result";
}
die(json_encode($json));
?>