Skip to content

Commit

Permalink
메일인증 기능 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chicpro committed Feb 1, 2016
1 parent d0e368f commit 18ef4b0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion bbs/login_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
}

if ($config['cf_use_email_certify'] && !preg_match("/[1-9]/", $mb['mb_email_certify'])) {
confirm("{$mb['mb_email']} 메일로 메일인증을 받으셔야 로그인 가능합니다. 다른 메일주소로 변경하여 인증하시려면 취소를 클릭하시기 바랍니다.", G5_URL, G5_BBS_URL.'/register_email.php?mb_id='.$mb_id);
$ckey = md5($mb['mb_ip'].$mb['mb_datetime']);
confirm("{$mb['mb_email']} 메일로 메일인증을 받으셔야 로그인 가능합니다. 다른 메일주소로 변경하여 인증하시려면 취소를 클릭하시기 바랍니다.", G5_URL, G5_BBS_URL.'/register_email.php?mb_id='.$mb_id.'&ckey='.$ckey);
}

@include_once($member_skin_path.'/login_check.skin.php');
Expand Down
8 changes: 7 additions & 1 deletion bbs/register_email.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@
include_once('./_head.php');

$mb_id = substr(clean_xss_tags($_GET['mb_id']), 0, 20);
$sql = " select mb_email, mb_datetime, mb_email_certify from {$g5['member_table']} where mb_id = '{$mb_id}' ";
$sql = " select mb_email, mb_datetime, mb_ip, mb_email_certify from {$g5['member_table']} where mb_id = '{$mb_id}' ";
$mb = sql_fetch($sql);
if (substr($mb['mb_email_certify'],0,1)!=0) {
alert("이미 메일인증 하신 회원입니다.", G5_URL);
}

$ckey = trim($_GET['ckey']);
$key = md5($mb['mb_ip'].$mb['mb_datetime']);

if(!$ckey || $ckey != $key)
alert('올바른 방법으로 이용해 주십시오.', G5_URL);
?>

<p class="rg_em_p">메일인증을 받지 못한 경우 회원정보의 메일주소를 변경 할 수 있습니다.</p>
Expand Down
11 changes: 7 additions & 4 deletions bbs/register_email_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');
include_once(G5_LIB_PATH.'/mailer.lib.php');

$mb_id = trim($_POST['mb_id']);
$mb_email = trim($_POST['mb_email']);
$mb_id = substr(clean_xss_tags($_POST['mb_id']), 0, 20);
$mb_email = get_email_address(trim($_POST['mb_email']));

$sql = " select mb_name, mb_datetime from {$g5['member_table']} where mb_id = '{$mb_id}' and mb_email_certify <> '' ";
if(!$mb_id || !$mb_email)
alert('올바른 방법으로 이용해 주십시오.', G5_URL);

$sql = " select mb_name, mb_password, mb_email, mb_datetime from {$g5['member_table']} where mb_id = '{$mb_id}' and substring(mb_email_certify, 1, 1) = '0' ";
$mb = sql_fetch($sql);
if ($mb) {
if (!$mb) {
alert("이미 메일인증 하신 회원입니다.", G5_URL);
}

Expand Down

0 comments on commit 18ef4b0

Please sign in to comment.