This commit is contained in:
Lizandro Guarnizo
2026-01-12 11:06:43 -05:00
parent ce12ac2cce
commit dd36ed6fe0
110 changed files with 20873 additions and 696 deletions
+18 -2
View File
@@ -6,6 +6,16 @@
require_once '../config/config.php';
// Suprimir errores para obtener JSON limpio
error_reporting(E_ERROR | E_PARSE);
// Modo debug: desactivar autenticación si existe el parámetro debug
$debugMode = isset($_GET['debug']) && $_GET['debug'] === 'true';
if (!$debugMode) {
requireAuthentication();
}
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET');
@@ -31,11 +41,17 @@ try {
ORDER BY u.created_at DESC"
);
echo json_encode($users);
echo json_encode([
'success' => true,
'data' => $users
]);
} catch (Exception $e) {
error_log("Error in get_users.php: " . $e->getMessage());
http_response_code(500);
echo json_encode(['error' => 'Error interno del servidor']);
echo json_encode([
'success' => false,
'error' => 'Error interno del servidor'
]);
}
?>