통합인증 : 백엔드 선행 작업
This commit is contained in:
@ -277,7 +277,20 @@ if( ! isset($config['cf_icode_token_key']) ){
|
||||
ADD COLUMN `cf_icode_token_key` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_icode_server_port`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
|
||||
// 아이디/비밀번호 찾기에 본인확인 사용 여부 필드 추가
|
||||
if(!isset($config['cf_cert_find']) ){
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_cert_find` TINYINT(4) NOT NULL DEFAULT '0' AFTER `cf_cert_use`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
// 통합인증 필드 추가
|
||||
if(!isset($config['cf_cert_sa']) ){
|
||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||
ADD COLUMN `cf_cert_sa` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_hp`,
|
||||
ADD COLUMN `cf_cert_kg_cd` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_sa`,
|
||||
ADD COLUMN `cf_cert_kg_mid` VARCHAR(255) NOT NULL DEFAULT '' AFTER `cf_cert_kg_cd`; ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
if(!$config['cf_faq_skin']) $config['cf_faq_skin'] = "basic";
|
||||
if(!$config['cf_mobile_faq_skin']) $config['cf_mobile_faq_skin'] = "basic";
|
||||
|
||||
@ -836,7 +849,6 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
<?php echo option_selected("1", $config['cf_cert_use'], "테스트"); ?>
|
||||
<?php echo option_selected("2", $config['cf_cert_use'], "실서비스"); ?>
|
||||
</select>
|
||||
<!-- #TODO name 재확인 -->
|
||||
<input type="checkbox" name="cf_cert_find" id="cf_cert_find"><label for="cf_cert_find">아이디/비밀번호 찾기에 사용하기</label>
|
||||
</td>
|
||||
</tr>
|
||||
@ -844,9 +856,8 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
<th scope="row" class="cf_cert_service"><label for="cf_cert_sa">통합인증</label></th>
|
||||
<td class="cf_cert_service">
|
||||
<select name="cf_cert_sa" id="cf_cert_sa">
|
||||
<!-- #TODO config 수정 필요 -->
|
||||
<?php echo option_selected("0", $config['cf_cert_sa'], "사용안함"); ?>
|
||||
<?php echo option_selected("1", $config['cf_cert_sa'], "KG이니시스 통합인증"); ?>
|
||||
<?php echo option_selected("", $config['cf_cert_sa'], "사용안함"); ?>
|
||||
<?php echo option_selected("sa", $config['cf_cert_sa'], "KG이니시스 통합인증"); ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
@ -875,10 +886,10 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
<!-- #TODO -->
|
||||
<td class="cf_cert_service">
|
||||
<span class="sitecode">MID</span>
|
||||
<input type="text" name="cf_cert_kg_cd" value="<?php echo get_sanitize_input($config['cf_cert_kg_cd']); ?>" id="cf_cert_kg_cd" class="frm_input" size="20" minlength="10" maxlength="10"><br>
|
||||
<input type="text" name="cf_cert_kg_mid" value="<?php echo get_sanitize_input($config['cf_cert_kg_mid']); ?>" id="cf_cert_kg_mid" class="frm_input" size="20" minlength="10" maxlength="10"><br>
|
||||
<br>
|
||||
<span class="sitecode">API Key</span>
|
||||
<input type="text" name="cf_cert_kg_mid" value="<?php echo get_sanitize_input($config['cf_cert_kg_mid']); ?>" id="cf_cert_kg_mid" class="frm_input" size="40">
|
||||
<input type="text" name="cf_cert_kg_cd" value="<?php echo get_sanitize_input($config['cf_cert_kg_cd']); ?>" id="cf_cert_kg_cd" class="frm_input" size="40">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@ -22,7 +22,7 @@ check_admin_token();
|
||||
|
||||
$cf_social_servicelist = !empty($_POST['cf_social_servicelist']) ? implode(',', $_POST['cf_social_servicelist']) : '';
|
||||
|
||||
$check_keys = array('cf_lg_mid', 'cf_lg_mert_key', 'cf_cert_kcb_cd', 'cf_cert_kcp_cd', 'cf_editor', 'cf_recaptcha_site_key', 'cf_recaptcha_secret_key', 'cf_naver_clientid', 'cf_naver_secret', 'cf_facebook_appid', 'cf_facebook_secret', 'cf_twitter_key', 'cf_twitter_secret', 'cf_google_clientid', 'cf_google_secret', 'cf_googl_shorturl_apikey', 'cf_kakao_rest_key', 'cf_kakao_client_secret', 'cf_kakao_js_apikey', 'cf_payco_clientid', 'cf_payco_secret');
|
||||
$check_keys = array('cf_lg_mid', 'cf_lg_mert_key', 'cf_cert_kcb_cd', 'cf_cert_kcp_cd', 'cf_editor', 'cf_recaptcha_site_key', 'cf_recaptcha_secret_key', 'cf_naver_clientid', 'cf_naver_secret', 'cf_facebook_appid', 'cf_facebook_secret', 'cf_twitter_key', 'cf_twitter_secret', 'cf_google_clientid', 'cf_google_secret', 'cf_googl_shorturl_apikey', 'cf_kakao_rest_key', 'cf_kakao_client_secret', 'cf_kakao_js_apikey', 'cf_payco_clientid', 'cf_payco_secret','cf_cert_kg_cd','cf_cert_kg_mid');
|
||||
|
||||
foreach( $check_keys as $key ){
|
||||
if ( isset($_POST[$key]) && $_POST[$key] ){
|
||||
@ -99,8 +99,10 @@ $check_keys = array(
|
||||
'cf_social_login_use' => 'int',
|
||||
'cf_cert_req' => 'int',
|
||||
'cf_cert_use' => 'int',
|
||||
'cf_cert_find' => 'int',
|
||||
'cf_cert_ipin' => 'char',
|
||||
'cf_cert_hp' => 'char',
|
||||
'cf_cert_sa' => 'char',
|
||||
'cf_admin_email' => 'char',
|
||||
'cf_admin_email_name' => 'char',
|
||||
'cf_add_script' => 'text',
|
||||
@ -171,12 +173,13 @@ foreach( $check_keys as $k => $v ){
|
||||
}
|
||||
|
||||
// 본인확인을 사용할 경우 아이핀, 휴대폰인증 중 하나는 선택되어야 함
|
||||
if($_POST['cf_cert_use'] && !$_POST['cf_cert_ipin'] && !$_POST['cf_cert_hp'])
|
||||
alert('본인확인을 위해 아이핀 또는 휴대폰 본인확인 서비스를 하나이상 선택해 주십시오');
|
||||
if($_POST['cf_cert_use'] && !$_POST['cf_cert_ipin'] && !$_POST['cf_cert_hp'] && !$_POST['cf_cert_sa'])
|
||||
alert('본인확인을 위해 아이핀, 휴대폰 본인확인, KG이니시스 통합인증 서비스 중 하나이상 선택해 주십시오');
|
||||
|
||||
if(!$_POST['cf_cert_use']) {
|
||||
$posts[$key] = $_POST['cf_cert_ipin'] = '';
|
||||
$posts[$key] = $_POST['cf_cert_hp'] = '';
|
||||
$posts[$key] = $_POST['cf_cert_sa'] = '';
|
||||
}
|
||||
|
||||
$sql = " update {$g5['config_table']}
|
||||
@ -274,8 +277,12 @@ $sql = " update {$g5['config_table']}
|
||||
cf_captcha_mp3 = '{$_POST['cf_captcha_mp3']}',
|
||||
cf_editor = '{$_POST['cf_editor']}',
|
||||
cf_cert_use = '{$_POST['cf_cert_use']}',
|
||||
cf_cert_find = '{$_POST['cf_cert_find']}',
|
||||
cf_cert_ipin = '{$_POST['cf_cert_ipin']}',
|
||||
cf_cert_hp = '{$_POST['cf_cert_hp']}',
|
||||
cf_cert_sa = '{$_POST['cf_cert_sa']}',
|
||||
cf_cert_kg_cd = '{$_POST['cf_cert_kg_cd']}',
|
||||
cf_cert_kg_mid = '{$_POST['cf_cert_kg_mid']}',
|
||||
cf_cert_kcb_cd = '{$_POST['cf_cert_kcb_cd']}',
|
||||
cf_cert_kcp_cd = '{$_POST['cf_cert_kcp_cd']}',
|
||||
cf_lg_mid = '{$_POST['cf_lg_mid']}',
|
||||
|
||||
@ -194,6 +194,10 @@ $colspan = 16;
|
||||
$mb_certify_case = '아이핀';
|
||||
$mb_certify_val = '';
|
||||
break;
|
||||
case 'sa':
|
||||
$mb_certify_case = '통합인증';
|
||||
$mb_certify_val = '';
|
||||
break;
|
||||
case 'admin':
|
||||
$mb_certify_case = '관리자';
|
||||
$mb_certify_val = 'admin';
|
||||
|
||||
@ -59,6 +59,7 @@ define('G5_MOBILE_DIR', 'mobile');
|
||||
define('G5_OKNAME_DIR', 'okname');
|
||||
|
||||
define('G5_KCPCERT_DIR', 'kcpcert');
|
||||
define('G5_KGCERT_DIR', 'kgcert');
|
||||
define('G5_LGXPAY_DIR', 'lgxpay');
|
||||
|
||||
define('G5_SNS_DIR', 'sns');
|
||||
@ -97,6 +98,7 @@ define('G5_PLUGIN_URL', G5_URL.'/'.G5_PLUGIN_DIR);
|
||||
define('G5_EDITOR_URL', G5_PLUGIN_URL.'/'.G5_EDITOR_DIR);
|
||||
define('G5_OKNAME_URL', G5_PLUGIN_URL.'/'.G5_OKNAME_DIR);
|
||||
define('G5_KCPCERT_URL', G5_PLUGIN_URL.'/'.G5_KCPCERT_DIR);
|
||||
define('G5_KGCERT_URL', G5_PLUGIN_URL.'/'.G5_KGCERT_DIR);
|
||||
define('G5_LGXPAY_URL', G5_PLUGIN_URL.'/'.G5_LGXPAY_DIR);
|
||||
define('G5_SNS_URL', G5_PLUGIN_URL.'/'.G5_SNS_DIR);
|
||||
define('G5_SYNDI_URL', G5_PLUGIN_URL.'/'.G5_SYNDI_DIR);
|
||||
@ -116,6 +118,7 @@ define('G5_EDITOR_PATH', G5_PLUGIN_PATH.'/'.G5_EDITOR_DIR);
|
||||
define('G5_OKNAME_PATH', G5_PLUGIN_PATH.'/'.G5_OKNAME_DIR);
|
||||
|
||||
define('G5_KCPCERT_PATH', G5_PLUGIN_PATH.'/'.G5_KCPCERT_DIR);
|
||||
define('G5_KGCERT_PATH', G5_PLUGIN_PATH.'/'.G5_KGCERT_DIR);
|
||||
define('G5_LGXPAY_PATH', G5_PLUGIN_PATH.'/'.G5_LGXPAY_DIR);
|
||||
|
||||
define('G5_SNS_PATH', G5_PLUGIN_PATH.'/'.G5_SNS_DIR);
|
||||
|
||||
@ -285,8 +285,12 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
|
||||
`cf_captcha_mp3` varchar(255) NOT NULL DEFAULT '',
|
||||
`cf_editor` varchar(50) NOT NULL DEFAULT '',
|
||||
`cf_cert_use` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`cf_cert_find` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`cf_cert_ipin` varchar(255) NOT NULL DEFAULT '',
|
||||
`cf_cert_hp` varchar(255) NOT NULL DEFAULT '',
|
||||
`cf_cert_sa` varchar(255) NOT NULL DEFAULT '',
|
||||
`cf_cert_kg_cd` varchar(255) NOT NULL DEFAULT '',
|
||||
`cf_cert_kg_mid` varchar(255) NOT NULL DEFAULT '',
|
||||
`cf_cert_kcb_cd` varchar(255) NOT NULL DEFAULT '',
|
||||
`cf_cert_kcp_cd` varchar(255) NOT NULL DEFAULT '',
|
||||
`cf_lg_mid` varchar(100) NOT NULL DEFAULT '',
|
||||
|
||||
@ -100,6 +100,9 @@ function cert_confirm()
|
||||
var val = document.fregisterform.cert_type.value
|
||||
|
||||
switch(val) {
|
||||
case "sa":
|
||||
type = "통합인증";
|
||||
break;
|
||||
case "ipin":
|
||||
type = "아이핀";
|
||||
break;
|
||||
@ -115,3 +118,27 @@ function cert_confirm()
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function call_sa(directAgencys, url) {
|
||||
let window = popupCenter();
|
||||
if(window != undefined && window != null) {
|
||||
document.saForm.setAttribute("target", "sa_popup");
|
||||
document.saForm.setAttribute("method", "post");
|
||||
document.saForm.directAgency.value = directAgencys;
|
||||
document.saForm.setAttribute("action", url);
|
||||
document.saForm.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function popupCenter() {
|
||||
let _width = 400;
|
||||
let _height = 620;
|
||||
var xPos = (document.body.offsetWidth/2) - (_width/2); // 가운데 정렬
|
||||
xPos += window.screenLeft; // 듀얼 모니터일 때
|
||||
if( navigator.userAgent.indexOf("Android") > - 1 || navigator.userAgent.indexOf("iPhone") > - 1 ) // 모바일일때
|
||||
{
|
||||
return window;
|
||||
}else {
|
||||
return window.open("", "sa_popup", "width="+_width+", height="+_height+", left="+xPos+", menubar=yes, status=yes, titlebar=yes, resizable=yes");
|
||||
}
|
||||
}
|
||||
@ -2782,6 +2782,9 @@ function certify_count_check($mb_id, $type)
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
switch($type) {
|
||||
case 'sa' :
|
||||
$cert = '통합인증';
|
||||
break;
|
||||
case 'hp':
|
||||
$cert = '휴대폰';
|
||||
break;
|
||||
|
||||
@ -7,7 +7,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
|
||||
<div class="register">
|
||||
<script src="<?php echo G5_JS_URL ?>/jquery.register_form.js"></script>
|
||||
<?php if($config['cf_cert_use'] && ($config['cf_cert_ipin'] || $config['cf_cert_hp'])) { ?>
|
||||
<?php if($config['cf_cert_use'] && ($config['cf_cert_sa'] || $config['cf_cert_ipin'] || $config['cf_cert_hp'])) { ?>
|
||||
<script src="<?php echo G5_JS_URL ?>/certify.js?v=<?php echo G5_JS_VER; ?>"></script>
|
||||
<?php } ?>
|
||||
|
||||
@ -51,12 +51,12 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
<?php
|
||||
if($config['cf_cert_use']) {
|
||||
// #TODO 조건 추가 필요
|
||||
// if($config['cf_cert_sa']) {
|
||||
echo '<button type="button" id="win_sa_toss" class="btn_frmline">토스 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_pass" class="btn_frmline">PASS 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_payco" class="btn_frmline">페이코 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_cert" class="btn_frmline">금융인증서</button>'.PHP_EOL;
|
||||
// }
|
||||
if($config['cf_cert_sa']) {
|
||||
echo '<button type="button" id="win_sa_toss_cert" class="btn_frmline">토스 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_pass_cert" class="btn_frmline">PASS 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_payco_cert" class="btn_frmline">페이코 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_kftc_cert" class="btn_frmline">금융인증서</button>'.PHP_EOL;
|
||||
}
|
||||
if($config['cf_cert_hp'])
|
||||
echo '<button type="button" id="win_hp_cert" class="btn_frmline btn">휴대폰 본인확인</button>'.PHP_EOL;
|
||||
if($config['cf_cert_ipin'])
|
||||
@ -67,10 +67,17 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
?>
|
||||
<?php
|
||||
if ($config['cf_cert_use'] && $member['mb_certify']) {
|
||||
if($member['mb_certify'] == 'ipin')
|
||||
$mb_cert = '아이핀';
|
||||
else
|
||||
$mb_cert = '휴대폰';
|
||||
switch ($member['mb_certify']) {
|
||||
case "sa":
|
||||
$mb_cert = "통합인증";
|
||||
break;
|
||||
case "ipin":
|
||||
$mb_cert = "아이핀";
|
||||
break;
|
||||
case "hp":
|
||||
$mb_cert = "휴대폰";
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<div id="msg_certify">
|
||||
<strong><?php echo $mb_cert; ?> 본인확인</strong><?php if ($member['mb_adult']) { ?> 및 <strong>성인인증</strong><?php } ?> 완료
|
||||
@ -283,6 +290,40 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
$(function() {
|
||||
$("#reg_zip_find").css("display", "inline-block");
|
||||
|
||||
<?php if($config['cf_cert_use'] && $config['cf_cert_sa']) { ?>
|
||||
// TOSS 통합인증
|
||||
$("#win_sa_toss_cert").click(function() {
|
||||
if(!cert_confirm())
|
||||
return false;
|
||||
|
||||
call_sa("TOSS", "<?php echo G5_KGCERT_URL; ?>/kg_request.php");
|
||||
return;
|
||||
});
|
||||
// PASS 통합인증
|
||||
$("#win_sa_pass_cert").click(function() {
|
||||
if(!cert_confirm())
|
||||
return false;
|
||||
|
||||
call_sa("PASS", "<?php echo G5_KGCERT_URL; ?>/kg_request.php");
|
||||
return;
|
||||
});
|
||||
// PAYCO 통합인증
|
||||
$("#win_sa_payco_cert").click(function() {
|
||||
if(!cert_confirm())
|
||||
return false;
|
||||
|
||||
call_sa("PAYCO", "<?php echo G5_KGCERT_URL; ?>/kg_request.php");
|
||||
return;
|
||||
});
|
||||
// KFTC 통합인증
|
||||
$("#win_sa_kftc_cert").click(function() {
|
||||
if(!cert_confirm())
|
||||
return false;
|
||||
|
||||
call_sa("KFTC", "<?php echo G5_KGCERT_URL; ?>/kg_request.php");
|
||||
return;
|
||||
});
|
||||
<?php } ?>
|
||||
<?php if($config['cf_cert_use'] && $config['cf_cert_ipin']) { ?>
|
||||
// 아이핀인증
|
||||
$("#win_ipin_cert").click(function(e) {
|
||||
@ -335,6 +376,9 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
var type;
|
||||
|
||||
switch(val) {
|
||||
case "sa":
|
||||
type = "통합인증";
|
||||
break;
|
||||
case "ipin":
|
||||
type = "아이핀";
|
||||
break;
|
||||
|
||||
2
plugin/kgcert/_common.php
Normal file
2
plugin/kgcert/_common.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
include_once('../../common.php');
|
||||
71
plugin/kgcert/kg_request.php
Normal file
71
plugin/kgcert/kg_request.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
global $g5;
|
||||
|
||||
$sql = "select MAX(cr_id) as max_cr_id from {$g5['cert_history_table']} limit 1";
|
||||
$res = sql_fetch($sql);
|
||||
$max_cr_id = $res['max_cr_id'];
|
||||
if(empty($max_cr_id)) $max_cr_id = 0;
|
||||
|
||||
certify_count_check($member['mb_id'], 'sa'); // 금일 인증시도 횟수 체크
|
||||
|
||||
//$mid = 'SRA'.$config['cf_cert_kg_mid'];
|
||||
$mid = $config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의)
|
||||
$apiKey = $config['cf_cert_kg_cd']; // 부여받은 MID 에 대한 apiKey
|
||||
$mTxId ='SIR'.$max_cr_id;
|
||||
$reqSvcCd ='01';
|
||||
|
||||
if($config['cf_cert_use'] != 2) { // 테스트모드일때
|
||||
$mid = $config['cf_cert_kg_mid'];
|
||||
$apiKey = $config['cf_cert_kg_cd'];
|
||||
$mTxId ='test_'.$max_cr_id;
|
||||
}
|
||||
// 등록가맹점 확인
|
||||
$plainText1 = hash("sha256",(string)$mid.(string)$mTxId.(string)$apiKey);
|
||||
$authHash = $plainText1;
|
||||
|
||||
$flgFixedUser = (!empty($member['mb_id']) && !empty($member['mb_name']) && !empty($member['mb_hp']) && !empty($member['mb_birth']))? 'Y' : 'N'; // 특정사용자 고정시 : Y 세팅및 아래 해시 데이터 생성
|
||||
|
||||
if($flgFixedUser == 'Y') {
|
||||
$userName = $member['mb_name']; // 사용자 이름
|
||||
$userPhone = preg_replace("/-/","" , $member['mb_hp']); // 사용자 전화번호 하이픈만 제거
|
||||
$userBirth = $member['mb_birth']; // 사용자 생년월일
|
||||
|
||||
$plainText2 = hash("sha256",(string)$userName.(string)$mid.(string)$userPhone.(string)$mTxId.(string)$userBirth.(string)$reqSvcCd);
|
||||
$userHash = $plainText2;
|
||||
}
|
||||
$g5['title'] = '통합인증 결과';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
?>
|
||||
<script language="javascript">
|
||||
function callSa() {
|
||||
document.saForm.setAttribute("target", "_self");
|
||||
document.saForm.setAttribute("post", "post");
|
||||
document.saForm.setAttribute("action", "https://sa.inicis.com/auth");
|
||||
document.saForm.submit();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form name="saForm">
|
||||
<input type="hidden" name="mid" value="<?php echo $mid ?>"> <!-- 필수 값 -->
|
||||
<input type="hidden" name="reqSvcCd" value="<?php echo $reqSvcCd ?>"> <!-- 필수 값 -->
|
||||
<input type="hidden" name="mTxId" value="<?php echo $mTxId ?>"> <!-- 필수 값 -->
|
||||
|
||||
<input type="hidden" name="authHash" value="<?php echo $authHash ?>"> <!-- 필수 값 -->
|
||||
<input type="hidden" name="flgFixedUser" value="<?php echo $flgFixedUser ?>"> <!-- 필수 값 Y/N 특정사용자 인증 요청 여부 -->
|
||||
<input type="hidden" name="userName" value="<?php echo $userName ?>">
|
||||
<input type="hidden" name="userPhone" value="<?php echo $userPhone ?>">
|
||||
<input type="hidden" name="userBirth" value="<?php echo $userBirth ?>">
|
||||
<input type="hidden" name="userHash" value="<?php echo $userHash ?>">
|
||||
<input type="hidden" name="mbId" value="<?php echo $member['mb_id'] ?>">
|
||||
<input type="hidden" name="directAgency" value="<?php echo $_POST['directAgency']; ?>">
|
||||
|
||||
<input type="hidden" name="successUrl" value="<?php echo G5_KGCERT_URL; ?>/kg_result.php"> <!-- 필수 값 -->
|
||||
<input type="hidden" name="failUrl" value="<?php echo G5_KGCERT_URL; ?>/kg_response.php"> <!-- 필수 값 -->
|
||||
<!-- successUrl / failUrl 은 분리 하여 이용가능!-->
|
||||
</form>
|
||||
<script>
|
||||
callSa();
|
||||
</script>
|
||||
25
plugin/kgcert/kg_response.php
Normal file
25
plugin/kgcert/kg_response.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
extract($_POST);
|
||||
|
||||
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> ';
|
||||
|
||||
print_r2($_COOKIE);
|
||||
// STEP2 에 이어 인증결과가 성공일(resultCode=0000) 경우 STEP2 에서 받은 인증결과로 아래 승인요청 진행
|
||||
$txId = $_POST['txId'];
|
||||
$mid = substr($txId, 6, 10);
|
||||
print_r2($_SERVER);
|
||||
print_r2($_SESSION);
|
||||
print_r2($_POST);
|
||||
die;
|
||||
// echo '<인증결과내역>'."<br/><br/>";
|
||||
// echo 'resultCode : '.$_REQUEST["resultCode"]."<br/>";
|
||||
// echo 'resultMsg : '.$_REQUEST["resultMsg"]."<br/>";
|
||||
// echo 'authRequestUrl : '.$_REQUEST["authRequestUrl"]."<br/>";
|
||||
// echo 'txId : '.$_REQUEST["txId"]."<br/>";
|
||||
|
||||
// 인증실패
|
||||
alert_close('코드 : '.$_POST['res_cd'].' '.urldecode($_POST['res_msg']));
|
||||
exit;
|
||||
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
116
plugin/kgcert/kg_result.php
Normal file
116
plugin/kgcert/kg_result.php
Normal file
@ -0,0 +1,116 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> ';
|
||||
$txId = $_POST['txId'];
|
||||
$mid = substr($txId, 6, 10);
|
||||
if ($_POST["resultCode"] === "0000") {
|
||||
|
||||
$data = array(
|
||||
'mid' => $mid,
|
||||
'txId' => $txId
|
||||
);
|
||||
|
||||
$post_data = json_encode($data);
|
||||
|
||||
// curl 통신 시작
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $_POST["authRequestUrl"]);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
$res_data = json_decode($response, true);
|
||||
// -------------------- 결과 수신 -------------------------------------------
|
||||
echo '<결과내역>'." '{$mid}' <br/><br/>";
|
||||
echo $response;
|
||||
print_r2($_SESSION);
|
||||
// print_r2($response);
|
||||
if($res_data['resultCode'] == "0000") {
|
||||
|
||||
@insert_cert_history($member['mb_id'], 'kg', 'sa'); // 인증성공 시 내역 기록
|
||||
|
||||
$cert_no = $res_data['txId']; // LG 인증처리번호
|
||||
$phone_no = $res_data['userPhone']; // 전화번호
|
||||
$user_name = $res_data['userName']; // 이름
|
||||
$birth_day = $res_data['userBirthday']; // 생년월일
|
||||
$ci = $res_data['userCi']; // CI
|
||||
|
||||
if(!$phone_no)
|
||||
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
||||
|
||||
$ci_hash = md5($ci . $ci);
|
||||
$phone_no = hyphen_hp_number($phone_no);
|
||||
$mb_dupinfo = $ci_hash;
|
||||
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['mb_id']) {
|
||||
alert_close("입력하신 본인확인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']);
|
||||
}
|
||||
|
||||
// hash 데이터
|
||||
$cert_type = 'sa';
|
||||
$md5_cert_no = md5($cert_no);
|
||||
$hash_data = md5($user_name.$cert_type.$birth_day.$md5_cert_no);
|
||||
|
||||
// 성인인증결과
|
||||
$adult_day = date("Ymd", strtotime("-19 years", G5_SERVER_TIME));
|
||||
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
|
||||
|
||||
set_session("ss_cert_type", $cert_type);
|
||||
set_session("ss_cert_no", $md5_cert_no);
|
||||
set_session("ss_cert_hash", $hash_data);
|
||||
set_session("ss_cert_adult", $adult);
|
||||
set_session("ss_cert_birth", $birth_day);
|
||||
|
||||
//set_session("ss_cert_sex", ($sex_code=="01"?"M":"F"));
|
||||
set_session('ss_cert_dupinfo', $mb_dupinfo);
|
||||
}else{
|
||||
// 인증실패
|
||||
alert_close('코드 : '.$res_data['resultCode'].' '.urldecode($res_data['resultMsg']));
|
||||
exit;
|
||||
}
|
||||
} else { // resultCode===0000 아닐경우 아래 인증 실패를 출력함
|
||||
// 인증실패
|
||||
alert_close('코드 : '.$_POST['resultCode'].' '.urldecode($_POST['resultMsg']));
|
||||
exit;
|
||||
}
|
||||
$g5['title'] = '통합인증 결과';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
?>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
|
||||
var $opener = window.opener;
|
||||
var is_mobile = false;
|
||||
|
||||
if (typeof g5_is_mobile != "undefined" && g5_is_mobile ) {
|
||||
$opener = window.parent;
|
||||
is_mobile = true;
|
||||
} else {
|
||||
$opener = window.opener;
|
||||
}
|
||||
// 인증정보
|
||||
$opener.$("input[name=cert_type]").val("<?php echo $cert_type; ?>");
|
||||
$opener.$("input[name=mb_name]").val("<?php echo $user_name; ?>").attr("readonly", true);
|
||||
$opener.$("input[name=mb_hp]").val("<?php echo $phone_no; ?>").attr("readonly", true);
|
||||
$opener.$("input[name=cert_no]").val("<?php echo $md5_cert_no; ?>");
|
||||
|
||||
if(is_mobile) {
|
||||
$opener.$("#cert_info").css("display", "");
|
||||
$opener.$("#lgu_cert" ).css("display", "none");
|
||||
}
|
||||
|
||||
alert("본인인증이 완료되었습니다.");
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
@ -9,7 +9,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
|
||||
<div class="register">
|
||||
<script src="<?php echo G5_JS_URL ?>/jquery.register_form.js"></script>
|
||||
<?php if($config['cf_cert_use'] && ($config['cf_cert_ipin'] || $config['cf_cert_hp'])) { ?>
|
||||
<?php if($config['cf_cert_use'] && ($config['cf_cert_sa'] || $config['cf_cert_ipin'] || $config['cf_cert_hp'])) { ?>
|
||||
<script src="<?php echo G5_JS_URL ?>/certify.js?v=<?php echo G5_JS_VER; ?>"></script>
|
||||
<?php } ?>
|
||||
|
||||
@ -56,13 +56,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
<li>
|
||||
<?php
|
||||
if($config['cf_cert_use']) {
|
||||
// #TODO 조건 추가 필요
|
||||
// if($config['cf_cert_sa']) {
|
||||
echo '<button type="button" id="win_sa_toss" class="btn_frmline">토스 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_pass" class="btn_frmline">PASS 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_payco" class="btn_frmline">페이코 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_cert" class="btn_frmline">금융인증서</button>'.PHP_EOL;
|
||||
// }
|
||||
if($config['cf_cert_sa'])
|
||||
echo '<button type="button" id="win_sa_toss_cert" class="btn_frmline">토스 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_pass_cert" class="btn_frmline">PASS 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_payco_cert" class="btn_frmline">페이코 인증</button>'.PHP_EOL;
|
||||
echo '<button type="button" id="win_sa_kftc_cert" class="btn_frmline">금융인증서</button>'.PHP_EOL;
|
||||
if($config['cf_cert_hp'])
|
||||
echo '<button type="button" id="win_hp_cert" class="btn_frmline">휴대폰 본인확인</button>'.PHP_EOL;
|
||||
if($config['cf_cert_ipin'])
|
||||
@ -73,10 +71,17 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
?>
|
||||
<?php
|
||||
if ($config['cf_cert_use'] && $member['mb_certify']) {
|
||||
if($member['mb_certify'] == 'ipin')
|
||||
$mb_cert = '아이핀';
|
||||
else
|
||||
$mb_cert = '휴대폰';
|
||||
switch ($member['mb_certify']) {
|
||||
case "sa":
|
||||
$mb_cert = "통합인증";
|
||||
break;
|
||||
case "ipin":
|
||||
$mb_cert = "아이핀";
|
||||
break;
|
||||
case "hp":
|
||||
$mb_cert = "휴대폰";
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<div id="msg_certify">
|
||||
<strong><?php echo $mb_cert; ?> 본인확인</strong><?php if ($member['mb_adult']) { ?> 및 <strong>성인인증</strong><?php } ?> 완료
|
||||
@ -292,10 +297,49 @@ gif, jpg, png파일만 가능하며 용량 <?php echo number_format($config['cf_
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php if($config['cf_cert_use'] && $config['cf_cert_sa']) { ?>
|
||||
<form name="saForm">
|
||||
<input type="hidden" name="directAgency" value="">
|
||||
</form>
|
||||
<?php } ?>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#reg_zip_find").css("display", "inline-block");
|
||||
|
||||
<?php if($config['cf_cert_use'] && $config['cf_cert_sa']) { ?>
|
||||
// TOSS 통합인증
|
||||
$("#win_sa_toss_cert").click(function() {
|
||||
if(!cert_confirm())
|
||||
return false;
|
||||
|
||||
call_sa("TOSS", "<?php echo G5_KGCERT_URL; ?>/kg_request.php");
|
||||
return;
|
||||
});
|
||||
// PASS 통합인증
|
||||
$("#win_sa_pass_cert").click(function() {
|
||||
if(!cert_confirm())
|
||||
return false;
|
||||
|
||||
call_sa("PASS", "<?php echo G5_KGCERT_URL; ?>/kg_request.php");
|
||||
return;
|
||||
});
|
||||
// PAYCO 통합인증
|
||||
$("#win_sa_payco_cert").click(function() {
|
||||
if(!cert_confirm())
|
||||
return false;
|
||||
|
||||
call_sa("PAYCO", "<?php echo G5_KGCERT_URL; ?>/kg_request.php");
|
||||
return;
|
||||
});
|
||||
// KFTC 통합인증
|
||||
$("#win_sa_kftc_cert").click(function() {
|
||||
if(!cert_confirm())
|
||||
return false;
|
||||
|
||||
call_sa("KFTC", "<?php echo G5_KGCERT_URL; ?>/kg_request.php");
|
||||
return;
|
||||
});
|
||||
<?php } ?>
|
||||
<?php if($config['cf_cert_use'] && $config['cf_cert_ipin']) { ?>
|
||||
// 아이핀인증
|
||||
$("#win_ipin_cert").click(function() {
|
||||
|
||||
Reference in New Issue
Block a user