차량 모니터 관리자 세션 확인 보강

This commit is contained in:
seo committed 2026-07-28 22:55:12 +09:00
1 parent 36f5a30450
commit e02e59dfcd
1 file changed
+14 -7
+14 -7
View File
@@ -952,11 +952,16 @@ function car_monitor_launcher_session(): array
$cookieHeader = trim((string)($_SERVER['HTTP_COOKIE'] ?? '')); $cookieHeader = trim((string)($_SERVER['HTTP_COOKIE'] ?? ''));
if ($cookieHeader !== '') { if ($cookieHeader !== '') {
$remoteSession = car_monitor_launcher_api_request('GET', 'https://chaegeon.com/custom/launcher/api.php?session=1', null, $cookieHeader); $adminSession = car_monitor_launcher_api_request('GET', 'https://chaegeon.com/custom/launcher/api.php?adminSession=1', null, $cookieHeader);
if (is_array($remoteSession)) { if (is_array($adminSession) && !empty($adminSession['authenticated']) && !empty($adminSession['admin'])) {
if (!empty($remoteSession['authenticated'])) {
car_monitor_issue_cookie(); car_monitor_issue_cookie();
$session = ['authenticated' => true, 'admin' => true];
return $session;
} }
$remoteSession = car_monitor_launcher_api_request('GET', 'https://chaegeon.com/custom/launcher/api.php?session=1', null, $cookieHeader);
if (is_array($remoteSession) && !empty($remoteSession['authenticated'])) {
car_monitor_issue_cookie();
$session = $remoteSession; $session = $remoteSession;
return $session; return $session;
} }
@@ -1086,12 +1091,14 @@ function car_monitor_issue_pwa_cookie_if_requested(): void
} }
$cookieHeader = trim((string)($_SERVER['HTTP_COOKIE'] ?? '')); $cookieHeader = trim((string)($_SERVER['HTTP_COOKIE'] ?? ''));
$remoteSession = $cookieHeader !== '' if ($cookieHeader !== '') {
? car_monitor_launcher_api_request('GET', 'https://chaegeon.com/custom/launcher/api.php?session=1', null, $cookieHeader) $adminSession = car_monitor_launcher_api_request('GET', 'https://chaegeon.com/custom/launcher/api.php?adminSession=1', null, $cookieHeader);
: null; $remoteSession = car_monitor_launcher_api_request('GET', 'https://chaegeon.com/custom/launcher/api.php?session=1', null, $cookieHeader);
if (is_array($remoteSession) && !empty($remoteSession['authenticated'])) { if ((is_array($adminSession) && !empty($adminSession['authenticated']))
|| (is_array($remoteSession) && !empty($remoteSession['authenticated']))) {
car_monitor_issue_cookie(); car_monitor_issue_cookie();
} }
}
header('Location: /car/monitor.php', true, 302); header('Location: /car/monitor.php', true, 302);
exit; exit;