Open IDP profile on MyPage

This commit is contained in:
Lectom C Han
2026-02-04 13:00:15 +09:00
parent 5a8320bb78
commit d920cd5249
7 changed files with 40 additions and 0 deletions

View File

@@ -910,6 +910,12 @@ function login() {
}
function mypage01() {
const raw = (window.IDP_SERVICE_URL || "").trim();
if (raw) {
const url = raw.replace(/\/+$/, "") + "/profile";
window.open(url, "idp_profile", "noopener,noreferrer");
return;
}
$(".popup_wrap").hide();
$(".btn_close").show();
$("#pop_mypage01").show(0, function () {

View File

@@ -20,7 +20,27 @@ function hide(id) {
마이페이지 1단계 (비밀번호 인증)
- 헤더에서 호출
========================= */
function getIdpProfileUrl() {
const raw = (window.IDP_SERVICE_URL || '').trim()
if (!raw) {
return ''
}
return raw.replace(/\/+$/, '') + '/profile'
}
function openIdpProfile() {
const url = getIdpProfileUrl()
if (!url) {
return false
}
window.open(url, 'idp_profile', 'noopener,noreferrer')
return true
}
window.mypage01 = function () {
if (openIdpProfile()) {
return
}
if (!window.IS_LOGIN) {
if (typeof window.login === 'function') {
window.login()

View File

@@ -910,6 +910,12 @@ function login() {
}
function mypage01() {
const raw = (window.IDP_SERVICE_URL || "").trim();
if (raw) {
const url = raw.replace(/\/+$/, "") + "/profile";
window.open(url, "idp_profile", "noopener,noreferrer");
return;
}
$(".popup_wrap").hide();
$(".btn_close").show();
$("#pop_mypage01").show(0, function () {

View File

@@ -3,8 +3,12 @@ if (session_status() === PHP_SESSION_NONE) {
session_start();
}
require_once __DIR__ . '/../bbs/env.php';
kngil_load_env_once(dirname(__DIR__, 2) . '/.env');
$isLogin = isset($_SESSION['login']);
$auth = $_SESSION['login']['auth_bc'] ?? '';
$idpServiceUrl = getenv('IDP_SERVICE_URL') ?: '';
$loginName = $_SESSION['login']['idp_name'] ?? ($_SESSION['login']['user_nm'] ?? '');
$loginEmail = $_SESSION['login']['idp_email'] ?? ($_SESSION['login']['email'] ?? '');
$displayName = $loginName ?: ($loginEmail ?: '');
@@ -141,6 +145,7 @@ $isCompanyAdmin = in_array($auth, ['BS100100', 'BS100200', 'BS100300', 'BS100400
</style>
<script>
window.IS_LOGIN = <?= isset($_SESSION['login']) ? 'true' : 'false' ?>;
window.IDP_SERVICE_URL = <?= json_encode($idpServiceUrl, JSON_UNESCAPED_SLASHES) ?>;
</script>
</head>