From 346e4acf417c5aeb6d89bf91678d1f04c8f6b13a Mon Sep 17 00:00:00 2001 From: chicpro Date: Mon, 21 Jan 2013 11:19:16 +0900 Subject: [PATCH] =?UTF-8?q?=EB=94=B0=EC=98=B4=ED=91=9C=20=EB=B0=8F=20php?= =?UTF-8?q?=5Feol=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/password_lost2.php | 34 +++++++++++++++++----------------- bbs/password_lost_certify.php | 18 +++++++++--------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/bbs/password_lost2.php b/bbs/password_lost2.php index 5549a8c26..ab6c05677 100644 --- a/bbs/password_lost2.php +++ b/bbs/password_lost2.php @@ -16,12 +16,12 @@ $email = trim($_POST['mb_email']); if (!$email) alert_close('메일주소 오류입니다.'); -$sql = " select count(*) as cnt from {$g4['member_table']} where mb_email = '{$email}' "; +$sql = " select count(*) as cnt from {$g4['member_table']} where mb_email = '$email' "; $row = sql_fetch($sql); if ($row['cnt'] > 1) - alert('동일한 메일주소가 2개 이상 존재합니다.\n\n관리자에게 문의하여 주십시오.'); + alert('동일한 메일주소가 2개 이상 존재합니다.\\n\\n관리자에게 문의하여 주십시오.'); -$sql = " select mb_no, mb_id, mb_name, mb_nick, mb_email, mb_datetime from {$g4['member_table']} where mb_email = '{$email}' "; +$sql = " select mb_no, mb_id, mb_name, mb_nick, mb_email, mb_datetime from {$g4['member_table']} where mb_email = '$email' "; $mb = sql_fetch($sql); if (!$mb['mb_id']) alert('존재하지 않는 회원입니다.'); @@ -35,17 +35,17 @@ $randval = rand(4, 6); $change_password = substr(md5(get_microtime()), 0, $randval); $mb_lost_certify = sql_password($change_password); -$mb_datetime = sql_password($mb[mb_datetime]); +$mb_datetime = sql_password($mb['mb_datetime']); // 회원테이블에 필드를 추가 -sql_query(" ALTER TABLE `{$g4[member_table]}` ADD `mb_lost_certify` VARCHAR( 255 ) NOT NULL AFTER `mb_memo` ", false); +sql_query(" ALTER TABLE `{$g4['member_table']}` ADD `mb_lost_certify` VARCHAR( 255 ) NOT NULL AFTER `mb_memo` ", false); -$sql = " update {$g4[member_table]} - set mb_lost_certify = '{$mb_lost_certify}' - where mb_id = '{$mb[mb_id]}' "; +$sql = " update {$g4['member_table']} + set mb_lost_certify = '$mb_lost_certify' + where mb_id = '{$mb['mb_id']}' "; sql_query($sql); -$href = $g4[url].'/'.$g4[bbs].'/password_lost_certify.php?mb_no='.$mb[mb_no].'&mb_datetime='.$mb_datetime.'&mb_lost_certify='.$mb_lost_certify; +$href = $g4['url'].'/'.$g4['bbs'].'/password_lost_certify.php?mb_no='.$mb['mb_no'].'&mb_datetime='.$mb_datetime.'&mb_lost_certify='.$mb_lost_certify; $subject = '요청하신 회원아이디/패스워드 정보입니다.'; @@ -54,13 +54,13 @@ $content .= '
'; $content .= '

요청하신 계정정보는 다음과 같습니다.

'; $content .= '
'; $content .= ''; $content .= '
'; $content .= '

'.$href.'

'; @@ -75,7 +75,7 @@ $content .= '

[끝]

'; $content .= '
'; $admin = get_admin('super'); -mailer($admin[mb_nick], $admin[mb_email], $mb[mb_email], $subject, $content, 1); +mailer($admin['mb_nick'], $admin['mb_email'], $mb['mb_email'], $subject, $content, 1); -alert_close($email.' 메일로 회원아이디와 패스워드를 인증할 수 있는 메일이 발송 되었습니다.\n\n메일을 확인하여 주십시오.'); +alert_close($email.' 메일로 회원아이디와 패스워드를 인증할 수 있는 메일이 발송 되었습니다.\\n\\n메일을 확인하여 주십시오.'); ?> \ No newline at end of file diff --git a/bbs/password_lost_certify.php b/bbs/password_lost_certify.php index 8dce632ca..bfd43ad86 100644 --- a/bbs/password_lost_certify.php +++ b/bbs/password_lost_certify.php @@ -3,23 +3,23 @@ include_once('./_common.php'); // 오류시 공히 Error 라고 처리하는 것은 회원정보가 있는지? 패스워드가 틀린지? 를 알아보려는 해킹에 대비한것 -$mb_no = trim($_GET[mb_no]); -$mb_datetime = trim($_GET[mb_datetime]); -$mb_lost_certify = trim($_GET[mb_lost_certify]); +$mb_no = trim($_GET['mb_no']); +$mb_datetime = trim($_GET['mb_datetime']); +$mb_lost_certify = trim($_GET['mb_lost_certify']); // 회원아이디가 아닌 회원고유번호로 회원정보를 구한다. -$sql = " select mb_id, mb_datetime, mb_lost_certify from {$g4[member_table]} where mb_no = '{$mb_no}' "; +$sql = " select mb_id, mb_datetime, mb_lost_certify from {$g4['member_table']} where mb_no = '$mb_no' "; $mb = sql_fetch($sql); -if (!trim($mb[mb_lost_certify])) +if (!trim($mb['mb_lost_certify'])) die("Error"); // 인증 링크는 한번만 처리가 되게 한다. -sql_query(" update {$g4[member_table]} set mb_lost_certify = '' where mb_no = '{$mb_no}' "); +sql_query(" update {$g4['member_table']} set mb_lost_certify = '' where mb_no = '$mb_no' "); // 변경될 패스워드가 넘어와야하고 저장된 변경패스워드를 md5 로 변환하여 같으면 정상 -if ($mb_lost_certify && $mb_datetime === sql_password($mb[mb_datetime]) && $mb_lost_certify === $mb[mb_lost_certify]) { - sql_query(" update {$g4[member_table]} set mb_password = '{$mb[mb_lost_certify]}' where mb_no = '{$mb_no}' "); - alert('이메일로 보내드린 패스워드로 변경 하였습니다.'.PHP_EOL.PHP_EOL.'회원아이디와 변경된 패스워드로 로그인 하시기 바랍니다.', $g4[url].'/'.$g4[bbs].'/login.php'); +if ($mb_lost_certify && $mb_datetime === sql_password($mb['mb_datetime']) && $mb_lost_certify === $mb['mb_lost_certify']) { + sql_query(" update {$g4['member_table']} set mb_password = '{$mb['mb_lost_certify']}' where mb_no = '$mb_no' "); + alert('이메일로 보내드린 패스워드로 변경 하였습니다.\\n\\n회원아이디와 변경된 패스워드로 로그인 하시기 바랍니다.', $g4['url'].'/'.$g4['bbs'].'/login.php'); } else { die("Error");