diff --git a/plugin/kcpcert/find_kcpcert_result.php b/plugin/kcpcert/find_kcpcert_result.php new file mode 100644 index 000000000..62897faab --- /dev/null +++ b/plugin/kcpcert/find_kcpcert_result.php @@ -0,0 +1,219 @@ +"; +} + +$ct_cert = new C_CT_CLI; +$ct_cert->mf_clear(); + + +$g5['title'] = '휴대폰인증 결과'; +include_once(G5_PATH.'/head.sub.php'); + +// 결과 처리 + +if( $cert_enc_use == "Y" ) +{ + // 인증내역기록 + @insert_cert_history($member['mb_id'], 'kcp', 'hp'); + + if( $res_cd == "0000" ) + { + // dn_hash 검증 + // KCP 가 리턴해 드리는 dn_hash 와 사이트 코드, 주문번호 , 인증번호를 검증하여 + // 해당 데이터의 위변조를 방지합니다 + $veri_str = $site_cd.$ordr_idxx.$cert_no; // 사이트 코드 + 주문번호 + 인증거래번호 + + if ( $ct_cert->check_valid_hash ( $home_dir , $dn_hash , $veri_str ) != "1" ) + { + if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { + // 검증 실패시 처리 영역 + if(PHP_INT_MAX == 2147483647) // 32-bit + $bin_exe = '/bin/ct_cli'; + else + $bin_exe = '/bin/ct_cli_x64'; + } else { + $bin_exe = '/bin/ct_cli_exe.exe'; + } + + echo "dn_hash 변조 위험있음 (".G5_KCPCERT_PATH.$bin_exe." 파일에 실행권한이 있는지 확인하세요.)"; + exit; + // 오류 처리 ( dn_hash 변조 위험있음) + } + + // 가맹점 DB 처리 페이지 영역 + + // 인증데이터 복호화 함수 + // 해당 함수는 암호화된 enc_cert_data 를 + // site_cd 와 cert_no 를 가지고 복화화 하는 함수 입니다. + // 정상적으로 복호화 된경우에만 인증데이터를 가져올수 있습니다. + $opt = "1" ; // 복호화 인코딩 옵션 ( UTF - 8 사용시 "1" ) + $ct_cert->decrypt_enc_cert( $home_dir , $site_cd , $cert_no , $enc_cert_data , $opt ); + + $comm_id = $ct_cert->mf_get_key_value("comm_id" ); // 이동통신사 코드 + $phone_no = $ct_cert->mf_get_key_value("phone_no" ); // 전화번호 + $user_name = $ct_cert->mf_get_key_value("user_name" ); // 이름 + $birth_day = $ct_cert->mf_get_key_value("birth_day" ); // 생년월일 + $sex_code = $ct_cert->mf_get_key_value("sex_code" ); // 성별코드 + $local_code = $ct_cert->mf_get_key_value("local_code" ); // 내/외국인 정보 + $ci = $ct_cert->mf_get_key_value("ci" ); // CI + $di = $ct_cert->mf_get_key_value("di" ); // DI 중복가입 확인값 + $ci_url = urldecode( $ct_cert->mf_get_key_value("ci" ) ); // CI + $di_url = urldecode( $ct_cert->mf_get_key_value("di" ) ); // DI 중복가입 확인값 + $dec_res_cd = $ct_cert->mf_get_key_value("res_cd" ); // 암호화된 결과코드 + $dec_mes_msg = $ct_cert->mf_get_key_value("res_msg" ); // 암호화된 결과메시지 + + if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && function_exists('mb_detect_encoding') ){ + if( mb_detect_encoding($user_name, 'EUC-KR') === 'EUC-KR' ){ + $user_name = iconv_utf8($user_name); + $dec_mes_msg = iconv_utf8($dec_mes_msg); + } + } + + // 정상인증인지 체크 + if(!$phone_no) + alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요."); + + $phone_no = hyphen_hp_number($phone_no); + $mb_dupinfo = $di; + $md5_ci = md5($ci.$ci); + + $row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$md5_ci}'"); // ci데이터로 찾음 + if (!$row['mb_id']) { // ci로 등록된 계정이 없다면 + $row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}'"); // di데이터로 찾음 + if (!$row['mb_id']) { // di로 등록된 계정도 없다면 + alert_close("인증하신 정보로 가입된 회원정보가 없습니다."); + exit; + } + } + } + else if( $res_cd != "0000" ) + { + // 인증실패 + alert_close('코드 : '.$_POST['res_cd'].' '.urldecode($_POST['res_msg'])); + exit; + } +} +else if( $cert_enc_use != "Y" ) +{ + // 암호화 인증 안함 + if( G5_IS_MOBILE ){ + echo ''.PHP_EOL; + } else { + alert_close("휴대폰 본인확인을 취소 하셨습니다."); + } + exit; +} + +$ct_cert->mf_clear(); +?> +
+ "> + +
+ +mf_clear(); - + @@ -108,7 +117,7 @@ function cert_page() if ( ( frm.req_tx.value == "auth" || frm.req_tx.value == "otp_auth" ) ) { - frm.action="./kcpcert_result.php"; + frm.action="."; // MOBILE if( ( navigator.userAgent.indexOf("Android") > - 1 || navigator.userAgent.indexOf("iPhone") > - 1 ) ) diff --git a/plugin/kcpcert/kcpcert_result.php b/plugin/kcpcert/kcpcert_result.php index 111bbdc15..73afce616 100644 --- a/plugin/kcpcert/kcpcert_result.php +++ b/plugin/kcpcert/kcpcert_result.php @@ -149,7 +149,7 @@ if( $cert_enc_use == "Y" ) alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요."); $phone_no = hyphen_hp_number($phone_no); - $mb_dupinfo = $di; + $mb_dupinfo = md5($ci.$ci); $sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$mb_dupinfo}' "; $row = sql_fetch($sql);