휴대폰 본인확인시 임의로 폼값을 변경시키는 경우 세션값과 비교하여 변경된 값이 있는지 검사함

This commit is contained in:
gnuboard
2013-04-29 10:10:16 +09:00
parent 58838b8244
commit 17cd514f12
2 changed files with 15 additions and 16 deletions

View File

@ -1,23 +1,24 @@
<?php
include_once('./_common.php');
$w = trim($_POST['mb_hp']);
$w = trim($_POST['w']);
$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\":\"휴대폰인증이 되지 않았습니다. 휴대폰인증을 해주세요.\"}");
if ($w!='' && $w!='u') die("{\"error\":\"w 작업구분 오류\"}");
// 본인인증 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\":\"이름 또는 휴대폰번호가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.\"}");
if ($w=='' || ($w=='u' && $reg_hp != $old_hp)) {
// 본인인증체크
$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\":\"이름 또는 휴대폰번호가 올바르지 않습니다.\\n\\n정상적인 방법으로 이용해 주세요.\"}");
}
die("{\"error\":\"\"}"); // 정상

View File

@ -141,7 +141,6 @@ if( $cert_enc_use == "Y" )
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));
@ -173,8 +172,7 @@ $(function() {
// 인증정보
$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 ?>");
alert("본인의 휴대폰번호로 확인 되었습니다.");
window.close();
});
</script>