pc와 mobile에서 공통 코드로 사용하기

This commit is contained in:
gnuboard
2013-04-23 18:39:17 +09:00
parent f03640d548
commit 8e55ec3cf6
2 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,55 @@
<?
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);
/*
// 성인인증을 사용한다면
if($config['cf_adult_check']) {
if(get_session('ss_adult_check') != 'Y')
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 @@
<?
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', '');
?>