diff --git a/bbs/login_check.php b/bbs/login_check.php index fd83a67bb9..a66ed1c444 100644 --- a/bbs/login_check.php +++ b/bbs/login_check.php @@ -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'); diff --git a/bbs/register_email.php b/bbs/register_email.php index e7fc925371..2d83f2c72e 100644 --- a/bbs/register_email.php +++ b/bbs/register_email.php @@ -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); ?>

메일인증을 받지 못한 경우 회원정보의 메일주소를 변경 할 수 있습니다.

diff --git a/bbs/register_email_update.php b/bbs/register_email_update.php index 36fe66f8f4..12287c6689 100644 --- a/bbs/register_email_update.php +++ b/bbs/register_email_update.php @@ -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); }