5.4 버전 hook 이벤트 추가 및 hook 추적에 Object도 가능하게 수정

This commit is contained in:
thisgun
2020-10-19 18:21:17 +09:00
parent df9891e68b
commit 94d04817c7
7 changed files with 57 additions and 13 deletions

View File

@ -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);
?>

View File

@ -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&amp;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);
?>

View File

@ -68,5 +68,7 @@ for ($i=0; $i<$count; $i++)
sql_query($sql);
}
run_event('admin_menu_list_update');
goto_url('./menu_list.php');
?>

View File

@ -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']) {

View File

@ -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]) ){

View File

@ -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];
}

View File

@ -118,13 +118,30 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_PLUGIN_URL.'/debugbar/style.cs
$is_print = $rowspan;
foreach($datas as $data){
$print_function = '';
if( $data['function'] && is_array($data['function']) ){
foreach( (array) $data['function'] as $key=>$fn_name ){
$str_delimiter = '';
if($key) $str_delimiter = ' :: ';
if( is_object($fn_name) ){
$fn_name = get_class($fn_name);
}
$print_function .= $str_delimiter.(string) $fn_name;
}
} else {
$print_function = $data['function'];
}
?>
<tr>
<?php if ($is_print){ ?>
<td scope="row" data-label="event_tag" <?php echo $rowspan; ?>><?php echo $tag.' <span class="hook_count">('.$count.')</span>'; ?></td>
<?php } ?>
<td data-label="event_function">
<?php echo $data['function']; ?>
<?php echo $print_function; ?>
</td>
<td data-label="인수의 수"><?php echo $data['arguments']; ?></td>
<td data-label="우선 순위"><?php echo $data['priority']; ?></td>
@ -194,13 +211,30 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_PLUGIN_URL.'/debugbar/style.cs
$is_print = $rowspan;
foreach($datas as $data){
$print_function = '';
if( $data['function'] && is_array($data['function']) ){
foreach( (array) $data['function'] as $key=>$fn_name ){
$str_delimiter = '';
if($key) $str_delimiter = ' :: ';
if( is_object($fn_name) ){
$fn_name = get_class($fn_name);
}
$print_function .= $str_delimiter.(string) $fn_name;
}
} else {
$print_function = $data['function'];
}
?>
<tr>
<?php if ($is_print){ ?>
<td scope="row" data-label="replace_tag" <?php echo $rowspan; ?>><?php echo $tag.' <span class="hook_count">('.$count.')</span>'; ?></td>
<?php } ?>
<td data-label="replace_function">
<?php echo $data['function']; ?>
<?php echo $print_function; ?>
</td>
<td data-label="인수의 수"><?php echo $data['arguments']; ?></td>
<td data-label="우선 순위"><?php echo $data['priority']; ?></td>