새로운 인증 수단을 위한 패스워드 확인 없는 로그인 처리 지원 #205

This commit is contained in:
thisgun
2022-11-22 15:08:22 +09:00
parent 21532eb9bf
commit 4c6b833f73
3 changed files with 17 additions and 9 deletions

View File

@ -8,7 +8,7 @@ $mb_password = isset($_POST['mb_password']) ? trim($_POST['mb_password']) : '';
run_event('member_login_check_before', $mb_id);
if (!$mb_id || !$mb_password)
if (!$mb_id || run_replace('check_empty_member_login_password', !$mb_password, $mb_id))
alert('회원아이디나 비밀번호가 공백이면 안됩니다.');
$mb = get_member($mb_id);
@ -27,11 +27,13 @@ if(function_exists('social_is_login_check')){
$is_social_password_check = social_is_login_password_check($mb_id);
}
//소셜 로그인이 맞다면 패스워드를 체크하지 않습니다.
$is_need_not_password = run_replace('login_check_need_not_password', $is_social_password_check, $mb_id, $mb_password, $mb, $is_social_login);
// $is_need_not_password 변수가 true 이면 패스워드를 체크하지 않습니다.
// 가입된 회원이 아니다. 비밀번호가 틀리다. 라는 메세지를 따로 보여주지 않는 이유는
// 회원아이디를 입력해 보고 맞으면 또 비밀번호를 입력해보는 경우를 방지하기 위해서입니다.
// 불법사용자의 경우 회원아이디가 틀린지, 비밀번호가 틀린지를 알기까지는 많은 시간이 소요되기 때문입니다.
if (!$is_social_password_check && (! (isset($mb['mb_id']) && $mb['mb_id']) || !login_password_check($mb, $mb_password, $mb['mb_password'])) ) {
if (!$is_need_not_password && (! (isset($mb['mb_id']) && $mb['mb_id']) || !login_password_check($mb, $mb_password, $mb['mb_password'])) ) {
run_event('password_is_wrong', 'login', $mb);

View File

@ -17,6 +17,8 @@ if( function_exists('social_member_comfirm_redirect') && (! $url || $url === 're
social_member_comfirm_redirect();
}
$url = run_replace('member_confirm_next_url', $url);
$g5['title'] = '회원 비밀번호 확인';
include_once('./_head.sub.php');
@ -31,7 +33,6 @@ if($url){
}
}
$url = get_text($url);
include_once($member_skin_path.'/member_confirm.skin.php');

View File

@ -17,7 +17,7 @@ if ($w == 'u' && $is_admin == 'super') {
alert('데모 화면에서는 하실(보실) 수 없는 작업입니다.');
}
if (!chk_captcha()) {
if (run_replace('register_member_chk_captcha', !chk_captcha(), $w)) {
alert('자동등록방지 숫자가 틀렸습니다.');
}
@ -94,10 +94,15 @@ if ($w == '' || $w == 'u') {
alert('닉네임을 올바르게 입력해 주십시오.');
}
if ($w == '' && !$mb_password)
alert('비밀번호가 넘어오지 않았습니다.');
if($w == '' && $mb_password != $mb_password_re)
alert('비밀번호가 일치하지 않습니다.');
// 비밀번호를 체크하는 상태의 기본값은 true이며, 비밀번호를 체크하지 않으려면 hook 을 통해 false 값으로 바꿔야 합니다.
$is_check_password = run_replace('register_member_password_check', true, $mb_id, $mb_nick, $mb_email, $w);
if ($is_check_password){
if ($w == '' && !$mb_password)
alert('비밀번호가 넘어오지 않았습니다.');
if ($w == '' && $mb_password != $mb_password_re)
alert('비밀번호가 일치하지 않습니다.');
}
if ($msg = empty_mb_name($mb_name)) alert($msg, "", true, true);
if ($msg = empty_mb_nick($mb_nick)) alert($msg, "", true, true);