g4s 13-04-26일자 코드 반영

This commit is contained in:
chicpro
2013-04-26 10:54:44 +09:00
parent 091092b46a
commit 478605e149
286 changed files with 4409 additions and 3599 deletions

View File

@ -1,3 +1,3 @@
<?
<?php
include_once('../../common.php');
?>

View File

@ -0,0 +1,24 @@
<?php
include_once('./_common.php');
$w = trim($_POST['mb_hp']);
$reg_hp = preg_replace("/[^0-9]/", "", trim($_POST['mb_hp'])); // 숫자외에 문자는 제거
$old_hp = preg_replace("/[^0-9]/", "", trim($_POST['old_mb_hp']));
if ($w=='' || ($w=='u' && $reg_hp != $old_hp)) {
// 본인인증체크
//$kcpcert_no = trim($_POST['kcpcert_no']);
$kcpcert_no = get_session('ss_kcpcert_no');
if(!$kcpcert_no)
die("{\"error\":\"휴대폰인증이 되지 않았습니다. 휴대폰인증을 해주세요.\"}");
// 본인인증 hash 체크
$reg_name = trim($_POST['mb_name']);
$reg_hash = md5($reg_hp.$reg_name.$kcpcert_no);
$ss_hash = get_session('ss_kcpcert_hash');
if(get_session('ss_kcpcert_hash') != $reg_hash)
die("{\"error\":\"이름 또는 휴대폰번호가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.\"}");
}
die("{\"error\":\"\"}"); // 정상
?>

View File

@ -0,0 +1,47 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 핸드폰번호 체크
if ($msg = valid_mb_hp($mb_hp)) alert($msg, "", true, true);
if ($msg = exist_mb_hp($mb_hp, $mb_id)) alert($msg, "", true, true);
$reg_hp = preg_replace("/[^0-9]/", "", $mb_hp);
$hp_len = strlen($reg_hp);
if($hp_len == 10)
$reg_mb_hp = preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "\\1-\\2-\\3", $reg_hp);
else if($hp_len == 11)
$reg_mb_hp = preg_replace("/([0-9]{3})([0-9]{4})([0-9]{4})/", "\\1-\\2-\\3", $reg_hp);
/* ======================================================================================================= */
/* = 휴대폰인증 및 성인인증 = */
/* ======================================================================================================= */
if($w == '') {
// 본인인증체크
$kcpcert_no = get_session('ss_kcpcert_no');
if(!$kcpcert_no)
alert('휴대폰인증이 되지 않았습니다. 휴대폰인증을 해주세요.', '', true, true);
// 본인인증 hash 체크
$reg_hash = md5($reg_hp.$mb_name.$kcpcert_no);
if(get_session('ss_kcpcert_hash') != $reg_hash)
alert('이름 또는 휴대폰번호가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.', '', true, true);
} else if($w == 'u') {
// 휴대폰번호 변경체크
$old_hp = preg_replace("/[^0-9]/", "", $_POST['old_mb_hp']);
if($old_hp !== $reg_hp) {
// 본인인증체크
$kcpcert_no = get_session('ss_kcpcert_no');
if(!$kcpcert_no)
alert('휴대폰번호가 변경됐습니다. 휴대폰인증을 해주세요.', '', true, true);
// 본인인증 hash 체크
$reg_hash = md5($reg_hp.$mb_name.$kcpcert_no);
if(get_session('ss_kcpcert_hash') != $reg_hash)
alert('이름 또는 휴대폰인증 정보가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.', '', true, true);
}
}
/* ======================================================================================================= */
?>

View File

@ -0,0 +1,29 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 휴대폰번호 포맷(010-0000-0000) 변경해서 기록
// $reg_mb_hp 는 rigister_form_update.head.skin.php 파일
$sql = " update {$g4['member_table']}
set mb_hp = '$reg_mb_hp'
where mb_id = '$mb_id' ";
sql_query($sql);
/* =========================================================================== */
/* = 휴대폰인증 및 성인인증 = */
/* =========================================================================== */
if(get_session('ss_kcpcert_no')) {
$mb_adult = 'N';
if(get_session('ss_adult_check') == 'Y')
$mb_adult = 'Y';
$mb_hp_certify = get_session('ss_kcpcert_time');
$sql = " update {$g4['member_table']}
set mb_hp_certify = '$mb_hp_certify',
mb_adult = '$mb_adult'
where mb_id = '$mb_id' ";
sql_query($sql);
}
/* =========================================================================== */
//set_session('ss_adult_check', '');
?>

View File

@ -1,4 +1,4 @@
<?
<?php
include_once('./_common.php');
// /home/kcpcert_enc ( 서버상 bin 폴더 이전까지 경로)
@ -8,6 +8,7 @@ $home_dir = G4_PLUGIN_PATH.'/kcp'; // ct_cli 절대경로 ( bin 전까지 )
//web_siteid 값이 없으면 KCP 에서 지정한 값으로 설정됨
$web_siteid = '';
/*
if($config['cf_kcpcert_site_cd'] && $config['cf_kcpcert_site_cd'] != 'S6186') { // 실인증
$site_cd = $config['cf_kcpcert_site_cd'];
$cert_url = 'https://cert.kcp.co.kr/kcp_cert/cert_view.jsp';
@ -15,9 +16,20 @@ if($config['cf_kcpcert_site_cd'] && $config['cf_kcpcert_site_cd'] != 'S6186') {
$site_cd = 'S6186';
$cert_url = 'https://testcert.kcp.co.kr/kcp_cert/cert_view.jsp';
}
*/
if ($config['cf_kcpcert_use'] == 1) { // 실서비스
$site_cd = 'SM'.$config['cf_kcpcert_site_cd'];
$cert_url = 'https://cert.kcp.co.kr/kcp_cert/cert_view.jsp';
} else if ($config['cf_kcpcert_use'] == -1) { // 테스트사용
$site_cd = 'S6186';
$cert_url = 'https://testcert.kcp.co.kr/kcp_cert/cert_view.jsp';
} else { // 사용안함
$site_cd = '';
$cert_url = '';
}
if(!$site_cd)
alert('KCP 휴대폰인증 사이트코드가 없습니다.\\관리자 > 기본환경설정에 사이트코드를 입력해 주십시오.', G4_URL);
alert('KCP 휴대폰 본인확인 서비스 사이트코드가 없습니다.\\관리자 > 기본환경설정에 KCP 사이트코드를 입력해 주십시오.', G4_URL);
// KCP 인증 라이브러리
require G4_KCP_PATH.'/lib/ct_cli_lib.php';
@ -45,4 +57,7 @@ function f_get_parm_int( $val )
return $ret_val;
}
/* ============================================================================== */
// ss_adult_check clear
//if(get_session('ss_adult_check')) set_session('ss_adult_check', '');
?>

View File

@ -1,17 +1,19 @@
<?
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// kcp 휴대폰인증파일
include_once(G4_KCP_PATH.'/kcpcert_config.php');
if(!$ordr_idxx = get_session('ss_uniqid'))
$ordr_idxx = get_session('ss_uniqid');
if(!$ordr_idxx)
$ordr_idxx = get_uniqid();
?>
<form name="form_auth" method="post" target="auth_popup" action="<?=$cert_url?>">
<form name="form_auth" method="post" target="auth_popup" action="<?php echo $cert_url ?>">
<!-- 유저네임 -->
<input type="hidden" name="user_name" value="" />
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?=$ordr_idxx?>">
<input type="hidden" name="ordr_idxx" value="<?php echo $ordr_idxx ?>">
<!-- 요청종류 -->
<input type="hidden" name="req_tx" value="cert"/>
<!-- 인증종류 -->
@ -23,9 +25,9 @@ if(!$ordr_idxx = get_session('ss_uniqid'))
<input type="hidden" name="fix_commid" value="KTF"/>
-->
<!-- 사이트코드 -->
<input type="hidden" name="site_cd" value="<?= $site_cd ?>" />
<input type="hidden" name="site_cd" value="<?php echo $site_cd; ?>" />
<!-- Ret_URL : 인증결과 리턴 페이지 ( 가맹점 URL 로 설정해 주셔야 합니다. ) -->
<input type="hidden" name="Ret_URL" value="<?=G4_KCP_PATH?>/kcpcert_result.php" />
<input type="hidden" name="Ret_URL" value="<?php echo G4_KCP_URL; ?>/kcpcert_result.php" />
<!-- cert_otp_use 필수 ( 메뉴얼 참고)
Y : 실명 확인 + OTP 점유 확인 , N : 실명 확인 only
-->

View File

@ -1,13 +1,13 @@
<?
<?php
include_once('./kcpcert_config.php');
// utf-8로 넘어돈 post 값을 euc-kr 로 변경
$_POST = array_map("iconv_euckr", $_POST);
$_POST = array_map('iconv_euckr', $_POST);
// UTF-8 환경에서 해시 데이터 오류를 막기 위한 코드
$def_locale = setlocale(LC_CTYPE, 0);
$locale_change = false;
if(preg_match("/utf[\-]?8/i", $def_locale)) {
if(preg_match('/utf[\-]?8/i', $def_locale)) {
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
$locale_change = true;
}
@ -129,7 +129,7 @@ $ct_cert->mf_clear();
{
opener.document.form_auth.veri_up_hash.value = frm.up_hash.value; // up_hash 데이터 검증을 위한 필드
frm.action="<?=$cert_url?>";
frm.action="<?php echo $cert_url ?>";
frm.submit();
}
}
@ -137,12 +137,12 @@ $ct_cert->mf_clear();
</head>
<body oncontextmenu="return false;" ondragstart="return false;" onselectstart="return false;">
<form name="form_auth" method="post">
<?= $sbParam ?>
<?php echo $sbParam ?>
</form>
</body>
</html>
<?
<?php
if($locale_change)
setlocale(LC_CTYPE, $def_locale);
?>

View File

@ -1,6 +1,11 @@
<?
<?php
include_once('./kcpcert_config.php');
set_session('ss_kcpcert_no', '');
set_session('ss_kcpcert_time', '');
set_session('ss_kcpcert_hash', '');
set_session('ss_adult_check', '');
$site_cd = "";
$ordr_idxx = "";
@ -128,23 +133,26 @@ if( $cert_enc_use == "Y" )
// 정상인증인지 체크
if(!$phone_no)
alert_close('정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.');
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");
// hash 데이터
$md5_cert_no = md5($cert_no);
$hash_data = md5($phone_no.$user_name.$md5_cert_no);
set_session('ss_kcpcert_hash', $hash_data);
set_session("ss_kcpcert_no", $md5_cert_no);
set_session("ss_kcpcert_time", G4_TIME_YMDHIS);
set_session("ss_kcpcert_hash", $hash_data);
//alert_close($phone_no.$user_name.$md5_cert_no);
// 성인인증결과
$adult_day = date("Ymd", strtotime("-19 years", G4_SERVER_TIME));
if((int)$birth_day <= (int)$adult_day)
set_session('ss_adult_check', 'Y');
set_session("ss_adult_check", "Y");
}
else if( $res_cd != "0000" )
{
// 인증실패
alert_close('코드 : '.$_POST['res_cd'].' '.urldecode($_POST['res_msg']));
exit;
// 인증실패
alert_close('코드 : '.$_POST['res_cd'].' '.urldecode($_POST['res_msg']));
exit;
}
}
else if( $cert_enc_use != "Y" )
@ -169,9 +177,10 @@ $(function() {
var $opener = window.opener;
// 인증정보
$opener.$("input[name=mb_hp]").val("<?=$phone_no?>");
$opener.$("input[name=kcpcert_no]").val("<?=$md5_cert_no?>");
$opener.$("input[name=kcpcert_time]").val("<?=G4_TIME_YMDHIS?>");
$opener.$("input[name=mb_hp]").val("<?php echo $phone_no ?>");
$opener.$("input[name=mb_name]").val("<?php echo $user_name ?>");
//$opener.$("input[name=kcpcert_no]").val("<?php echo $md5_cert_no ?>");
//$opener.$("input[name=kcpcert_time]").val("<?php echo G4_TIME_YMDHIS ?>");
window.close();
});
</script>