휴대폰인증 처리 파일 인코딩 변경

This commit is contained in:
chicpro
2013-04-09 12:00:04 +09:00
parent ac76b9e503
commit 72c66022b9
2 changed files with 28 additions and 17 deletions
+26 -16
View File
@@ -1,8 +1,16 @@
<?
include_once('./kcpcert_config.php');
// UTF-8 환경에서 해시 데이터 오류를 막기 위한 코드
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
// utf-8로 넘어돈 post 값을 euc-kr 로 변경
$_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)) {
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
$locale_change = true;
}
$req_tx = "";
@@ -18,16 +26,13 @@ $local_code = "";
$up_hash = "";
/*------------------------------------------------------------------------*/
/* :: 전체 파라미터 남기기 */
/* :: 전체 파라미터 남기기 */
/*------------------------------------------------------------------------*/
$ct_cert = new C_CT_CLI;
$ct_cert->mf_clear();
// utf-8로 넘어돈 post 값을 euc-kr 로 변경
$_POST = array_map("iconv_euckr", $_POST);
// request 로 넘어온 값 처리
// request 로 넘어온 값 처리
$key = array_keys($_POST);
$sbParam ="";
@@ -81,16 +86,16 @@ for($i=0; $i<count($key); $i++)
$local_code = f_get_parm_str ( $valParam );
}
// 인증창으로 넘기는 form 데이터 생성 필드
// 인증창으로 넘기는 form 데이터 생성 필드
$sbParam .= "<input type='hidden' name='" . $nmParam . "' value='" . f_get_parm_str( $valParam ) . "'/>";
}
if ( $req_tx == "cert" )
{
// !!up_hash 데이터 생성시 주의 사항
// year , month , day 가 비어 있는 경우 "00" , "00" , "00" 으로 설정이 됩니다
// 그외의 값은 없을 경우 ""(null) 로 세팅하시면 됩니다.
// up_hash 데이터 생성시 site_cd 와 ordr_idxx 는 필수 값입니다.
// !!up_hash 데이터 생성시 주의 사항
// year , month , day 가 비어 있는 경우 "00" , "00" , "00" 으로 설정이 됩니다
// 그외의 값은 없을 경우 ""(null) 로 세팅하시면 됩니다.
// up_hash 데이터 생성시 site_cd 와 ordr_idxx 는 필수 값입니다.
$hash_data = $site_cd .
$ordr_idxx .
$user_name .
@@ -102,7 +107,7 @@ if ( $req_tx == "cert" )
$up_hash = $ct_cert->make_hash_data( $home_dir, $hash_data );
// 인증창으로 넘기는 form 데이터 생성 필드 ( up_hash )
// 인증창으로 넘기는 form 데이터 생성 필드 ( up_hash )
$sbParam .= "<input type='hidden' name='up_hash' value='" . $up_hash . "'/>";
}
@@ -119,10 +124,10 @@ $ct_cert->mf_clear();
{
var frm = document.form_auth;
// 인증 요청 시 호출 함수
// 인증 요청 시 호출 함수
if ( frm.req_tx.value == "cert" )
{
opener.document.form_auth.veri_up_hash.value = frm.up_hash.value; // up_hash 데이터 검증을 위한 필드
opener.document.form_auth.veri_up_hash.value = frm.up_hash.value; // up_hash 데이터 검증을 위한 필드
frm.action="<?=$cert_url?>";
frm.submit();
@@ -135,4 +140,9 @@ $ct_cert->mf_clear();
<?= $sbParam ?>
</form>
</body>
</html>
</html>
<?
if($locale_change)
setlocale(LC_CTYPE, $def_locale);
?>
+2 -1
View File
@@ -159,7 +159,8 @@ $ct_cert->mf_clear();
$(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?>");
window.close();