Initial commit: 교육 프로젝트 배포
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
$memberId = (string)($_SESSION['member_id'] ?? '');
|
||||
$authLevel = strtoupper(trim((string)($_SESSION['auth_level'] ?? '')));
|
||||
|
||||
if ($memberId === '') {
|
||||
header('Location: /bbs/login.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!in_array($authLevel, ['LE10001', 'LE10002'], true)) {
|
||||
http_response_code(403);
|
||||
exit('접근 권한이 없습니다.');
|
||||
}
|
||||
|
||||
$currentPage = basename((string)($_SERVER['PHP_SELF'] ?? ''));
|
||||
$legalOnlyPage = 'legal_edu.php';
|
||||
|
||||
if ($authLevel === 'LE10002' && $currentPage !== $legalOnlyPage) {
|
||||
header('Location: /admin/skin/' . $legalOnlyPage);
|
||||
exit;
|
||||
}
|
||||
Reference in New Issue
Block a user