2022-09-17 20:50:50 +09:00
|
|
|
<?php
|
2024-09-23 11:07:19 +09:00
|
|
|
include_once "./_common.php";
|
2022-09-17 20:50:50 +09:00
|
|
|
|
2024-09-28 13:03:15 +09:00
|
|
|
// 봇의 메일 링크 크롤링을 방지합니다.
|
|
|
|
|
if (function_exists('check_mail_bot')) {
|
|
|
|
|
check_mail_bot($_SERVER['REMOTE_ADDR']);
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-29 06:47:33 +09:00
|
|
|
EventHandler::triggerEvent("gnuboard.member.password_lost_certify_before");
|
2024-09-28 13:03:15 +09:00
|
|
|
|
2022-09-17 20:50:50 +09:00
|
|
|
// 오류시 공히 Error 라고 처리하는 것은 회원정보가 있는지? 비밀번호가 틀린지? 를 알아보려는 해킹에 대비한것
|
|
|
|
|
|
|
|
|
|
$mb_no = trim($_GET['mb_no']);
|
|
|
|
|
$mb_nonce = trim($_GET['mb_nonce']);
|
|
|
|
|
|
|
|
|
|
// 회원아이디가 아닌 회원고유번호로 회원정보를 구한다.
|
2024-09-30 01:58:32 +09:00
|
|
|
$sql = "SELECT mb_id, mb_lost_certify FROM {$g5['member_table']} where mb_no = '$mb_no' ";
|
2024-09-19 20:57:39 +09:00
|
|
|
$mb = sql_fetch($sql);
|
2022-09-17 20:50:50 +09:00
|
|
|
if (strlen($mb['mb_lost_certify']) < 33)
|
2024-09-19 20:57:39 +09:00
|
|
|
die("Error");
|
2022-09-17 20:50:50 +09:00
|
|
|
|
|
|
|
|
// 인증 링크는 한번만 처리가 되게 한다.
|
2024-09-30 01:58:32 +09:00
|
|
|
sql_query("UPDATE {$g5['member_table']} SET mb_lost_certify = '' where mb_no = '$mb_no' ");
|
2022-09-17 20:50:50 +09:00
|
|
|
|
|
|
|
|
// 인증을 위한 난수가 제대로 넘어온 경우 임시비밀번호를 실제 비밀번호로 바꿔준다.
|
|
|
|
|
if ($mb_nonce === substr($mb['mb_lost_certify'], 0, 32)) {
|
2024-09-19 20:57:39 +09:00
|
|
|
$new_password_hash = substr($mb['mb_lost_certify'], 33);
|
2024-09-30 01:58:32 +09:00
|
|
|
sql_query("UPDATE {$g5['member_table']} SET mb_password = '$new_password_hash' where mb_no = '$mb_no' ");
|
2024-09-28 13:03:15 +09:00
|
|
|
|
2024-09-29 06:47:33 +09:00
|
|
|
EventHandler::triggerEvent("gnuboard.member.password_lost_certify_after", $mb, $mb_nonce);
|
2024-09-28 13:03:15 +09:00
|
|
|
|
2024-09-19 20:57:39 +09:00
|
|
|
alert('비밀번호가 변경됐습니다.\\n\\n회원아이디와 변경된 비밀번호로 로그인 하시기 바랍니다.', G5_BBS_URL . '/login.php');
|
|
|
|
|
} else {
|
|
|
|
|
die("Error");
|
2022-09-17 20:50:50 +09:00
|
|
|
}
|