Initial commit: 교육 프로젝트 배포
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!function_exists('edu_start_session')) {
|
||||
function edu_start_session(): void
|
||||
{
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('edu_current_member_id')) {
|
||||
function edu_current_member_id(): string
|
||||
{
|
||||
edu_start_session();
|
||||
$memberId = trim((string)($_SESSION['ss_mb_id'] ?? $_SESSION['member_id'] ?? ''));
|
||||
return $memberId;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('edu_is_logged_in')) {
|
||||
function edu_is_logged_in(): bool
|
||||
{
|
||||
return edu_current_member_id() !== '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('edu_require_login')) {
|
||||
function edu_require_login(): void
|
||||
{
|
||||
if (edu_is_logged_in()) {
|
||||
return;
|
||||
}
|
||||
|
||||
header('Location: http://erp.baroncs.co.kr/mobile/sys/controller/Study_controller.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user