From 195b5193fc91b55a7d41d0deacf657a0ea6c4540 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 13 Nov 2025 00:04:18 +0900 Subject: modified recordings/recordings-plain.html, modified api/whoami.php, created api/leak-files.php --- static/api/leak-files.php | 42 ++++++++++++++++++++++++++++++++++++++++++ static/api/whoami.php | 11 +++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 static/api/leak-files.php (limited to 'static') diff --git a/static/api/leak-files.php b/static/api/leak-files.php new file mode 100644 index 0000000..cd0a104 --- /dev/null +++ b/static/api/leak-files.php @@ -0,0 +1,42 @@ + $item, + 'url' => '/recordings/Leak/' . urlencode($item), + 'size' => filesize($path), + 'modified' => filemtime($path) + ]; + } + } + } + // 최신 파일부터 정렬 + usort($files, function($a, $b) { + return $b['modified'] - $a['modified']; + }); + } + } +} catch (Exception $e) { + // 에러 발생 시 빈 배열 반환 + $files = []; +} + +echo json_encode(['files' => $files]); +?> + diff --git a/static/api/whoami.php b/static/api/whoami.php index f32cd2c..18a66f2 100644 --- a/static/api/whoami.php +++ b/static/api/whoami.php @@ -4,8 +4,15 @@ header('Content-Type: application/json'); header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Credentials: true'); -// nginx에서 전달된 사용자 정보 읽기 (X-Auth-User 헤더 또는 REMOTE_USER) -$user = $_SERVER['HTTP_X_AUTH_USER'] ?? $_SERVER['REMOTE_USER'] ?? ''; +// nginx에서 전달된 사용자 정보 읽기 (쿠키 우선, 그 다음 헤더, 마지막으로 REMOTE_USER) +$user = ''; +if (isset($_COOKIE['user']) && $_COOKIE['user']) { + $user = $_COOKIE['user']; +} elseif (isset($_SERVER['HTTP_X_AUTH_USER']) && $_SERVER['HTTP_X_AUTH_USER']) { + $user = $_SERVER['HTTP_X_AUTH_USER']; +} elseif (isset($_SERVER['REMOTE_USER']) && $_SERVER['REMOTE_USER']) { + $user = $_SERVER['REMOTE_USER']; +} echo json_encode(['user' => $user]); ?> -- cgit v1.2.3