fix: Q&A 등록 중지(마이그레이션 사전작업)
This commit is contained in:
1 parent
580b403b40
commit
2616b8a005
8 files changed
+47
-10
No files matched your search
@@ -20,9 +20,10 @@ function get_admin_display_name($loginId, $fallbackName = null) {
|
||||
'b23008@baroncs.co.kr' => '관리자3',
|
||||
'cjy627@hanmaceng.co.kr' => '관리자4',
|
||||
'b23072@hanmaceng.co.kr' => '관리자5',
|
||||
'm21318@hanmaceng.co.kr' => '강근아',
|
||||
];
|
||||
if (isset($map[$loginId])) {
|
||||
return $map[$loginId];
|
||||
}
|
||||
return $fallbackName ?: $loginId;
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,16 @@ try {
|
||||
$postId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
$isEdit = $postId > 0;
|
||||
|
||||
// New Q&A submissions are closed. Block both direct form access and POST bypasses.
|
||||
if (!$isEdit) {
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
http_response_code(403);
|
||||
exit('New Q&A submissions are currently closed.');
|
||||
}
|
||||
header('Location: /eng/bbs/descope_qa_list.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
// 5) 수정 모드이면 기존 글 불러오기
|
||||
if ($isEdit) {
|
||||
$stmt = $pdo->prepare("SELECT * FROM qa_posts WHERE post_id = ?");
|
||||
|
||||
@@ -43,6 +43,16 @@ try {
|
||||
$postId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
$isEdit = $postId > 0;
|
||||
|
||||
// Block new submissions through this legacy URL as well.
|
||||
if (!$isEdit) {
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
http_response_code(403);
|
||||
exit('New Q&A submissions are currently closed.');
|
||||
}
|
||||
header('Location: /eng/bbs/descope_qa_list.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
// 5) 수정 모드이면 기존 글 불러오기
|
||||
if ($isEdit) {
|
||||
$stmt = $pdo->prepare("SELECT * FROM qa_posts WHERE post_id = ?");
|
||||
|
||||
Reference in new issue
Block a user