From 94d04817c79af057235088c45f8f63d47830fd7f Mon Sep 17 00:00:00 2001 From: thisgun Date: Mon, 19 Oct 2020 18:21:17 +0900 Subject: [PATCH] =?UTF-8?q?5.4=20=EB=B2=84=EC=A0=84=20hook=20=EC=9D=B4?= =?UTF-8?q?=EB=B2=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20hook=20?= =?UTF-8?q?=EC=B6=94=EC=A0=81=EC=97=90=20Object=EB=8F=84=20=EA=B0=80?= =?UTF-8?q?=EB=8A=A5=ED=95=98=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/boardgroup_form_update.php | 2 ++ adm/boardgroup_list_update.php | 18 ++++++++++------ adm/menu_list_update.php | 2 ++ common.php | 6 +++--- lib/common.lib.php | 1 + lib/get_data.lib.php | 3 +-- plugin/debugbar/debugbar.php | 38 ++++++++++++++++++++++++++++++++-- 7 files changed, 57 insertions(+), 13 deletions(-) diff --git a/adm/boardgroup_form_update.php b/adm/boardgroup_form_update.php index b7e5cb4f2..35d8843c1 100644 --- a/adm/boardgroup_form_update.php +++ b/adm/boardgroup_form_update.php @@ -69,5 +69,7 @@ if ($w == '') { alert('제대로 된 값이 넘어오지 않았습니다.'); } +run_event('admin_boardgroup_form_update', $gr_id, $w); + goto_url('./boardgroup_form.php?w=u&gr_id='.$gr_id.'&'.$qstr); ?> diff --git a/adm/boardgroup_list_update.php b/adm/boardgroup_list_update.php index ee8971c2d..b49a673b9 100644 --- a/adm/boardgroup_list_update.php +++ b/adm/boardgroup_list_update.php @@ -10,19 +10,23 @@ auth_check($auth[$sub_menu], 'w'); check_admin_token(); -$count = count($_POST['chk']); +$post_chk = isset($_POST['chk']) ? (array) $_POST['chk'] : array(); +$post_group_id = isset($_POST['group_id']) ? (array) $_POST['group_id'] : array(); +$act_button = isset($_POST['act_button']) ? $_POST['act_button'] : ''; + +$count = count($post_chk); if(!$count) - alert($_POST['act_button'].'할 게시판그룹을 1개이상 선택해 주세요.'); + alert($act_button.'할 게시판그룹을 1개이상 선택해 주세요.'); for ($i=0; $i<$count; $i++) { - $k = $_POST['chk'][$i]; - $gr_id = preg_replace('/[^a-z0-9_]/i', '', $_POST['group_id'][$k]); + $k = $post_chk[$i]; + $gr_id = preg_replace('/[^a-z0-9_]/i', '', $post_group_id[$k]); $gr_subject = is_array($_POST['gr_subject']) ? strip_tags(clean_xss_attributes($_POST['gr_subject'][$k])) : ''; $gr_admin = is_array($_POST['gr_admin']) ? strip_tags(clean_xss_attributes($_POST['gr_admin'][$k])) : ''; - if($_POST['act_button'] == '선택수정') { + if($act_button == '선택수정') { $sql = " update {$g5['group_table']} set gr_subject = '{$gr_subject}', gr_device = '".sql_real_escape_string($_POST['gr_device'][$k])."', @@ -33,7 +37,7 @@ for ($i=0; $i<$count; $i++) if ($is_admin != 'super') $sql .= " and gr_admin = '{$gr_admin}' "; sql_query($sql); - } else if($_POST['act_button'] == '선택삭제') { + } else if($act_button == '선택삭제') { $row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where gr_id = '$gr_id' "); if ($row['cnt']) alert("이 그룹에 속한 게시판이 존재하여 게시판 그룹을 삭제할 수 없습니다.\\n\\n이 그룹에 속한 게시판을 먼저 삭제하여 주십시오.", './board_list.php?sfl=gr_id&stx='.$gr_id); @@ -46,5 +50,7 @@ for ($i=0; $i<$count; $i++) } } +run_event('admin_boardgroup_list_update', $act_button, $chk, $post_group_id, $qstr); + goto_url('./boardgroup_list.php?'.$qstr); ?> diff --git a/adm/menu_list_update.php b/adm/menu_list_update.php index 160c578a7..528a5a42b 100644 --- a/adm/menu_list_update.php +++ b/adm/menu_list_update.php @@ -68,5 +68,7 @@ for ($i=0; $i<$count; $i++) sql_query($sql); } +run_event('admin_menu_list_update'); + goto_url('./menu_list.php'); ?> diff --git a/common.php b/common.php index 4423de19b..8100e85ca 100644 --- a/common.php +++ b/common.php @@ -221,7 +221,7 @@ ini_set("session.cookie_domain", G5_COOKIE_DOMAIN); //------------------------------------------------------------------------------ // 기본환경설정 // 기본적으로 사용하는 필드만 얻은 후 상황에 따라 필드를 추가로 얻음 -$config = get_config(); +$config = get_config(true); // 본인인증 또는 쇼핑몰 사용시에만 secure; SameSite=None 로 설정합니다. if( $config['cf_cert_use'] || (defined('G5_YOUNGCART_VER') && G5_YOUNGCART_VER) ) { @@ -442,7 +442,7 @@ if ($_SESSION['ss_mb_id']) { // 로그인중이라면 $write = array(); $write_table = ""; if ($bo_table) { - $board = get_board_db($bo_table); + $board = get_board_db($bo_table, true); if ($board['bo_table']) { set_cookie("ck_bo_table", $board['bo_table'], 86400 * 1); $gr_id = $board['gr_id']; @@ -465,7 +465,7 @@ if ($bo_table) { } if ($gr_id && !is_array($gr_id)) { - $group = get_group($gr_id); + $group = get_group($gr_id, true); } if ($config['cf_editor']) { diff --git a/lib/common.lib.php b/lib/common.lib.php index 5ea5bfa80..d0fca65d1 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -754,6 +754,7 @@ function get_group($gr_id, $is_cache=false) static $cache = array(); $gr_id = preg_replace('/[^a-z0-9_]/i', '', $gr_id); + $cache = run_replace('get_group_db_cache', $cache, $gr_id, $is_cache); $key = md5($gr_id); if( $is_cache && isset($cache[$key]) ){ diff --git a/lib/get_data.lib.php b/lib/get_data.lib.php index cfa53a81f..430b69d06 100644 --- a/lib/get_data.lib.php +++ b/lib/get_data.lib.php @@ -70,11 +70,10 @@ function get_board_db($bo_table, $is_cache=false){ static $cache = array(); + $bo_table = preg_replace('/[^a-z0-9_]/i', '', $bo_table); $cache = run_replace('get_board_db_cache', $cache, $bo_table, $is_cache); - $key = md5($bo_table); - $bo_table = preg_replace('/[^a-z0-9_]/i', '', $bo_table); if( $is_cache && isset($cache[$key]) ){ return $cache[$key]; } diff --git a/plugin/debugbar/debugbar.php b/plugin/debugbar/debugbar.php index f93cf3be5..fce0c8aad 100644 --- a/plugin/debugbar/debugbar.php +++ b/plugin/debugbar/debugbar.php @@ -118,13 +118,30 @@ add_stylesheet('>('.$count.')'; ?> - + @@ -194,13 +211,30 @@ add_stylesheet('>('.$count.')'; ?> - +