summaryrefslogtreecommitdiff
path: root/static/api/whoami.php
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-11-13 00:04:18 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-11-13 00:04:18 +0900
commit195b5193fc91b55a7d41d0deacf657a0ea6c4540 (patch)
tree0208c26b233decd1f25c789377f2f03f70f9e677 /static/api/whoami.php
parent519c427dc81d178b1018a7ee32c4543e354a7401 (diff)
modified recordings/recordings-plain.html, modified api/whoami.php, created api/leak-files.php
Diffstat (limited to 'static/api/whoami.php')
-rw-r--r--static/api/whoami.php11
1 files changed, 9 insertions, 2 deletions
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]);
?>