241 lines
5.9 KiB
PHP
241 lines
5.9 KiB
PHP
<?php
|
|
if (session_status() === PHP_SESSION_NONE) {
|
|
session_start();
|
|
}
|
|
|
|
$isLogin = isset($_SESSION['login']);
|
|
$auth = $_SESSION['login']['auth_bc'] ?? '';
|
|
$loginName = $_SESSION['login']['idp_name'] ?? ($_SESSION['login']['user_nm'] ?? '');
|
|
$loginEmail = $_SESSION['login']['idp_email'] ?? ($_SESSION['login']['email'] ?? '');
|
|
$displayName = $loginName ?: ($loginEmail ?: '');
|
|
$displayEmail = $loginEmail;
|
|
if ($displayName === 'Unknown') {
|
|
$displayName = '';
|
|
}
|
|
if ($displayEmail === 'Unknown') {
|
|
$displayEmail = '';
|
|
}
|
|
if ($displayName === $displayEmail) {
|
|
$displayEmail = '';
|
|
}
|
|
if ($displayName === '') {
|
|
$displayName = '사용자';
|
|
}
|
|
|
|
// 권한 그룹
|
|
$isSuperAdmin = in_array($auth, ['BS100100', 'BS100200']);
|
|
$isCompanyAdmin = in_array($auth, ['BS100100', 'BS100200', 'BS100300', 'BS100400']);
|
|
?>
|
|
<head>
|
|
<style>
|
|
.icon-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin-right: 6px;
|
|
}
|
|
|
|
.icon-btn img {
|
|
width: 30px;
|
|
height: 30px;
|
|
filter: invert(1); /* 흰색 아이콘 */
|
|
opacity: 0.8;
|
|
transition: 0.2s;
|
|
}
|
|
|
|
.icon-btn:hover img {
|
|
opacity: 1;
|
|
}
|
|
.auth-status {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
margin-right: 10px;
|
|
}
|
|
|
|
.btn-oidc-top {
|
|
--color-primary: #f95523;
|
|
--color-primary-border: #ca3f14;
|
|
background: var(--color-primary, #f95523);
|
|
border: 1px solid var(--color-primary-border, #ca3f14);
|
|
color: #fff;
|
|
padding: 8px 12px;
|
|
border-radius: 4px;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
|
|
}
|
|
|
|
.btn-oidc-top:hover {
|
|
opacity: 0.85;
|
|
}
|
|
|
|
.auth-user {
|
|
color: #fff;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
white-space: nowrap;
|
|
}
|
|
.btn-logout-top {
|
|
--color-secondary: #3a3a3a;
|
|
--color-secondary-border: #2a2a2a;
|
|
background: var(--color-secondary, #3a3a3a);
|
|
border: 1px solid var(--color-secondary-border, #2a2a2a);
|
|
color: #fff;
|
|
padding: 8px 10px;
|
|
border-radius: 4px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
margin-left: 8px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.btn-logout-top:hover {
|
|
opacity: 0.85;
|
|
}
|
|
/* 툴팁 래퍼 */
|
|
.tooltip {
|
|
position: relative;
|
|
}
|
|
|
|
/* 툴팁 박스 */
|
|
.tooltip-text {
|
|
position: absolute;
|
|
bottom: 120%;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
white-space: nowrap;
|
|
|
|
background: rgba(20, 20, 20, 0.95);
|
|
color: #fff;
|
|
font-size: 12px;
|
|
padding: 6px 10px;
|
|
border-radius: 4px;
|
|
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
pointer-events: none;
|
|
z-index: 1000;
|
|
}
|
|
|
|
/* 말풍선 화살표 */
|
|
.tooltip-text::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 100%;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
border-width: 6px;
|
|
border-style: solid;
|
|
border-color: rgba(20, 20, 20, 0.95) transparent transparent transparent;
|
|
}
|
|
|
|
/* hover 시 노출 */
|
|
.tooltip:hover .tooltip-text {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
transform: translateX(-50%) translateY(-4px);
|
|
}
|
|
|
|
</style>
|
|
<script>
|
|
window.IS_LOGIN = <?= isset($_SESSION['login']) ? 'true' : 'false' ?>;
|
|
</script>
|
|
</head>
|
|
|
|
<!-- header -->
|
|
<div class="header-wrap">
|
|
<header class="header">
|
|
<h1>
|
|
<a href="/">KNGIL</a>
|
|
</h1>
|
|
|
|
<div class="header-right">
|
|
<div class="auth-status">
|
|
<?php if ($isLogin): ?>
|
|
<span class="auth-user">
|
|
<?= htmlspecialchars($displayName) ?>
|
|
<?php if ($displayEmail): ?>
|
|
(<?= htmlspecialchars($displayEmail) ?>)
|
|
<?php endif; ?>
|
|
</span>
|
|
<a href="/kngil/bbs/logout.php" class="btn-logout-top">로그아웃</a>
|
|
<?php else: ?>
|
|
<button type="button" class="btn-oidc-top" data-oidc-login>[바론 통합로그인]</button>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<?php if ($isLogin): ?>
|
|
|
|
<!-- 통합 회원관리 (관리자/개발자만) -->
|
|
<?php if ($isSuperAdmin): ?>
|
|
<a href="/admin"
|
|
class="icon-btn tooltip">
|
|
<img src="/kngil/img/ico/ico_super_admin.svg" class="header-icon" alt="통합 회원관리">
|
|
<span class="tooltip-text">통합 회원관리</span>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<!-- 회사 관리자 (관리자/개발자/메인/서브) -->
|
|
<?php if ($isCompanyAdmin): ?>
|
|
<a href="/admin/company"
|
|
class="icon-btn tooltip">
|
|
<img src="/kngil/img/ico/ico_company_admin.svg" class="header-icon" alt="회사 관리자">
|
|
<span class="tooltip-text">회사 관리자</span>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if ($isLogin): ?>
|
|
<!-- 기존 사용자 메뉴 -->
|
|
<div class="menu-box">
|
|
<button class="menu-user">
|
|
<img src="/kngil/img/ico/ico_user.svg" alt="user">
|
|
</button>
|
|
|
|
<ul class="menu-list">
|
|
<li>
|
|
<a class="my-join" href="javascript:mypage01()">마이페이지</a>
|
|
</li>
|
|
<li>
|
|
<a class="my-login" href="/kngil/bbs/logout.php">로그아웃</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div>
|
|
<button class="menu-all">
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
</div>
|
|
<!--// header -->
|
|
|
|
|
|
<!-- floating_menu -->
|
|
<div class="floating-menu">
|
|
<ul>
|
|
<li class="floating-faq">
|
|
<a href="/kngil/skin/faq_list.skin.php">
|
|
<i class="ico-faq"></i>
|
|
<span>FAQ</span>
|
|
</a>
|
|
</li>
|
|
|
|
<li class="floating-buy">
|
|
<a href="/kngil/?page=buy">
|
|
<i class="ico-buy"></i>
|
|
<span>구매하기</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<!-- //floating_menu -->
|