휴대폰인증 비밀번호 찾기 기능 추가
This commit is contained in:
@ -1,18 +1,26 @@
|
||||
<?
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
if((int)get_cookie('ck_passwordlost_count') > 2)
|
||||
alert_close('아이디/패스워드 찾기를 기준회수이상 시도하였습니다.');
|
||||
?>
|
||||
|
||||
<div id="find_info" class="new_win">
|
||||
<h1>아이디/패스워드 찾기</h1>
|
||||
|
||||
<form name="fpasswordlost" method="post" action="<?=$action_url?>" onsubmit="return fpasswordlost_submit(this);" autocomplete="off">
|
||||
<input type="hidden" name="kcpcert_no" value="">
|
||||
<input type="hidden" name="kcpcert_time" value="">
|
||||
<fieldset id="find_info_fs">
|
||||
<p>
|
||||
회원가입 시 등록하신 이메일 주소를 입력해 주세요.<br>
|
||||
해당 이메일로 아이디와 패스워드 정보를 보내드립니다.
|
||||
회원가입 시 등록하신 이름과 핸드폰번호를 입력해 주세요.
|
||||
</p>
|
||||
<label for="mb_email">E-mail 주소<strong class="sound_only">필수</strong></label>
|
||||
<input type="text" id="mb_email" name="mb_email" class="fs_input email" required size="30">
|
||||
<label for="mb_name">이름<strong class="sound_only">필수</strong></label>
|
||||
<input type="text" id="mb_name" name="mb_name" class="fs_input hangul nospace required" required size="30">
|
||||
<label for="mb_hp">핸드폰번호<strong class="sound_only">필수</strong></label>
|
||||
<input type="text" id="mb_hp" name="mb_hp" class="fs_input required" maxlength="20" required size="30">
|
||||
<button type="button" id="win_kcpcert">휴대폰인증</button>
|
||||
<noscript>휴대폰인증을 위해서는 자바스크립트 사용이 가능해야합니다.</noscript>
|
||||
</fieldset>
|
||||
<?=captcha_html(); ?>
|
||||
<div class="btn_win">
|
||||
@ -22,16 +30,34 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<? // 휴대폰인증 form
|
||||
include_once(G4_BBS_PATH.'/kcp/kcpcert_form.php');
|
||||
?>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('#win_kcpcert').click(function() {
|
||||
var name = document.fpasswordlost.mb_name.value;
|
||||
auth_type_check(name);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function fpasswordlost_submit(f)
|
||||
{
|
||||
// 휴대폰인증 검사
|
||||
if(f.kcpcert_time.value == "") {
|
||||
alert("휴대폰 본인인증을 해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
<? echo chk_captcha_js(); ?>
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
self.focus();
|
||||
document.fpasswordlost.mb_email.focus();
|
||||
document.fpasswordlost.mb_name.focus();
|
||||
|
||||
$(function() {
|
||||
var sw = screen.width;
|
||||
|
||||
89
skin/member/kcpcert/password_lost2.skin.php
Normal file
89
skin/member/kcpcert/password_lost2.skin.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// 조회회수 쿠키에 저장
|
||||
if(!(int)$pl_count = get_cookie('ck_passwordlost_count')) {
|
||||
set_cookie('ck_passwordlost_count', 1, 60*60*1);
|
||||
} else {
|
||||
if($pl_count > 2) {
|
||||
alert_close('아이디/패스워드 찾기를 기준회수이상 시도하였습니다.');
|
||||
} else {
|
||||
$pl_count++;
|
||||
set_cookie('ck_passwordlost_count', $pl_count, 60*60*1);
|
||||
}
|
||||
}
|
||||
|
||||
$mb_name = trim($_POST['mb_name']);
|
||||
$mb_hp = preg_replace("/[^0-9]/", "", $_POST['mb_hp']);
|
||||
|
||||
if(!$mb_name)
|
||||
alert_close('회원 이름을 입력해 주세요.');
|
||||
|
||||
if(!$mb_hp)
|
||||
alert_close('핸드폰번호를 입력해 주세요.');
|
||||
|
||||
// 휴대폰인증체크
|
||||
$kcpcert_no = trim($_POST['kcpcert_no']);
|
||||
if(!$kcpcert_no)
|
||||
alert_close('휴대폰인증이 되지 않았습니다. 휴대폰인증을 해주세요.');
|
||||
|
||||
// 본인인증 hash 체크
|
||||
$reg_hash = md5($mb_hp.$mb_name.$kcpcert_no);
|
||||
if(get_session('ss_kcpcert_hash') != $reg_hash)
|
||||
alert_close('휴대폰인증 정보가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.');
|
||||
|
||||
$len = strlen($mb_hp);
|
||||
if($len == 10)
|
||||
$s_mb_hp = preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "\\1-\\2-\\3", $mb_hp);
|
||||
else if($len == 11)
|
||||
$s_mb_hp = preg_replace("/([0-9]{3})([0-9]{4})([0-9]{4})/", "\\1-\\2-\\3", $mb_hp);
|
||||
|
||||
$sql = " select count(*) as cnt from {$g4['member_table']} where mb_hp = '$s_mb_hp' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['cnt'] > 1)
|
||||
alert('동일한 핸드폰번호가 2개 이상 존재합니다.\\n\\n관리자에게 문의하여 주십시오.');
|
||||
|
||||
$sql = " select mb_id from {$g4['member_table']} where mb_name = '$mb_name' and mb_hp = '$s_mb_hp' ";
|
||||
$mb = sql_fetch($sql);
|
||||
if (!$mb['mb_id'])
|
||||
alert('존재하지 않는 회원입니다.');
|
||||
else if (is_admin($mb['mb_id']))
|
||||
alert('관리자 아이디는 접근 불가합니다.');
|
||||
|
||||
// 난수 발생
|
||||
srand(time());
|
||||
$randval = rand(4, 6);
|
||||
|
||||
$change_password = substr(md5(get_microtime()), 0, $randval);
|
||||
|
||||
$sql = " update {$g4['member_table']}
|
||||
set mb_password = '".sql_password($change_password)."'
|
||||
where mb_id = '{$mb['mb_id']}' ";
|
||||
sql_query($sql);
|
||||
|
||||
$g4['title'] = '회원아이디/패스워드 찾기';
|
||||
include_once(G4_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<div id="find_info" class="new_win">
|
||||
<h1>아이디/패스워드 찾기</h1>
|
||||
|
||||
<form name="fpasswordlost" method="post" action="<?=$action_url?>" onsubmit="return fpasswordlost_submit(this);" autocomplete="off">
|
||||
<fieldset id="find_info_fs">
|
||||
<p>
|
||||
회원님의 아이디와 변경된 패스워드입니다.<br>
|
||||
로그인 후 패스워드를 변경해 주세요.
|
||||
</p>
|
||||
<div>
|
||||
<div> 아이디 : <?=$mb['mb_id']?></div>
|
||||
<div> 패스워드 : <?=$change_password?></div>
|
||||
</div>
|
||||
<div class="btn_win">
|
||||
<a href="javascript:window.close();" class="btn_cancel">확인</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once(G4_PATH.'/tail.sub.php');
|
||||
?>
|
||||
Reference in New Issue
Block a user