권한 없는 사용자의 메뉴 접근 방지를 위한 코드 추가

This commit is contained in:
2025-07-23 16:55:26 +09:00
parent cc2ee8cbb3
commit 99a9a6fd42
4 changed files with 30 additions and 11 deletions

View File

@ -2,6 +2,8 @@
// 베이커리 제품목록록
include_once "_common.php";
if (!isset($_SESSION['user_id'])) header( 'Location: FG_MANAGER_URL' ); // 로그인 되어있지 않으면 로그인 페이지로 보냄
include_once 'head.sub.php';
include_once FG_MANAGER_PATH."/head.php";
// 검색 변수 초기화

View File

@ -3,6 +3,7 @@
include_once "_common.php";
if (!isset($_SESSION['user_id'])) header( 'Location: FG_MANAGER_URL' ); // 로그인 되어있지 않으면 로그인 페이지로 보냄
include_once 'head.sub.php';
include_once FG_MANAGER_PATH."/head.php";
// 검색 변수 초기화

View File

@ -0,0 +1,13 @@
<?php
if (!isset($_SESSION['user_id'])) exit; //페이지 직접 실행 방지
// 권한부여 및 체크
$pageAuth = array(
'abc',
'firstgarden',
'bakery'
);
if ( !in_array($_SESSION['user_id'], $pageAuth) ) {
alert('권한이 없습니다', false);
}
?>