From a824d3bcdadb7f9c140b79dd0b062d88f6b7191c Mon Sep 17 00:00:00 2001 From: seo Date: Thu, 2 Jul 2026 19:17:45 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=20?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + config/config.php | 16 ++++++++++++++++ public/index.php | 1 + 3 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 1b6e13b..6cc76e7 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ control-wifi-observe.service - 로그인 세션과 CSRF token을 사용합니다. - Rhymix 사이트 관리자 세션 또는 `/custom/common` 관리자 인증 쿠키가 확인되면 Control 내부 로그인 세션을 발급합니다. +- Control 로그아웃은 Control remember token과 세션을 지우고, `/custom/common` 공통 인증 쿠키도 함께 만료합니다. - POST 조작 API는 CSRF 검증을 통과해야 합니다. - sysfs 쓰기와 systemctl 실행 권한은 sudoers 범위로 제한해야 합니다. - 재부팅 API는 CSRF, 로그인 세션, 설정된 확인 문구, 관리자 암호 재검증을 모두 요구합니다. diff --git a/config/config.php b/config/config.php index ff1eb1d..a5d73c3 100644 --- a/config/config.php +++ b/config/config.php @@ -707,6 +707,22 @@ function control_admin_session_from_rhymix_or_custom(): bool return $checked; } +function clear_common_admin_auth_cookie_if_available(): void +{ + $commonAuth = '/mnt/synology-web/custom/common/auth.php'; + if (!is_file($commonAuth) || !is_readable($commonAuth)) { + return; + } + + try { + require_once $commonAuth; + if (function_exists('custom_clear_auth_cookie')) { + custom_clear_auth_cookie(); + } + } catch (Throwable) { + } +} + function require_login(): void { if (!signed_in()) { diff --git a/public/index.php b/public/index.php index 8ddce2b..c64a214 100644 --- a/public/index.php +++ b/public/index.php @@ -10,6 +10,7 @@ $csrf = csrf_token(); if (isset($_GET['logout'])) { clear_remember_token(); + clear_common_admin_auth_cookie_if_available(); $_SESSION = []; if (ini_get('session.use_cookies')) { $p = session_get_cookie_params();