통합인증 : 코드정리
This commit is contained in:
@ -795,7 +795,7 @@ if(!empty($extend_file) && is_array($extend_file)) {
|
|||||||
}
|
}
|
||||||
unset($extend_file);
|
unset($extend_file);
|
||||||
|
|
||||||
if(!$is_admin && $is_member && (!defined("G5_CERT_IN_PROG") || !G5_CERT_IN_PROG) && $config['cf_cert_use'] <> 0 && $config['cf_cert_req']) { // 본인인증이 필수일때
|
if($is_member && !$is_admin && (!defined("G5_CERT_IN_PROG") || !G5_CERT_IN_PROG) && $config['cf_cert_use'] <> 0 && $config['cf_cert_req']) { // 본인인증이 필수일때
|
||||||
if ((empty($member['mb_certify']) || (!empty($member['mb_certify']) && strlen($member['mb_dupinfo']) == 64))) { // di로 인증되어 있거나 본인인증이 안된 계정일때
|
if ((empty($member['mb_certify']) || (!empty($member['mb_certify']) && strlen($member['mb_dupinfo']) == 64))) { // di로 인증되어 있거나 본인인증이 안된 계정일때
|
||||||
goto_url(G5_BBS_URL."/member_cert_refresh.php");
|
goto_url(G5_BBS_URL."/member_cert_refresh.php");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,7 +135,6 @@ define('G5_PHPMAILER_PATH', G5_PLUGIN_PATH.'/'.G5_PHPMAILER_DIR);
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
define('G5_SET_DEVICE', 'both');
|
define('G5_SET_DEVICE', 'both');
|
||||||
|
|
||||||
// define('G5_CERT_IN_PROG', false); // 재인증페이지 리디렉션 사용여부
|
|
||||||
define('G5_USE_MOBILE', true); // 모바일 홈페이지를 사용하지 않을 경우 false 로 설정
|
define('G5_USE_MOBILE', true); // 모바일 홈페이지를 사용하지 않을 경우 false 로 설정
|
||||||
define('G5_USE_CACHE', true); // 최신글등에 cache 기능 사용 여부
|
define('G5_USE_CACHE', true); // 최신글등에 cache 기능 사용 여부
|
||||||
|
|
||||||
|
|||||||
@ -1,71 +1,71 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once('./_common.php');
|
include_once('./_common.php');
|
||||||
|
|
||||||
$txId = $_POST['txId'];
|
$txId = $_POST['txId'];
|
||||||
$mid = substr($txId, 6, 10);
|
$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);
|
||||||
|
|
||||||
if ($_POST["resultCode"] === "0000") {
|
$response = curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
$res_data = json_decode($response, true);
|
||||||
|
|
||||||
$data = array(
|
if($res_data['resultCode'] === "0000") {
|
||||||
'mid' => $mid,
|
|
||||||
'txId' => $txId
|
|
||||||
);
|
|
||||||
|
|
||||||
$post_data = json_encode($data);
|
@insert_cert_history($member['mb_id'], 'kg', 'sa'); // 인증성공 시 내역 기록
|
||||||
|
|
||||||
// curl 통신 시작
|
$cert_type = 'sa'; // 인증타입
|
||||||
$ch = curl_init();
|
$cert_no = $res_data['txId']; // 이니시스 트랜잭션 ID
|
||||||
curl_setopt($ch, CURLOPT_URL, $_POST["authRequestUrl"]);
|
$phone_no = $res_data['userPhone']; // 전화번호
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
$user_name = $res_data['userName']; // 이름
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
$birth_day = $res_data['userBirthday']; // 생년월일
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
$ci = $res_data['userCi']; // CI
|
||||||
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);
|
if(!$phone_no)
|
||||||
curl_close($ch);
|
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
||||||
$res_data = json_decode($response, true);
|
|
||||||
|
|
||||||
if($res_data['resultCode'] === "0000") {
|
$md5_ci = md5($ci . $ci);
|
||||||
|
$phone_no = hyphen_hp_number($phone_no);
|
||||||
|
$mb_dupinfo = $md5_ci;
|
||||||
|
|
||||||
@insert_cert_history('@password_lost@', 'kg', 'sa'); // 인증성공 시 내역 기록
|
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}'"); // ci데이터로 찾음
|
||||||
|
if(empty($row['mb_id'])) { // ci로 등록된 계정이 없다면
|
||||||
$cert_type = 'sa'; // 인증타입
|
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
|
||||||
$cert_no = $res_data['txId']; // 이니시스 트랜잭션 ID
|
exit;
|
||||||
$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("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
|
||||||
|
|
||||||
$md5_ci = md5($ci . $ci);
|
|
||||||
$phone_no = hyphen_hp_number($phone_no);
|
|
||||||
$mb_dupinfo = $md5_ci;
|
|
||||||
|
|
||||||
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}'"); // ci데이터로 찾음
|
|
||||||
if(empty($row['mb_id'])) { // ci로 등록된 계정이 없다면
|
|
||||||
alert_close("인증하신 정보로 가입된 회원정보가 없습니다.");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 인증실패 curl의 인증실패 체크
|
|
||||||
alert_close('코드 : '.$res_data['resultCode'].' '.urldecode($res_data['resultMsg']));
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
} else { // resultCode===0000 아닐경우 아래 인증 실패를 출력함
|
} else {
|
||||||
// 인증실패
|
// 인증실패 curl의 인증실패 체크
|
||||||
alert_close('코드 : '.$_POST['resultCode'].' '.urldecode($_POST['resultMsg']));
|
alert_close('코드 : '.$res_data['resultCode'].' '.urldecode($res_data['resultMsg']));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
} else { // resultCode===0000 아닐경우 아래 인증 실패를 출력함
|
||||||
|
// 인증실패
|
||||||
|
alert_close('코드 : '.$_POST['resultCode'].' '.urldecode($_POST['resultMsg']));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$g5['title'] = 'KG이니시스 통합인증 결과';
|
$g5['title'] = 'KG이니시스 통합인증 결과';
|
||||||
include_once(G5_PATH.'/head.sub.php');
|
include_once(G5_PATH.'/head.sub.php');
|
||||||
?>
|
?>
|
||||||
<form name="mbFindForm" method="POST">
|
<form name="mbFindForm" method="POST">
|
||||||
<input type="hidden" name="mb_id" value="<?php echo $row["mb_id"]; ?>">
|
<input type="hidden" name="mb_id" value="<?php echo $row["mb_id"]; ?>">
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
jQuery(function($) {
|
jQuery(function($) {
|
||||||
|
|||||||
@ -1,85 +1,85 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once('./_common.php');
|
include_once('./_common.php');
|
||||||
|
|
||||||
if($_GET['directAgency'] == "KFTC") alert_close("서비스 준비중입니다.");
|
|
||||||
|
|
||||||
$sql = "select MAX(cr_id) as max_cr_id from {$g5['cert_history_table']} limit 1";
|
if($_GET['directAgency'] == "KFTC") alert_close("서비스 준비중입니다.");
|
||||||
$res = sql_fetch($sql);
|
|
||||||
$max_cr_id = $res['max_cr_id'];
|
|
||||||
if(empty($max_cr_id)) $max_cr_id = 0;
|
|
||||||
|
|
||||||
if($config['cf_cert_use'] == 2) { // 실서비스 일때
|
|
||||||
$mid = 'SRA'.$config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의)
|
|
||||||
$apiKey = $config['cf_cert_kg_cd']; // 부여받은 MID 에 대한 apiKey
|
|
||||||
$mTxId ='SIR_'.$max_cr_id;
|
|
||||||
certify_count_check($member['mb_id'], 'sa'); // 금일 인증시도 횟수 체크
|
|
||||||
} else { // 테스트 일때
|
|
||||||
$mid = "INIiasTest";
|
|
||||||
$apiKey = "TGdxb2l3enJDWFRTbTgvREU3MGYwUT09";
|
|
||||||
$mTxId ='test_'.$max_cr_id;
|
|
||||||
}
|
|
||||||
$reqSvcCd ='01';
|
|
||||||
|
|
||||||
// 등록가맹점 확인
|
$sql = "select MAX(cr_id) as max_cr_id from {$g5['cert_history_table']} limit 1";
|
||||||
$plainText1 = hash("sha256",(string)$mid.(string)$mTxId.(string)$apiKey);
|
$res = sql_fetch($sql);
|
||||||
$authHash = $plainText1;
|
$max_cr_id = $res['max_cr_id'];
|
||||||
|
if(empty($max_cr_id)) $max_cr_id = 0;
|
||||||
|
|
||||||
//$flgFixedUser = (!empty($member['mb_id']) && !empty($member['mb_name']) && !empty($member['mb_hp']) && !empty($member['mb_birth']))? 'Y' : 'N'; // 특정사용자 고정시 : Y 세팅및 아래 해시 데이터 생성
|
if($config['cf_cert_use'] == 2) { // 실서비스 일때
|
||||||
$flgFixedUser = 'N'; // 특정사용자 구분하지 않기로 하여 수정
|
$mid = 'SRA'.$config['cf_cert_kg_mid']; // 부여받은 MID(상점ID) 입력(영업담당자 문의)
|
||||||
|
$apiKey = $config['cf_cert_kg_cd']; // 부여받은 MID 에 대한 apiKey
|
||||||
|
$mTxId ='SIR_'.$max_cr_id;
|
||||||
|
certify_count_check($member['mb_id'], 'sa'); // 금일 인증시도 횟수 체크
|
||||||
|
} else { // 테스트 일때
|
||||||
|
$mid = "INIiasTest";
|
||||||
|
$apiKey = "TGdxb2l3enJDWFRTbTgvREU3MGYwUT09";
|
||||||
|
$mTxId ='test_'.$max_cr_id;
|
||||||
|
}
|
||||||
|
$reqSvcCd ='01';
|
||||||
|
|
||||||
// php8버전 값체크 경고 때문에 필수값이 아닌 값이 없을수 있는 선택값들은 초기화해주어야함
|
// 등록가맹점 확인
|
||||||
$userName = '';
|
$plainText1 = hash("sha256",(string)$mid.(string)$mTxId.(string)$apiKey);
|
||||||
$userPhone = '';
|
$authHash = $plainText1;
|
||||||
$userBirth = '';
|
|
||||||
$userHash = '';
|
|
||||||
|
|
||||||
if($flgFixedUser == 'Y') {
|
//$flgFixedUser = (!empty($member['mb_id']) && !empty($member['mb_name']) && !empty($member['mb_hp']) && !empty($member['mb_birth']))? 'Y' : 'N'; // 특정사용자 고정시 : Y 세팅및 아래 해시 데이터 생성
|
||||||
$userName = $member['mb_name']; // 사용자 이름
|
$flgFixedUser = 'N'; // 특정사용자 구분하지 않기로 하여 수정
|
||||||
$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);
|
// php8버전 값체크 경고 때문에 필수값이 아닌 값이 없을수 있는 선택값들은 초기화해주어야함
|
||||||
$userHash = $plainText2;
|
$userName = '';
|
||||||
}
|
$userPhone = '';
|
||||||
|
$userBirth = '';
|
||||||
|
$userHash = '';
|
||||||
|
|
||||||
switch($_GET['pageType']) {
|
if($flgFixedUser == 'Y') {
|
||||||
case "register":
|
$userName = $member['mb_name']; // 사용자 이름
|
||||||
$resultPage = "/kg_result.php";
|
$userPhone = preg_replace("/-/","" , $member['mb_hp']); // 사용자 전화번호 하이픈만 제거
|
||||||
break;
|
$userBirth = $member['mb_birth']; // 사용자 생년월일
|
||||||
case "find":
|
|
||||||
$resultPage = "/kg_find_result.php";
|
$plainText2 = hash("sha256",(string)$userName.(string)$mid.(string)$userPhone.(string)$mTxId.(string)$userBirth.(string)$reqSvcCd);
|
||||||
break;
|
$userHash = $plainText2;
|
||||||
default:
|
}
|
||||||
alert_close('잘못된 접근입니다.');
|
|
||||||
}
|
switch($_GET['pageType']) {
|
||||||
|
case "register":
|
||||||
$resultUrl = G5_KGCERT_URL . $resultPage;
|
$resultPage = "/kg_result.php";
|
||||||
$g5['title'] = 'KG이니시스 통합인증';
|
break;
|
||||||
include_once(G5_PATH.'/head.sub.php');
|
case "find":
|
||||||
|
$resultPage = "/kg_find_result.php";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
alert_close('잘못된 접근입니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$resultUrl = G5_KGCERT_URL . $resultPage;
|
||||||
|
$g5['title'] = 'KG이니시스 통합인증';
|
||||||
|
include_once(G5_PATH.'/head.sub.php');
|
||||||
?>
|
?>
|
||||||
<form name="saForm">
|
<form name="saForm">
|
||||||
<input type="hidden" name="mid" value="<?php echo $mid ?>"> <!-- 필수 값 -->
|
<input type="hidden" name="mid" value="<?php echo $mid ?>"> <!-- 필수 값 -->
|
||||||
<input type="hidden" name="reqSvcCd" value="<?php echo $reqSvcCd ?>"> <!-- 필수 값 -->
|
<input type="hidden" name="reqSvcCd" value="<?php echo $reqSvcCd ?>"> <!-- 필수 값 -->
|
||||||
<input type="hidden" name="mTxId" value="<?php echo $mTxId ?>"> <!-- 필수 값 -->
|
<input type="hidden" name="mTxId" value="<?php echo $mTxId ?>"> <!-- 필수 값 -->
|
||||||
|
|
||||||
<input type="hidden" name="authHash" value="<?php echo $authHash ?>"> <!-- 필수 값 -->
|
<input type="hidden" name="authHash" value="<?php echo $authHash ?>"> <!-- 필수 값 -->
|
||||||
<input type="hidden" name="flgFixedUser" value="<?php echo $flgFixedUser ?>"> <!-- 필수 값 Y/N 특정사용자 인증 요청 여부 -->
|
<input type="hidden" name="flgFixedUser" value="<?php echo $flgFixedUser ?>"> <!-- 필수 값 Y/N 특정사용자 인증 요청 여부 -->
|
||||||
<input type="hidden" name="userName" value="<?php echo $userName ?>">
|
<input type="hidden" name="userName" value="<?php echo $userName ?>">
|
||||||
<input type="hidden" name="userPhone" value="<?php echo $userPhone ?>">
|
<input type="hidden" name="userPhone" value="<?php echo $userPhone ?>">
|
||||||
<input type="hidden" name="userBirth" value="<?php echo $userBirth ?>">
|
<input type="hidden" name="userBirth" value="<?php echo $userBirth ?>">
|
||||||
<input type="hidden" name="userHash" value="<?php echo $userHash ?>">
|
<input type="hidden" name="userHash" value="<?php echo $userHash ?>">
|
||||||
<input type="hidden" name="mbId" value="<?php echo $member['mb_id'] ?>">
|
<input type="hidden" name="mbId" value="<?php echo $member['mb_id'] ?>">
|
||||||
<input type="hidden" name="directAgency" value="<?php echo $_GET['directAgency']; ?>">
|
<input type="hidden" name="directAgency" value="<?php echo $_GET['directAgency']; ?>">
|
||||||
|
|
||||||
<input type="hidden" name="successUrl" value="<?php echo $resultUrl; ?>"> <!-- 필수 값 -->
|
<input type="hidden" name="successUrl" value="<?php echo $resultUrl; ?>"> <!-- 필수 값 -->
|
||||||
<input type="hidden" name="failUrl" value="<?php echo $resultUrl; ?>"> <!-- 필수 값 -->
|
<input type="hidden" name="failUrl" value="<?php echo $resultUrl; ?>"> <!-- 필수 값 -->
|
||||||
<!-- successUrl / failUrl 은 분리 하여 이용가능!-->
|
<!-- successUrl / failUrl 은 분리 하여 이용가능!-->
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
document.saForm.setAttribute("target", "_self");
|
document.saForm.setAttribute("target", "_self");
|
||||||
document.saForm.setAttribute("post", "post");
|
document.saForm.setAttribute("post", "post");
|
||||||
document.saForm.setAttribute("action", "https://sa.inicis.com/auth");
|
document.saForm.setAttribute("action", "https://sa.inicis.com/auth");
|
||||||
document.saForm.submit();
|
document.saForm.submit();
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
include_once(G5_PATH.'/tail.sub.php');
|
include_once(G5_PATH.'/tail.sub.php');
|
||||||
@ -1,89 +1,89 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once('./_common.php');
|
include_once('./_common.php');
|
||||||
|
|
||||||
$txId = $_POST['txId'];
|
$txId = $_POST['txId'];
|
||||||
$mid = substr($txId, 6, 10);
|
$mid = substr($txId, 6, 10);
|
||||||
|
|
||||||
if ($_POST["resultCode"] === "0000") {
|
if ($_POST["resultCode"] === "0000") {
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'mid' => $mid,
|
'mid' => $mid,
|
||||||
'txId' => $txId
|
'txId' => $txId
|
||||||
);
|
);
|
||||||
|
|
||||||
$post_data = json_encode($data);
|
$post_data = json_encode($data);
|
||||||
|
|
||||||
// curl 통신 시작
|
// curl 통신 시작
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, $_POST["authRequestUrl"]);
|
curl_setopt($ch, CURLOPT_URL, $_POST["authRequestUrl"]);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||||
curl_setopt($ch, CURLOPT_POST, 1);
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
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;
|
||||||
|
|
||||||
|
if($res_data['resultCode'] === "0000") {
|
||||||
|
|
||||||
|
@insert_cert_history($member['mb_id'], 'kg', 'sa'); // 인증성공 시 내역 기록
|
||||||
|
|
||||||
|
$cert_type = 'sa'; // 인증타입
|
||||||
|
$cert_no = $res_data['txId']; // 이니시스 트랜잭션 ID
|
||||||
|
$phone_no = $res_data['userPhone']; // 전화번호
|
||||||
|
$user_name = $res_data['userName']; // 이름
|
||||||
|
$birth_day = $res_data['userBirthday']; // 생년월일
|
||||||
|
$ci = $res_data['userCi']; // CI
|
||||||
|
|
||||||
$response = curl_exec($ch);
|
if(!$phone_no)
|
||||||
curl_close($ch);
|
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
||||||
$res_data = json_decode($response, true);
|
|
||||||
// -------------------- 결과 수신 -------------------------------------------
|
|
||||||
// echo '<결과내역>'." '{$mid}' <br/><br/>";
|
|
||||||
// echo $response;
|
|
||||||
|
|
||||||
if($res_data['resultCode'] === "0000") {
|
$md5_ci = md5($ci . $ci);
|
||||||
|
$phone_no = hyphen_hp_number($phone_no);
|
||||||
|
$mb_dupinfo = $md5_ci;
|
||||||
|
|
||||||
@insert_cert_history($member['mb_id'], 'kg', 'sa'); // 인증성공 시 내역 기록
|
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}' ";
|
||||||
|
$row = sql_fetch($sql);
|
||||||
$cert_type = 'sa'; // 인증타입
|
if (!empty($row['mb_id'])) {
|
||||||
$cert_no = $res_data['txId']; // 이니시스 트랜잭션 ID
|
alert_close("입력하신 본인확인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']);
|
||||||
$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("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
|
|
||||||
|
|
||||||
$md5_ci = md5($ci . $ci);
|
|
||||||
$phone_no = hyphen_hp_number($phone_no);
|
|
||||||
$mb_dupinfo = $md5_ci;
|
|
||||||
|
|
||||||
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}' ";
|
|
||||||
$row = sql_fetch($sql);
|
|
||||||
if (!empty($row['mb_id'])) {
|
|
||||||
alert_close("입력하신 본인확인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// hash 데이터
|
|
||||||
|
|
||||||
$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 {
|
|
||||||
// 인증실패 curl의 인증실패 체크
|
|
||||||
alert_close('코드 : '.$res_data['resultCode'].' '.urldecode($res_data['resultMsg']));
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
} else { // resultCode===0000 아닐경우 아래 인증 실패를 출력함
|
|
||||||
// 인증실패
|
// hash 데이터
|
||||||
alert_close('코드 : '.$_POST['resultCode'].' '.urldecode($_POST['resultMsg']));
|
|
||||||
|
$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 {
|
||||||
|
// 인증실패 curl의 인증실패 체크
|
||||||
|
alert_close('코드 : '.$res_data['resultCode'].' '.urldecode($res_data['resultMsg']));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
} else { // resultCode===0000 아닐경우 아래 인증 실패를 출력함
|
||||||
|
// 인증실패
|
||||||
|
alert_close('코드 : '.$_POST['resultCode'].' '.urldecode($_POST['resultMsg']));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$g5['title'] = 'KG이니시스 통합인증 결과';
|
$g5['title'] = 'KG이니시스 통합인증 결과';
|
||||||
include_once(G5_PATH.'/head.sub.php');
|
include_once(G5_PATH.'/head.sub.php');
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
jQuery(function($) {
|
jQuery(function($) {
|
||||||
|
|||||||
Reference in New Issue
Block a user