이전 패스워드 호환
This commit is contained in:
1 parent
e8730704c1
commit
15c73972de
3 files changed
+25
-18
No files matched your search
@@ -13,7 +13,7 @@ if ($w == 's') {
|
||||
}
|
||||
|
||||
if (!check_password($wr_password, $wr['wr_password'])) {
|
||||
run_event('password_is_wrong', 'bbs', $wr);
|
||||
run_event('password_is_wrong', 'bbs', $wr, $qstr);
|
||||
alert('비밀번호가 틀립니다.');
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ if ($w == 's') {
|
||||
}
|
||||
|
||||
if (!check_password($wr_password, $wr['wr_password'])){
|
||||
run_event('password_is_wrong', 'bbs', $wr);
|
||||
run_event('password_is_wrong', 'bbs', $wr, $qstr);
|
||||
alert('비밀번호가 틀립니다.');
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -312,7 +312,8 @@ if ($w == '') {
|
||||
if (!$is_admin) {
|
||||
if (!($is_member && $member['mb_id'] === $write['mb_id'])) {
|
||||
if (!check_password($wr_password, $write['wr_password'])) {
|
||||
alert('비밀번호가 틀립니다.');
|
||||
$is_wrong = run_replace('invalid_password', false, 'write', $write);
|
||||
if(!$is_wrong) alert('비밀번호가 틀립니다.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
add_event('member_login_check', 'g54_userlogin_after', 10, 2);
|
||||
add_event('memo_list', 'g54_user_memo_insert', 10, 3);
|
||||
add_event('password_is_wrong', 'g54_check_bbs_password', 10, 3);
|
||||
add_replace('invalid_password', 'g54_return_invalid_password', 10, 3);
|
||||
|
||||
// 5.3 버전에서
|
||||
function g54_userlogin_after($mb, $link){
|
||||
global $g5;
|
||||
function g54_return_invalid_password($bool, $type, $wr){
|
||||
if($type === 'write' && $bool === false && $wr['wr_password'] && isset($_POST['wr_password'])) {
|
||||
if(G5_STRING_ENCRYPT_FUNCTION === 'create_hash' && strlen($wr['wr_password']) === G5_MYSQL_PASSWORD_LENGTH) {
|
||||
if( sql_password($_POST['wr_password']) === $wr['wr_password'] ){
|
||||
$bool = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($mb['mb_id']) && $mb['mb_id']){
|
||||
return $bool;
|
||||
}
|
||||
|
||||
$mb_img_paths = array(G5_DATA_PATH.'/member/'.substr($mb['mb_id'], 0, 2).'/', G5_DATA_PATH.'/member_image/'.substr($mb['mb_id'], 0, 2).'/');
|
||||
|
||||
$mb_id = $mb['mb_id'];
|
||||
function g54_check_bbs_password($type, $wr, $qstr){
|
||||
if($type === 'bbs' && $wr['wr_password'] && isset($_POST['wr_password'])) {
|
||||
|
||||
foreach( $mb_img_paths as $path ){
|
||||
$before_file = $path.$mb_id.'.gif';
|
||||
$after_file = $path.get_mb_icon_name($mb_id).'.gif';
|
||||
|
||||
// 회원 아이콘 또는 프로필 파일 이름을 변경
|
||||
if( ($before_file !== $after_file) && file_exists($before_file) && ! file_exists($after_file) ){
|
||||
@rename($before_file, $after_file);
|
||||
global $bo_table;
|
||||
|
||||
if(G5_STRING_ENCRYPT_FUNCTION === 'create_hash' && strlen($wr['wr_password']) === G5_MYSQL_PASSWORD_LENGTH) {
|
||||
if( sql_password($_POST['wr_password']) === $wr['wr_password'] ){
|
||||
$ss_name = 'ss_secret_'.$bo_table.'_'.$wr['wr_num'];
|
||||
set_session($ss_name, TRUE);
|
||||
goto_url(G5_HTTP_BBS_URL.'/board.php?'.$qstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user